Skip to content

fix(baseball-scoreboard): show the full slate in Vegas mode, not one game - #229

Open
ChuckBuilds wants to merge 1 commit into
mainfrom
fix/baseball-vegas-multi-game
Open

fix(baseball-scoreboard): show the full slate in Vegas mode, not one game#229
ChuckBuilds wants to merge 1 commit into
mainfrom
fix/baseball-vegas-multi-game

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Problem

In Vegas scroll mode the baseball plugin showed a single game. On a 512px panel that was one 152px card in a ticker that had room for several.

The cause is subtle. get_vegas_content() returned get_all_vegas_content_items() — the union of every scroll display's cached items. Those displays are populated by the standalone rotation as it renders each mode, so Vegas inherited whichever mode had rendered last. With one live game in progress, that reduced the whole ticker entry to that one card. A game held by two displays could also appear twice.

Worse, the combined live/recent/upcoming set was only built when the union came back empty — which is true just after a restart. So the plugin looked correct on boot and silently degraded once the rotation had run, which is exactly the kind of bug that survives a quick check.

Fix

Vegas now reads a dedicated 'mixed' scroll display that the standalone modes cannot clobber, via a new ScrollDisplayManager.get_vegas_content_items_for(game_type). get_all_vegas_content_items() is kept for compatibility.

Measured on a 512×64 panel with live MLB data: 1 game before, 15 after (5 live, 5 recent, 1 upcoming at the time of the first check).

[Baseball Vegas] Rebuilding scroll content (no cached content): 11 game(s) from mlb
[Baseball Vegas] Generated scroll content: 11 games (5 live, 5 recent, 1 upcoming) from mlb
[Baseball Vegas] Returning 11 image(s), 2134px total

Two further fixes fall out of this

Network I/O was on the render path. Building the slate called update(), which froze the Vegas ticker for seconds while it fetched. The slate is now rendered from whatever data the plugin already holds, and is rebuilt only when the games actually change — fingerprinted on the game set plus score, inning, count and final flag. Refreshing data stays the update cycle's job. Every field is read with .get() since game dicts vary by league and completeness.

Building the slate hijacked the standalone scroll. Rendering went through prepare_and_display(), which also repoints the manager's active scroll display. So building the Vegas slate would leave _current_game_type pointing at 'mixed', and the next standalone frame rendered the Vegas slate instead of the mode the rotation was showing. Added prepare_content(), which renders into a display without making it active.

Also

Corrects the game_card_width description, which advised lowering the value on multi-panel chains. That is backwards — on a wide panel cards need to be wider to stay readable. It now suggests roughly display width / 3.

Testing

  • Safety harness at all sizes: all PASS. The extent 0%x0% fill warnings on the larger panels are pre-existing — I verified they reproduce identically on origin/main with my changes stashed.
  • scripts/check_module_collisions.py: OK across 41 plugins.
  • Validated live on hardware (512×64, real MLB data, across several cycles).

Note for reviewers

This overlaps #228 (fix(baseball-scoreboard): stop rendering game start times in UTC), which bumps to 1.20.0 and also touches manager.py, config_schema.json and CHANGELOG.md. I versioned this 1.20.1 so it sequences after #228, but whichever merges second will need a rebase for those three files. Happy to rebase this one once #228 lands.

Companion core-side work is ChuckBuilds/LEDMatrix#423, which reworks Vegas mode dead space and pacing; this fix is what makes baseball fill the space that PR reclaims.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KEZK1P1Q1fu5pcuVrkrCFZ

…game

get_vegas_content() returned get_all_vegas_content_items(), the union of
every scroll display's cached items. Those displays are populated by the
standalone rotation as it renders each mode, so Vegas inherited whichever
mode had rendered last. With one live game in progress that reduced the
entire ticker entry to a single card; it also meant a game held by two
displays could appear twice. The combined live/recent/upcoming set was only
built when the union happened to come back empty, which is true just after a
restart — so the plugin looked correct on boot and silently degraded.

Vegas now reads a dedicated 'mixed' scroll display that the standalone modes
cannot clobber, added as ScrollDisplayManager.get_vegas_content_items_for().
Measured on a 512x64 panel: 1 game before, 15 games after (5 live, 5 recent,
1 upcoming at the time of the first check).

Two further fixes fall out of this:

- Building the slate called update(), putting network I/O on the Vegas render
  path and freezing the ticker for seconds. The slate is now rendered from
  whatever data the plugin already holds, and is rebuilt only when the games
  actually change — fingerprinted on the game set plus score, inning, count
  and final flag. Refreshing data stays the update cycle's job.

- Rendering went through prepare_and_display(), which also repoints the
  manager's active scroll display. Building the Vegas slate would therefore
  hijack an in-progress standalone scroll, so the next frame rendered the
  Vegas slate instead of the mode the rotation was showing. Added
  prepare_content(), which renders without switching the active display.

Also corrects the game_card_width guidance, which advised lowering the value
on multi-panel chains. That is backwards: on a wide panel cards need to be
wider to stay readable. Now suggests roughly display width / 3.

Verified with the safety harness at all sizes (all PASS; the extent-0%
fill warnings on the larger panels are pre-existing and reproduce on
origin/main), plus live on hardware with real MLB data.

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

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next review available in: 31 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: 20d30bbc-bdc7-4593-9060-9928be8b7198

📥 Commits

Reviewing files that changed from the base of the PR and between 3f7c90e and bffdfed.

📒 Files selected for processing (6)
  • plugins.json
  • plugins/baseball-scoreboard/CHANGELOG.md
  • plugins/baseball-scoreboard/config_schema.json
  • plugins/baseball-scoreboard/manager.py
  • plugins/baseball-scoreboard/manifest.json
  • plugins/baseball-scoreboard/scroll_display.py

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

Metric Results
Complexity 0

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.

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