[GH-ISSUE #267] Refactor: Modularize src/ui_components.py into a dedicated src/ui package #57

Open
opened 2026-05-07 00:18:19 +02:00 by BreizhHardware · 1 comment

Originally created by @OdysseasKalaitsidis on GitHub (Mar 31, 2026).
Original GitHub issue: https://github.com/IAmTomShaw/f1-race-replay/issues/267

Currently, src/ui_components.py is a monolithic file with over 2,300 lines of code, making it difficult to maintain and navigate. To improve the project's long-term health and facilitate easier collaboration, I suggest modularizing it.

Proposed Changes: I've already started working on a local refactor that does the following:

Creates a src/ui/ package.
Moves BaseComponent to src/ui/base.py.
Groups related components into dedicated files: leaderboard.py, weather.py, driver_info.py, controls.py, progress_bar.py, etc.
Keeps src/ui_components.py as a wrapper for backward compatibility.
This change reduces the primary UI file's size significantly and allows for easier unit testing of individual components.

Originally created by @OdysseasKalaitsidis on GitHub (Mar 31, 2026). Original GitHub issue: https://github.com/IAmTomShaw/f1-race-replay/issues/267 Currently, src/ui_components.py is a monolithic file with over 2,300 lines of code, making it difficult to maintain and navigate. To improve the project's long-term health and facilitate easier collaboration, I suggest modularizing it. Proposed Changes: I've already started working on a local refactor that does the following: Creates a src/ui/ package. Moves BaseComponent to src/ui/base.py. Groups related components into dedicated files: leaderboard.py, weather.py, driver_info.py, controls.py, progress_bar.py, etc. Keeps src/ui_components.py as a wrapper for backward compatibility. This change reduces the primary UI file's size significantly and allows for easier unit testing of individual components.
Author
Owner

@OdysseasKalaitsidis commented on GitHub (Mar 31, 2026):

I have a local branch ready with these changes. Would you like me to submit a PR for this refactor?

<!-- gh-comment-id:4162649704 --> @OdysseasKalaitsidis commented on GitHub (Mar 31, 2026): I have a local branch ready with these changes. Would you like me to submit a PR for this refactor?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/f1-race-replay#57
No description provided.