[PR #159] Fix progress bar lap label misalignment #183

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

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/159
Author: @AlgoFoe
Created: 1/8/2026
Status: 🔄 Open

Base: mainHead: bug-fix


📝 Commits (1)

  • d4583c8 fixes progress-bar accuracy

📊 Changes

1 file changed (+48 additions, -23 deletions)

View changed files

📝 src/ui_components.py (+48 -23)

📄 Description

Fixes an issue where the progress bar playhead and lap labels were misaligned (e.g. lap 21 previewed while the bar appeared closer to lap 23–24). #157.

Potential Cause:

  • Progress normalization used frame / total_frames, which treated the timeline as length N instead of frame indices 0..N-1, causing a scale/offset error.
  • Lap markers were estimated uniformly rather than being anchored to actual lap start frames from the race data.

Fix:

  • I added a consistent frame denominator using total_frames - 1.
  • And derived lap marker positions from real lap-start frames when available.

🔄 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/159 **Author:** [@AlgoFoe](https://github.com/AlgoFoe) **Created:** 1/8/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `bug-fix` --- ### 📝 Commits (1) - [`d4583c8`](https://github.com/IAmTomShaw/f1-race-replay/commit/d4583c838b3b677c5174515d3097e98cfefdec06) fixes progress-bar accuracy ### 📊 Changes **1 file changed** (+48 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `src/ui_components.py` (+48 -23) </details> ### 📄 Description Fixes an issue where the progress bar playhead and lap labels were misaligned (e.g. lap 21 previewed while the bar appeared closer to lap 23–24). #157. Potential Cause: - Progress normalization used ```frame / total_frames```, which treated the timeline as length N instead of frame indices 0..N-1, causing a ```scale/offset``` error. - Lap markers were estimated uniformly rather than being anchored to actual lap start frames from the race data. Fix: - I added a consistent frame denominator using ```total_frames - 1```. - And derived lap marker positions from real lap-start frames when available. --- <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#183
No description provided.