[PR #42] # Feature: GUI Main Menu #96

Open
opened 2026-05-07 00:18:38 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/42
Author: @AmanCrafts
Created: 12/14/2025
Status: 🔄 Open

Base: mainHead: main


📝 Commits (1)

  • 1028aac feat: Added a basic GUI Ver 1.0

📊 Changes

5 files changed (+300 additions, -20 deletions)

View changed files

📝 README.md (+5 -0)
📝 main.py (+39 -19)
📝 roadmap.md (+1 -1)
src/interfaces/menu.py (+247 -0)
📝 src/interfaces/race_replay.py (+8 -0)

📄 Description

Description

This PR implements a graphical user interface (GUI) main menu to allow users to select the F1 season (Year), Round, and Session Type directly within the application, removing the strict dependency on command-line arguments.

Key Changes

  • New Menu Interface (src/interfaces/menu.py):
    • Implemented MainMenuWindow using arcade.gui.
    • Added Year Selector (2018-Current).
    • Added Round Selector (Dynamically fetches schedule using fastf1).
    • Added Session Selector (Race, Qualifying, Sprint, Sprint Qualifying).
    • Implemented background threading for schedule fetching to prevent UI freezing (with thread-safe UI updates).
  • Entry Point (main.py):
    • Modified to check for command-line arguments.
    • Launches MainMenuWindow if no arguments are provided.
    • Preserves existing CLI functionality.
  • Bug Fixes:
    • Fixed AttributeError in F1RaceReplayWindow initialization by adding guard clauses in on_resize and update_scaling.
    • Fixed UIAnchorWidget deprecation/usage issue by switching to UIAnchorLayout.

How to Test

  1. Run the application without arguments:
    python main.py
    
  2. Use the controls to select a Year, Round, and Session.
  3. Click "Start Replay" and verify the session loads correctly.
  4. Run with arguments to ensure backward compatibility:
    python main.py --year 2023 --round 1
    

Screenshots

Screenshot 2025-12-14 at 3 42 57 PM

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/IAmTomShaw/f1-race-replay/pull/42 **Author:** [@AmanCrafts](https://github.com/AmanCrafts) **Created:** 12/14/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`1028aac`](https://github.com/IAmTomShaw/f1-race-replay/commit/1028aac11e28fb0cf55a00599348275e2ea8f5ae) feat: Added a basic GUI Ver 1.0 ### 📊 Changes **5 files changed** (+300 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+5 -0) 📝 `main.py` (+39 -19) 📝 `roadmap.md` (+1 -1) ➕ `src/interfaces/menu.py` (+247 -0) 📝 `src/interfaces/race_replay.py` (+8 -0) </details> ### 📄 Description ## Description This PR implements a graphical user interface (GUI) main menu to allow users to select the F1 season (Year), Round, and Session Type directly within the application, removing the strict dependency on command-line arguments. ## Key Changes - **New Menu Interface (`src/interfaces/menu.py`):** - Implemented `MainMenuWindow` using `arcade.gui`. - Added Year Selector (2018-Current). - Added Round Selector (Dynamically fetches schedule using `fastf1`). - Added Session Selector (Race, Qualifying, Sprint, Sprint Qualifying). - Implemented background threading for schedule fetching to prevent UI freezing (with thread-safe UI updates). - **Entry Point (`main.py`):** - Modified to check for command-line arguments. - Launches `MainMenuWindow` if no arguments are provided. - Preserves existing CLI functionality. - **Bug Fixes:** - Fixed `AttributeError` in `F1RaceReplayWindow` initialization by adding guard clauses in `on_resize` and `update_scaling`. - Fixed `UIAnchorWidget` deprecation/usage issue by switching to `UIAnchorLayout`. ## How to Test 1. Run the application without arguments: ```bash python main.py ``` 2. Use the controls to select a Year, Round, and Session. 3. Click "Start Replay" and verify the session loads correctly. 4. Run with arguments to ensure backward compatibility: ```bash python main.py --year 2023 --round 1 ``` ## Screenshots <img width="801" height="620" alt="Screenshot 2025-12-14 at 3 42 57 PM" src="https://github.com/user-attachments/assets/7a10da2d-703a-49c6-89a4-c27aec94ede1" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#96
No description provided.