Skip to content

feat(f1): let the marquee show only the sections you want - #262

Open
ChuckBuilds wants to merge 2 commits into
mainfrom
feat/f1-vegas-sections
Open

feat(f1): let the marquee show only the sections you want#262
ChuckBuilds wants to merge 2 commits into
mainfrom
feat/f1-vegas-sections

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Why

get_vegas_content() contributed every prepared mode at once. Measured on a 512px panel:

114 images, 14592px total width   ≈ 5m46s of unbroken F1 at 50px/s

The cause is structural rather than data volume — this plugin's own limits are already sane (top_n of 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.sections setting lists which sections join the marquee, defaulting to the next race and the last race's results:

5 images, 640px total width   ≈ 13s     (measured on the same device)

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.

Key Default Description
vegas.sections ["upcoming", "last_race"] Sections that join the marquee

leaders · battles · spotlight · upcoming · last_race · driver_standings · constructor_standings · recent_races · qualifying · practice · sprint · calendar

Details worth noting for review:

  • last_race is the most recent race only; recent_races is all of them. Both now build through _build_race_cards(), so a race is presented identically in either and the recent_races.* toggles keep applying in the marquee.
  • Sections are emitted in a canonical order, not 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.
  • Unknown section names are dropped with a warning rather than failing the list; a list with nothing usable falls back to the default, while a deliberately empty list is honoured.

Verification

  • test_vegas_sections.py added — 23 checks covering defaults, ordering, empty/missing data, the circuit-card toggle, and malformed config. All pass.
  • Existing test_timezone_resolution.py still passes (17 checks).
  • Safety harness passes every panel size, f1_upcoming goldens unchanged.
  • check_module_collisions.py clean.
  • Deployed to a live 512px device and confirmed loading without errors at the numbers quoted above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Udr6MfaFLUPhX5Fgo67Jf5

Summary by CodeRabbit

  • New Features

    • Added configurable F1 sections for the Vegas marquee display.
    • Choose specific sections, control their order, restore all sections, or disable F1 marquee content.
    • Defaults now show the upcoming race and latest race results.
  • Documentation

    • Added configuration guidance and section behavior details.
  • Bug Fixes

    • Improved marquee handling for missing or invalid section settings.
  • Tests

    • Added coverage for default, custom, invalid, and empty configurations.

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
@coderabbitai

coderabbitai Bot commented Aug 7, 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: 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 @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: 08b61bbe-5008-40b0-babc-4eb23113fa8d

📥 Commits

Reviewing files that changed from the base of the PR and between bfbffa0 and 5543192.

📒 Files selected for processing (3)
  • plugins/f1-scoreboard/config_schema.json
  • plugins/f1-scoreboard/manager.py
  • plugins/f1-scoreboard/test_vegas_sections.py
📝 Walkthrough

Walkthrough

The 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.

Changes

F1 Vegas marquee configuration

Layer / File(s) Summary
Configuration contract and release metadata
plugins/f1-scoreboard/config_schema.json, plugins/f1-scoreboard/README.md, plugins/f1-scoreboard/manifest.json, plugins.json
Defines vegas.sections with defaults, ordering, empty-list behavior, and documented section semantics. Updates the plugin and catalog versions.
Race-card storage and Vegas assembly
plugins/f1-scoreboard/manager.py
Stores latest-race cards separately, validates configured sections, preserves canonical ordering, and renders only the selected Vegas content.
Vegas section regression coverage
plugins/f1-scoreboard/test_vegas_sections.py
Tests default and custom selections, ordering, missing data, renderer settings, empty and invalid configuration, warnings, and completion status.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: configurable F1 marquee sections.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/f1-vegas-sections

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 26 complexity

Metric Results
Complexity 26

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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6b643d6 and bfbffa0.

📒 Files selected for processing (6)
  • plugins.json
  • plugins/f1-scoreboard/README.md
  • plugins/f1-scoreboard/config_schema.json
  • plugins/f1-scoreboard/manager.py
  • plugins/f1-scoreboard/manifest.json
  • plugins/f1-scoreboard/test_vegas_sections.py

Comment thread plugins/f1-scoreboard/config_schema.json Outdated
Comment thread plugins/f1-scoreboard/manager.py Outdated
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
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