[PR #172] [MERGED] Add session info banner component #193

Closed
opened 2026-05-07 00:19:08 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/172
Author: @sriksven
Created: 1/17/2026
Status: Merged
Merged: 1/18/2026
Merged by: @IAmTomShaw

Base: mainHead: feature/session-info-banner


📝 Commits (1)

  • db647a2 Add session info banner component

📊 Changes

4 files changed (+131 additions, -4 deletions)

View changed files

📝 main.py (+14 -2)
📝 src/arcade_replay.py (+2 -1)
📝 src/interfaces/race_replay.py (+21 -1)
📝 src/ui_components.py (+94 -0)

📄 Description

Session Info Banner Feature

Description

This PR adds a new Session Info Banner component that displays comprehensive race session metadata in a prominent banner at the top-center of the screen.

Problem Solved

Currently, session information (event name, circuit, date, etc.) is only visible in the window title, which is easy to miss. This feature makes essential session metadata clearly visible during race replay without cluttering the interface.

Files Changed:

Technical Details

Data Sources:
All information is sourced from the FastF1 session.event object:

  • Event name, country, location (circuit)
  • Date (formatted as "Month DD, YYYY")
  • Year and round number from user input
  • Total laps from race telemetry

Design Decisions:

  • Position: Top-center to avoid conflicts with existing UI (leaderboard on right, telemetry on left)
  • Size: Max 900px width, 60px height - compact but readable
  • Colors: Dark semi-transparent background (rgba 20,20,20,220), white/gray text
  • Layout: Two-line display for compact presentation

User Controls

  • [I] key - Toggle session info banner on/off

Testing

  • Code compiles without errors (python -m py_compile)
  • Banner displays correctly with all session data
  • Toggle functionality works as expected
  • Adapts to window width (responsive design)
  • Does not obstruct race view or other UI elements
  • Gracefully handles missing data fields

Backwards Compatibility

  • No breaking changes
  • Optional parameter (session_info=None) - works without data
  • Existing functionality unchanged

Contribution Guidelines

Following the roadmap.md contribution guidelines:

  • Focused PR - only session info banner feature
  • Clear description with technical details
  • Aligns with project goal of improving user experience
  • Maintains clean, readable code structure

Additional Notes

This feature enhances the session information display mentioned in community discussions, providing users with always-visible context about what race they're watching. The design is intentionally minimal to maintain the clean aesthetic of the application while adding significant value.


🔄 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/172 **Author:** [@sriksven](https://github.com/sriksven) **Created:** 1/17/2026 **Status:** ✅ Merged **Merged:** 1/18/2026 **Merged by:** [@IAmTomShaw](https://github.com/IAmTomShaw) **Base:** `main` ← **Head:** `feature/session-info-banner` --- ### 📝 Commits (1) - [`db647a2`](https://github.com/IAmTomShaw/f1-race-replay/commit/db647a2c5c078702e64110cf1bf2b32f918df449) Add session info banner component ### 📊 Changes **4 files changed** (+131 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `main.py` (+14 -2) 📝 `src/arcade_replay.py` (+2 -1) 📝 `src/interfaces/race_replay.py` (+21 -1) 📝 `src/ui_components.py` (+94 -0) </details> ### 📄 Description ## Session Info Banner Feature ### Description This PR adds a new **Session Info Banner** component that displays comprehensive race session metadata in a prominent banner at the top-center of the screen. ### Problem Solved Currently, session information (event name, circuit, date, etc.) is only visible in the window title, which is easy to miss. This feature makes essential session metadata clearly visible during race replay without cluttering the interface. **Files Changed:** - [src/ui_components.py](cci:7://file:///Users/sriks/Documents/Projects/f1-race-replay/src/ui_components.py:0:0-0:0) - New [SessionInfoComponent](cci:2://file:///Users/sriks/Documents/Projects/f1-race-replay/src/ui_components.py:867:0-960:25) class (~100 lines) - [src/interfaces/race_replay.py](cci:7://file:///Users/sriks/Documents/Projects/f1-race-replay/src/interfaces/race_replay.py:0:0-0:0) - Component integration and rendering - [src/arcade_replay.py](cci:7://file:///Users/sriks/Documents/Projects/f1-race-replay/src/arcade_replay.py:0:0-0:0) - Pass `session_info` parameter - [main.py](cci:7://file:///Users/sriks/Documents/Projects/f1-race-replay/main.py:0:0-0:0) - Extract session metadata from FastF1 session object ## Technical Details **Data Sources:** All information is sourced from the FastF1 `session.event` object: - Event name, country, location (circuit) - Date (formatted as "Month DD, YYYY") - Year and round number from user input - Total laps from race telemetry **Design Decisions:** - **Position:** Top-center to avoid conflicts with existing UI (leaderboard on right, telemetry on left) - **Size:** Max 900px width, 60px height - compact but readable - **Colors:** Dark semi-transparent background (rgba 20,20,20,220), white/gray text - **Layout:** Two-line display for compact presentation ### User Controls - **[I]** key - Toggle session info banner on/off ### Testing - Code compiles without errors (`python -m py_compile`) - Banner displays correctly with all session data - Toggle functionality works as expected - Adapts to window width (responsive design) - Does not obstruct race view or other UI elements - Gracefully handles missing data fields ### Backwards Compatibility - No breaking changes - Optional parameter (`session_info=None`) - works without data - Existing functionality unchanged ### Contribution Guidelines Following the [roadmap.md](https://github.com/IAmTomShaw/f1-race-replay/blob/main/roadmap.md) contribution guidelines: - Focused PR - only session info banner feature - Clear description with technical details - Aligns with project goal of improving user experience - Maintains clean, readable code structure ### Additional Notes This feature enhances the session information display mentioned in community discussions, providing users with always-visible context about what race they're watching. The design is intentionally minimal to maintain the clean aesthetic of the application while adding significant value. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:19:08 +02:00
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#193
No description provided.