F1 scoreboard: fuller driver names + fix calendar type/date overlap - #222
F1 scoreboard: fuller driver names + fix calendar type/date overlap#222ChuckBuilds wants to merge 2 commits into
Conversation
…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
|
Warning Review limit reached
Next review available in: 7 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe 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. ChangesF1 scoreboard rendering
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 14 |
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
plugins.jsonplugins/f1-scoreboard/f1_renderer.pyplugins/f1-scoreboard/manifest.json
…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
Problem
Two rendering issues in the F1 scoreboard plugin:
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 storeslast_name(and a fullnamefor 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.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)_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/Jolpilast_nameand OpenF1 practicename).Behavior
P1 VERP1 VERSTAPPENP1 VERP1 VER(surname won't fit → code)P2 NORP2 NORRIS(shorter surname fits)Verification
namefield), and that the calendar row no longer overlaps.check_module_collisions.pypasses.Manifest bumped 1.5.1 → 1.6.0.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KEZK1P1Q1fu5pcuVrkrCFZ
Summary by CodeRabbit
New Features
Bug Fixes