Skip to content

F1 scoreboard: fuller driver names + fix calendar type/date overlap - #222

Open
ChuckBuilds wants to merge 2 commits into
mainfrom
feat/f1-fuller-driver-names
Open

F1 scoreboard: fuller driver names + fix calendar type/date overlap#222
ChuckBuilds wants to merge 2 commits into
mainfrom
feat/f1-fuller-driver-names

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Problem

Two rendering issues in the F1 scoreboard plugin:

  1. Driver names were always squished to 3 characters. Every driver render site read only the F1 3-letter code ("VER"), even on panels with plenty of room. The data layer already parses and stores last_name (and a full name for practice sessions) on every entry — those fields were simply never used. Teams already show full names adaptively via _fit_team_name(); drivers had no equivalent.

  2. The race-type badge overlapped the date/time in the race-calendar view. In render_calendar_entry, the session badge had no right-edge clamp, and on tall panels the session time was drawn independently right-aligned on the same row — so a wide label ("SPRINT"/"S.QUALI") collided with it. The badge height was also measured on "A" (no descender) and could bleed into the event-name row.

Changes (f1_renderer.py)

  • Added _fit_driver_name() mirroring _fit_team_name: shows the surname when it fits the measured available width, else falls back to the 3-letter code. Handles both data shapes (Ergast/Jolpi last_name and OpenF1 practice name).
  • Wired it into the driver cards: driver standings, race-result podium, favorite-driver race card, the MY DRIVER spotlight, and the shared qualifying/practice/sprint row. On the timing rows the lap-time width is reserved first so the name only grows into genuinely free space.
  • Left dense timing views on the code by design (points-haul bar chart, gap chart, recent-winners summary, H2H duel) — fixed narrow columns where the 3-letter code is the right convention.
  • Fixed the calendar row: reserve the right-aligned time up front, truncate/clamp the session badge into the remaining width (dropping the weekday first when tight), and cap the badge height so it can't bleed into the event row.

Behavior

Panel Before After
256×64 standings P1 VER P1 VERSTAPPEN
128×32 standings P1 VER P1 VER (surname won't fit → code)
128×32 quali row P2 NOR P2 NORRIS (shorter surname fits)
Calendar (all sizes) badge overlaps date/time date · badge · time cleanly separated

Verification

  • Plugin safety harness: all 48 screens PASS across every size (64×32 → 256×64); the upcoming-mode goldens are unchanged.
  • Rendered the affected cards with realistic mock data at 256×64 / 128×64 / 128×32 and confirmed surnames appear where they fit, fall back to the code where they don't (including deriving the surname from the OpenF1 practice name field), and that the calendar row no longer overlaps.
  • check_module_collisions.py passes.

Manifest bumped 1.5.1 → 1.6.0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KEZK1P1Q1fu5pcuVrkrCFZ

Summary by CodeRabbit

  • New Features

    • Updated the F1 Scoreboard plugin to version 1.6.0.
    • Driver cards now show full surnames when space allows, with compact codes used when needed.
  • Bug Fixes

    • Improved race-calendar layout to prevent badge, date, and time elements from overlapping.
    • Enhanced spacing and alignment across driver, session, and results displays.

…rlap

Driver cards showed only the F1 3-letter code even on panels with room for
more, and the data layer's last_name / practice full-name fields were never
read. Add _fit_driver_name() (mirrors _fit_team_name): shows the surname when
it fits the measured width, else the code. Wire it into the driver standings,
race-result podium, favorite-driver race card, MY DRIVER spotlight, and the
shared qualifying/practice/sprint row (reserving the lap-time width first so
the name only grows into free space). Dense timing views (points-haul, gap
chart, recent winners, H2H) keep the code by design.

Fix the race-calendar row (render_calendar_entry): the session badge had no
right-edge clamp and, on tall panels, collided with the independently
right-aligned session time. Reserve the time width up front, truncate/clamp
the badge into the remaining space (dropping the weekday first when tight),
and cap the badge height so it can't bleed into the event-name row.

Verified with the safety harness (all sizes pass, upcoming goldens unchanged)
and by rendering the affected cards with mock data at 256x64 / 128x64 / 128x32.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KEZK1P1Q1fu5pcuVrkrCFZ
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ChuckBuilds, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d8b717db-10c4-4c63-950f-b09f7e95204b

📥 Commits

Reviewing files that changed from the base of the PR and between c75ec7a and e4adec9.

📒 Files selected for processing (1)
  • plugins/f1-scoreboard/f1_renderer.py
📝 Walkthrough

Walkthrough

The F1 scoreboard now fits driver surnames or short codes across multiple cards, reserves layout space for times and badges, and updates plugin and feed metadata for version 1.6.0.

Changes

F1 scoreboard rendering

Layer / File(s) Summary
Shared driver-name fitting
plugins/f1-scoreboard/f1_renderer.py
Adds surname-or-code fitting across standings, podium, favorite race, driver rows, and the driver spotlight.
Dynamic renderer layout
plugins/f1-scoreboard/f1_renderer.py
Reserves width for times, session badges, weekdays, points, and position labels to prevent overlapping content.
Version and feed metadata
plugins/f1-scoreboard/manifest.json, plugins.json
Publishes version 1.6.0, release notes, and updated timestamps dated 2026-07-28.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main renderer changes: fuller driver names and a calendar overlap fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/f1-fuller-driver-names

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 14 complexity

Metric Results
Complexity 14

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/f1-scoreboard/f1_renderer.py`:
- Around line 979-982: Update the driver-name width calculation in the row-1
rendering flow around _fit_driver_name to stop subtracting
self.header_date_reserve; use the actual available space before the code/status
area instead. Leave header truncation unchanged, and preserve the existing
avail_gap overlap checks for any subsequent gap or status text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4bec661a-77e4-491d-9a81-0ce844c58994

📥 Commits

Reviewing files that changed from the base of the PR and between 7c31f54 and c75ec7a.

📒 Files selected for processing (3)
  • plugins.json
  • plugins/f1-scoreboard/f1_renderer.py
  • plugins/f1-scoreboard/manifest.json

Comment thread plugins/f1-scoreboard/f1_renderer.py
…ate_reserve

The driver name on the favorite-race card is drawn on the content row, not the
header row where the date lives, so reserving header_date_reserve for it was
wrong — it needlessly narrowed the width budget and made surnames fall back to
the 3-letter code early. Bound the name by the team logo (logo_left) instead;
the gap/status text after it keeps its existing avail_gap overlap checks, and
the header race-name truncation is unchanged.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KEZK1P1Q1fu5pcuVrkrCFZ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants