[PR #253] Add fastest lap highlight to leaderboard #252

Open
opened 2026-05-07 00:19:24 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/253
Author: @rawad-yared
Created: 3/13/2026
Status: 🔄 Open

Base: mainHead: feature/fastest-lap-highlight


📝 Commits (1)

  • ef19738 Add fastest lap highlight to race replay leaderboard

📊 Changes

3 files changed (+72 additions, -0 deletions)

View changed files

📝 src/f1_data.py (+61 -0)
📝 src/interfaces/race_replay.py (+3 -0)
📝 src/ui_components.py (+8 -0)

📄 Description

Summary

  • Adds dynamic fastest lap tracking during race replay — the driver holding the fastest lap is highlighted with a purple background on the leaderboard, matching the official F1 broadcast style
  • The fastest lap holder updates in real-time as faster laps are set throughout the race
  • Computes lap completion times from FastF1 session data and walks through frames chronologically so the highlight appears at the correct moment

Changes

  • src/f1_data.py — New _compute_fastest_lap_holders() function that embeds fastest_lap data (driver, formatted time, lap number) into each frame
  • src/interfaces/race_replay.py — Passes fastest lap info from frame data to the window for leaderboard access
  • src/ui_components.py — Renders purple highlight (background + text) for the fastest lap holder in LeaderboardComponent

Test plan

  • Tested with 2025 Bahrain GP (Round 4) — fastest lap holder highlighted correctly
  • Verify with races that have late fastest laps (e.g., drivers pitting for softs on final lap)
  • Verify with sprint races
  • Confirm cached data works after first --refresh-data run

🔄 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/253 **Author:** [@rawad-yared](https://github.com/rawad-yared) **Created:** 3/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/fastest-lap-highlight` --- ### 📝 Commits (1) - [`ef19738`](https://github.com/IAmTomShaw/f1-race-replay/commit/ef19738bb68c55b7c3b083845518fccb8ee6d4bb) Add fastest lap highlight to race replay leaderboard ### 📊 Changes **3 files changed** (+72 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/f1_data.py` (+61 -0) 📝 `src/interfaces/race_replay.py` (+3 -0) 📝 `src/ui_components.py` (+8 -0) </details> ### 📄 Description ## Summary - Adds dynamic fastest lap tracking during race replay — the driver holding the fastest lap is highlighted with a **purple background** on the leaderboard, matching the official F1 broadcast style - The fastest lap holder updates in real-time as faster laps are set throughout the race - Computes lap completion times from FastF1 session data and walks through frames chronologically so the highlight appears at the correct moment ## Changes - `src/f1_data.py` — New `_compute_fastest_lap_holders()` function that embeds `fastest_lap` data (driver, formatted time, lap number) into each frame - `src/interfaces/race_replay.py` — Passes fastest lap info from frame data to the window for leaderboard access - `src/ui_components.py` — Renders purple highlight (background + text) for the fastest lap holder in `LeaderboardComponent` ## Test plan - [x] Tested with 2025 Bahrain GP (Round 4) — fastest lap holder highlighted correctly - [ ] Verify with races that have late fastest laps (e.g., drivers pitting for softs on final lap) - [ ] Verify with sprint races - [ ] Confirm cached data works after first `--refresh-data` run --- <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#252
No description provided.