feat(f1): let the marquee show only the sections you want - #262
feat(f1): let the marquee show only the sections you want#262ChuckBuilds wants to merge 2 commits into
Conversation
get_vegas_content() contributed every prepared mode at once. Measured on a 512px panel that is 114 cards / 14,592px -- close to six minutes of unbroken F1 at 50px/s. The cause is structural rather than data volume: the plugin's own limits are already sane (top_n of 10 drivers, 10 constructors, 5 calendar events). What this plugin's rotation shows as eight separate display cycles, the marquee splices into a single uninterrupted block. Add a vegas.sections setting listing which sections join the marquee, defaulting to the next race and the last race's results -- 5 cards / 640px, about 13 seconds, measured on the same device. All twelve sections stay selectable, so the previous behaviour is a config away, and an empty list keeps F1 out of the marquee while leaving its own display modes running. Those modes are untouched either way. last_race is the most recent race only, where recent_races is all of them; both now build their cards through _build_race_cards() so a race is presented identically in either and the recent_races toggles keep applying. Sections are always emitted in a canonical order rather than the order the user happens to list them in. upcoming still renders per call rather than reading a prepared mode, so its countdown stays current. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Udr6MfaFLUPhX5Fgo67Jf5
|
Warning Review limit reached
Next review available in: 55 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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 (3)
📝 WalkthroughWalkthroughThe F1 Scoreboard plugin now supports ordered Vegas marquee section selection. It stores dedicated latest-race cards, validates section settings, documents the configuration, updates release metadata, and adds standalone regression coverage. ChangesF1 Vegas marquee configuration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Configuration
participant F1ScoreboardPlugin
participant PreparedModes
participant Renderer
Configuration->>F1ScoreboardPlugin: provide vegas.sections
F1ScoreboardPlugin->>F1ScoreboardPlugin: validate and order sections
F1ScoreboardPlugin->>PreparedModes: retrieve selected content
PreparedModes-->>F1ScoreboardPlugin: return prepared mode items
F1ScoreboardPlugin->>Renderer: render selected cards and countdown
Renderer-->>F1ScoreboardPlugin: return Vegas marquee images
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 | 26 |
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: 2
🤖 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/config_schema.json`:
- Line 414: Update the description for the marquee sections configuration to
state that rendering follows the canonical _VEGAS_SECTION_ORDER defined by
F1ScoreboardPlugin.get_vegas_content(), rather than the user-provided listing
order; preserve the existing default and empty-value guidance.
In `@plugins/f1-scoreboard/manager.py`:
- Around line 851-859: Validate the `vegas` configuration value in
`get_vegas_content()` before calling `.get("sections")`, treating null, lists,
strings, and other non-mapping values as malformed and falling back to
`_VEGAS_DEFAULT_SECTIONS`. Preserve the existing sections validation and warning
behavior, and add regression coverage for non-object `vegas` values.
🪄 Autofix
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: cbfc09f1-e529-48ff-b1f8-819218bade36
📒 Files selected for processing (6)
plugins.jsonplugins/f1-scoreboard/README.mdplugins/f1-scoreboard/config_schema.jsonplugins/f1-scoreboard/manager.pyplugins/f1-scoreboard/manifest.jsonplugins/f1-scoreboard/test_vegas_sections.py
Two review findings:
The schema said sections are "shown in the order listed here", which
contradicts both the code and the README -- emission follows the
canonical _VEGAS_SECTION_ORDER whatever order the user lists. Say so,
and name the order so the UI help is self-contained.
Reading vegas.sections went through self.config.get("vegas", {}), which
raises AttributeError if "vegas" is present but not an object. The
schema forbids that, but config.json is hand-edited often enough that
the marquee's render path should not be the thing that discovers it.
Fall back to the default sections with a warning, and cover null, list,
string and scalar values.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Udr6MfaFLUPhX5Fgo67Jf5
Why
get_vegas_content()contributed every prepared mode at once. Measured on a 512px panel:The cause is structural rather than data volume — this plugin's own limits are already sane (
top_nof 10 drivers, 10 constructors, 5 calendar events). What its rotation shows as eight separate display cycles, the Vegas marquee splices into a single uninterrupted block.What changed
A new
vegas.sectionssetting lists which sections join the marquee, defaulting to the next race and the last race's results:All twelve sections stay selectable from the web UI, so the previous behaviour is a config away, and an empty list keeps F1 out of the marquee while leaving its own display modes running. Those modes are untouched either way.
vegas.sections["upcoming", "last_race"]leaders·battles·spotlight·upcoming·last_race·driver_standings·constructor_standings·recent_races·qualifying·practice·sprint·calendarDetails worth noting for review:
last_raceis the most recent race only;recent_racesis all of them. Both now build through_build_race_cards(), so a race is presented identically in either and therecent_races.*toggles keep applying in the marquee.upcomingstill renders per call rather than reading a prepared mode, so its countdown stays current.Verification
test_vegas_sections.pyadded — 23 checks covering defaults, ordering, empty/missing data, the circuit-card toggle, and malformed config. All pass.test_timezone_resolution.pystill passes (17 checks).f1_upcominggoldens unchanged.check_module_collisions.pyclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Udr6MfaFLUPhX5Fgo67Jf5
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Tests