Skip to content

fix(baseball, hockey): a win celebration is selectable as a live mode - #629

Merged
ChuckBuilds merged 1 commit into
mainfrom
fix/celebration-live-modes
Oct 5, 2026
Merged

ChuckBuilds merged 1 commit into
mainfrom
fix/celebration-live-modes

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Problem

In baseball-scoreboard and hockey-scoreboard, has_live_content() returned True during a win celebration while get_live_modes() returned []. A win fires as the game goes final, so the live list is already empty, and get_live_modes() had no celebration branch. The display controller (_collect_live_modes) then saw live content but got no league mode back from the plugin, and fell back to whichever *_live mode name it was scanning -- not necessarily the celebrating league.

Football already carries the fix (get_live_modes, celebration branch inside the enabled + live_priority block, then list(dict.fromkeys(...))).

Fix

  • get_live_modes(): the football branch for every league -- MLB, MiLB, NCAA baseball; NHL, NCAA men's, NCAA women's -- inside the existing enabled and live_priority and hasattr block, before the live-game filter. The return is deduped so a celebration plus a live game in the same league lists the mode once.
  • has_live_content(): its celebration check now skips leagues with live_priority off (_get_active_celebration_manager(live_priority_only=True), read from the league registry). Before this, a celebration in a league with live priority off made has_live_content() True while get_live_modes() could never return that league. needs_high_fps and the display takeover still use the ungated lookup, so nothing changes there.
  • A test stub in test_live_content_log_throttle.py that overrode _get_active_celebration_manager() now accepts the new keyword.

Other scoreboards

  • afl, nrl, and soccer already have the branch.
  • basketball, lacrosse, ufc, and cricket have no celebrations, so they don't need it.
  • Football's has_live_content() has the same ungated celebration check that this PR gates here: with live priority off for a league, it still reports a celebration that get_live_modes() won't return. This PR leaves football alone.

Versions

  • baseball-scoreboard 1.57.3 -> 1.57.4
  • hockey-scoreboard 1.42.4 -> 1.42.5

Each has a new versions[] entry and a CHANGELOG entry. plugins.json is regenerated.

Tests

The new test_celebration_is_a_live_mode.py in each plugin has 14 cases, parametrized over every league:

  • a celebration with an empty live list returns that league's live mode, and has_live_content() agrees;
  • a celebration plus a live game lists the mode once;
  • with the league disabled, or live_priority off, neither method reports the celebration.

Mutation checks: each change, removed on its own, fails tests in both plugins.

Change removed Failing tests (each plugin)
new branch 4
dedupe 3
has_live_content gate 3

run_plugin_tests.py (core main c20c0be), branch vs main:

Plugin Branch Main
baseball 54 pass, 1 fail 53 pass, 1 fail
hockey 43 pass, 0 fail 42 pass, 0 fail

The single baseball failure is the pre-existing test_baseball_activity.py, on both.

Guards:

  • All 48 scripts/test_*.py pass.
  • check_sports_drift passes with no baseline change.
  • These checks also pass: module collisions, scroll adoption, display contract, secrets template, manifests ascii, min-core, manifest version fields, helpers parity, selection settings, team pickers, UI companion keys, core API signatures, readme previews, update_registry.py --check, check_version_bump.py --base origin/main baseball-scoreboard hockey-scoreboard.
  • The core check_plugin.py safety harness passes for both plugins.

🤖 Generated with Claude Code

A win fires as the game goes final, so the game has already left the live
list. has_live_content() reported the celebration, but get_live_modes() only
looked at live games and returned []; the display controller then saw live
content with no league mode of this plugin to resolve it to.

get_live_modes() now appends a celebrating league's live mode inside the same
enabled + live_priority block football uses (MLB, MiLB, NCAA baseball; NHL,
NCAA men's, NCAA women's), and dedupes so a celebration plus a live game in
the same league lists the mode once. has_live_content() applies the same
live_priority gate to celebrations, so the two methods agree.

baseball-scoreboard 1.57.4, hockey-scoreboard 1.42.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 953dc311-191d-48b7-b642-5f6de916782c
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@ChuckBuilds
ChuckBuilds merged commit a519413 into main Oct 5, 2026
5 checks passed
@ChuckBuilds
ChuckBuilds deleted the fix/celebration-live-modes branch October 5, 2026 14:10
ChuckBuilds added a commit that referenced this pull request Oct 5, 2026
…#630)

get_live_modes() only returns a celebrating league's live mode when that
league is enabled with live_priority on, but has_live_content() counted a
celebration in any enabled league. With live priority off for that league
the controller saw live content and got no mode of this plugin for it.

has_live_content() now asks _get_active_celebration_manager(
live_priority_only=True), the same gate baseball and hockey got in #629.
needs_high_fps and the display takeover keep the ungated lookup.

football-scoreboard 3.18.9.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant