Skip to content

Fix baseball scoreboard scroll display mode ignored outside Vegas mode - #201

Merged
ChuckBuilds merged 7 commits into
mainfrom
claude/baseball-scoreboard-scroll-mode-yft8sw
Jul 17, 2026
Merged

Fix baseball scoreboard scroll display mode ignored outside Vegas mode#201
ChuckBuilds merged 7 commits into
mainfrom
claude/baseball-scoreboard-scroll-mode-yft8sw

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the Baseball Scoreboard's Live/Recent/Upcoming Display Mode setting being ignored when set to "Scroll" outside of Vegas mode. Games kept flipping/switching one at a time instead of scrolling, even though the config was set to scroll.

Type of change

  • Bug fix in an existing plugin

Plugin(s) affected

baseball-scoreboard

Related issues

N/A — reported directly by a user, no linked issue.

Root cause

display() routes every granular per-league mode (mlb_live, mlb_recent, mlb_upcoming, milb_*, ncaa_baseball_* — the only modes registered in manifest.json) straight to _display_league_mode(). That method never checked the live_display_mode/recent_display_mode/upcoming_display_mode config and always fell through to the switch/flip behavior via _try_manager_display().

The existing scroll machinery (_should_use_scroll_mode, _display_scroll_mode) was only reachable from _display_external_mode()'s "combined mode" branch — a code path display() never actually calls for granular modes (there's even a self-aware log line admitting this in the code). Vegas mode worked because it bypasses display() entirely and calls the scroll manager directly and unconditionally via get_vegas_content()_collect_games_for_scroll(mode_type=None, ...).

Fix

Added _display_league_scroll_mode(), called from _display_league_mode() whenever the league/mode's configured display mode is 'scroll'. It mirrors _display_scroll_mode()'s prepare/display-frame/is-complete flow but is scoped to a single league. Since the underlying ScrollDisplayManager keeps one active scroll session per mode_type (shared across leagues), it also tracks which league's content is currently prepared and forces a re-prepare when that changes (e.g. rotation switches from mlb_live to milb_live and both are set to scroll), so leagues don't stomp on each other's scroll state.

Test plan

  • Loaded the plugin in LEDMatrix on real hardware
  • Loaded the plugin in LEDMatrix emulator mode (EMULATOR=true python3 run.py)
  • Rendered the plugin in the dev preview server (scripts/dev_server.py)
  • Verified the web UI configuration form against the schema
  • Verified python3 -m py_compile and scripts/check_module_collisions.py pass; confirmed every referenced method exists via AST parse. Runtime verification (setting MLB Display Mode to Scroll and observing on-device/emulator behavior) was not performed in this environment — please verify on hardware/emulator before merge.

Required for plugin changes

  • Bumped version in plugins/baseball-scoreboard/manifest.json (1.19.0 → 1.19.1)
  • class_name unchanged, still matches manager.py
  • entry_point unchanged
  • Updated the plugin's README.md — no config keys changed, so no update needed
  • config_schema.json unchanged (no new options — fixing existing scroll config to actually work)
  • Pre-commit hook ran successfully (auto-synced plugins.json)

Notes for reviewer

The fix intentionally scopes scroll state by mode_type only (matching the existing {game_type: is_active} comment/design in __init__), not by league+mode_type, because ScrollDisplayManager itself only keeps one ScrollDisplay per game_type. A per-league scroll_key would silently show stale/wrong-league content when rotation switches leagues. The new _scroll_active_league dict detects that case and forces a re-prepare.


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Fixed Scroll mode for granular Live/Recent/Upcoming rotations so it works correctly outside Vegas (MLB, MiLB, NCAA Baseball).
    • Updated scrolling cycle timing and completion logic to respect the selected league’s configuration, including live-priority filtering when applicable.
  • Release

    • Updated the baseball scoreboard plugin to version 1.19.2.

_display_league_mode() (the path display() actually uses for granular
modes like mlb_live/mlb_recent/mlb_upcoming) never checked the
live_display_mode/recent_display_mode/upcoming_display_mode config --
it always fell through to switch/flip behavior via _try_manager_display.
The scroll wiring (_should_use_scroll_mode, _display_scroll_mode) only
existed on a combined-mode code path that display() never calls for
granular modes, so the Scroll setting had no effect. Vegas mode worked
because it bypasses display() entirely and calls the scroll manager
directly and unconditionally.

Add _display_league_scroll_mode(), invoked from _display_league_mode()
when the league/mode's display_mode is 'scroll'. It mirrors
_display_scroll_mode() but is scoped to a single league, and tracks
which league's content is currently prepared per mode_type so rotating
between leagues that are both set to scroll (e.g. mlb_live and
milb_live) forces a re-prepare instead of reusing stale content.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gfy4jbtgTQHjxbFwYqd7wG
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7e90bbe9-1edf-46c8-8ca2-d9861f2c4a2c

📥 Commits

Reviewing files that changed from the base of the PR and between 2c7edfd and 688734b.

📒 Files selected for processing (2)
  • plugins/baseball-scoreboard/manager.py
  • plugins/baseball-scoreboard/manifest.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/baseball-scoreboard/manager.py

📝 Walkthrough

Walkthrough

The baseball scoreboard now prepares scroll content per league for granular Live, Recent, and Upcoming modes. It resets active-league state on configuration changes, updates league-specific cycle checks, and documents the fix in version 1.19.2.

Changes

Baseball scroll-mode support

Layer / File(s) Summary
Scroll state and league-mode routing
plugins/baseball-scoreboard/manager.py
Tracks the active league for each scroll mode, resets it on configuration changes, and routes configured league scroll modes to dedicated handling.
League scroll preparation, playback, and cycle checks
plugins/baseball-scoreboard/manager.py
Prepares selected-league games with live prioritization where applicable, advances scroll frames, detects completion, and uses the specific league configuration for duration and completion checks.
Release note for the scroll fix
plugins/baseball-scoreboard/manifest.json
Documents the granular Live/Recent/Upcoming scroll fix in version 1.19.2 while retaining the advanced-settings note.

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

Sequence Diagram(s)

sequenceDiagram
  participant DisplayMode as _display_league_mode
  participant ScrollMode as _display_league_scroll_mode
  participant ScrollManager as ScrollDisplayManager
  DisplayMode->>ScrollMode: delegate selected league scroll mode
  ScrollMode->>ScrollManager: prepare league games
  ScrollMode->>ScrollManager: display_frame
  ScrollManager-->>ScrollMode: report is_complete(mode_type)
Loading

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 matches the main fix: enabling Scroll display mode outside Vegas for the baseball scoreboard.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/baseball-scoreboard-scroll-mode-yft8sw

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

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.

@ChuckBuilds

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

🤖 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/baseball-scoreboard/manager.py`:
- Around line 1549-1552: Update the duration and completion checks near the
paths corresponding to lines 2624 and 2912 to call _get_display_mode(league,
mode_type), matching the league-specific routing in _display_league_scroll_mode.
Remove any global “any league uses scroll” classification so each league
receives only its own mode’s scroll state.
- Around line 1696-1709: Update the display_frame failure branch in the scroll
handling flow to also reset self._scroll_prepared[mode_type] to False when
playback returns False. Preserve the existing inactive-state reset and False
return so the next call can prepare and retry the league.

In `@plugins/baseball-scoreboard/manifest.json`:
- Around line 33-38: Update the new release entry in the manifest to version
1.19.2, rename its minimum-version field from ledmatrix_min_version to
ledmatrix_min, and synchronize the top-level version with 1.19.2. Preserve the
required released, version, and ledmatrix_min fields for the entry while keeping
the existing 1.19.1 history intact.
🪄 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

Run ID: 63bec854-af5b-4106-bd54-6343ba396a35

📥 Commits

Reviewing files that changed from the base of the PR and between edaf3e5 and 2c7edfd.

📒 Files selected for processing (2)
  • plugins/baseball-scoreboard/manager.py
  • plugins/baseball-scoreboard/manifest.json

Comment thread plugins/baseball-scoreboard/manager.py
Comment thread plugins/baseball-scoreboard/manager.py
Comment thread plugins/baseball-scoreboard/manifest.json
claude and others added 5 commits July 17, 2026 16:12
…board-scroll-mode-yft8sw

# Conflicts:
#	plugins/baseball-scoreboard/manifest.json
…aware duration/completion checks

- _display_league_scroll_mode: reset _scroll_prepared and
  _scroll_active_league (not just _scroll_active) when display_frame()
  fails, so the next call re-prepares and retries instead of getting
  stuck in a prepared-but-inactive state.
- get_cycle_duration() and is_cycle_complete(): use the granular mode's
  own _get_display_mode(league, mode_type) instead of
  _should_use_scroll_mode(mode_type) (which is true if *any* enabled
  league uses scroll). Previously a league configured for 'switch' could
  report another league's scroll duration/completion state just because
  that other league was set to 'scroll' for the same game type.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gfy4jbtgTQHjxbFwYqd7wG
…l-mode-yft8sw' into claude/baseball-scoreboard-scroll-mode-yft8sw

# Conflicts:
#	plugins/baseball-scoreboard/manifest.json
@ChuckBuilds
ChuckBuilds merged commit 81fc048 into main Jul 17, 2026
3 of 4 checks passed
@ChuckBuilds
ChuckBuilds deleted the claude/baseball-scoreboard-scroll-mode-yft8sw branch July 17, 2026 18:51
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