Skip to content

fix(ufc-scoreboard): load the separator icon the plugin ships (1.19.4) - #616

Merged
ChuckBuilds merged 1 commit into
mainfrom
fix/ufc-bundled-separator-icon
Oct 4, 2026
Merged

ChuckBuilds merged 1 commit into
mainfrom
fix/ufc-bundled-separator-icon

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Problem

Every UFC install logs UFC separator icon not found at assets/sports/ufc_logos/UFC.png each time the scroll display is built. One core harness run logged it 25 times. The Vegas ticker also runs UFC's fights with no separator.

  • _load_separator_icons only looked at that path relative to the working directory, which is the LEDMatrix install root on a Pi. Core has never shipped the file (git ls-tree -r origin/main assets/sports has no ufc/mma entry, and no commit in its history touches assets/sports/ufc_logos/).
  • The plugin has shipped its own copy at plugins/ufc-scoreboard/assets/sports/ufc_logos/UFC.png since it was added (feat(ufc): add UFC scoreboard plugin #24), but nothing read it.
  • generate_placeholder_icon.py wrote a cwd-relative file, but only when run by hand, and nothing documented it.

Change

I chose to load the bundled icon rather than only quieting the warning, as #614 did for baseball and basketball. The fix needs no new asset, and UFC is the plugin's only league, so quieting it would have left the separator permanently off.

  • ScrollDisplayManager tries UFC_SEPARATOR_ICON (core path) first, so a PNG there still overrides. It then falls back to BUNDLED_SEPARATOR_ICON, resolved from __file__, as cricket, flights and geochron already do for their assets.
  • If neither exists, the separator is skipped at DEBUG with "(will skip separator)", as baseball, basketball, afl, nrl and soccer do.
  • The core path is still referenced, so it stays in UNSHIPPED_SEPARATOR_ICONS (from fix: plugin asset paths that miss on the Pi's case-sensitive filesystem (leaderboard 1.5.6, baseball 1.57.1, basketball 1.42.1, hockey 1.42.3) #614); only its comment changes.
  • generate_placeholder_icon.py now writes the bundled file, and its docstring no longer implies a manual step.
  • README show_league_separators row and CHANGELOG updated; manifest 1.19.3 -> 1.19.4 (patch: a documented setting that never took effect now does). plugins.json synced.

Visible change: the Vegas ticker now draws the octagon before UFC's fight cards. It is 28x28 at 32 px tall and 60x60 at 64 px, centred, inside the panel edge. The plugin's own switch modes are unchanged.

Testing

All run against a fresh git archive of core origin/main (2236ff30):

  • New plugins/ufc-scoreboard/test_separator_icons.py (standalone, exit 0/1/2), run from a scratch cwd so it doesn't depend on a core checkout's assets/. It checks that the bundled icon loads at display_height - 4 for 32 and 64 px panels, that a core-path file overrides it, and that with neither present it is skipped. In all three cases nothing about separators is logged above DEBUG. On the old loader it fails 5 checks (no separator, plus the warning).
  • scripts/run_plugin_tests.py ufc-scoreboard: 28 passed, 0 skipped, 0 failed.
  • Core check_plugin.py --plugin ufc-scoreboard: all 16 goldens match. The Vegas check goes from 4 elements to 5 (the separator). Its card-width notes and font log lines are identical before and after.
  • Every scripts/test_*.py passes (47), including test_core_asset_paths.py.
  • check_version_bump --base origin/main ufc-scoreboard, update_registry.py --check, check_module_collisions, check_manifests_ascii, check_manifest_version_fields, check_min_core_version, check_sports_drift and check_core_api_signatures all pass.
  • Not run on the board (hdpi).

Notes for reviewer

  • The ufc entry in plugins.json has no commit. update_registry.py would stamp this branch's commit, which won't exist after a squash merge; the registry job on main fills it in.
  • The bundled icon is the placeholder octagon (red, white "UFC"), not an official logo. It reads well from 28 px up. A PNG at the core path replaces it without a plugin change.

🤖 Generated with Claude Code

The scroll display only looked for assets/sports/ufc_logos/UFC.png
relative to the working directory, the LEDMatrix install root on a Pi.
The core has never shipped that file. The plugin has shipped its own
copy since it was added (#24), but nothing read it, so every install
logged "UFC separator icon not found" each time the scroll display was
built (25 times in one harness run) and the Vegas ticker ran UFC's
fights with no separator.

Fall back to the plugin's copy, resolved from __file__. The core path is
tried first, so a PNG there still overrides it; with neither, skip
quietly at debug ("will skip separator"), as baseball, basketball, afl,
nrl and soccer do. The core path stays referenced, so it stays in
UNSHIPPED_SEPARATOR_ICONS; only its comment changes.

generate_placeholder_icon.py now writes the bundled file instead of a
cwd-relative one, and its docstring no longer implies a manual step.

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

coderabbitai Bot commented Oct 4, 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: 5bc4f0fb-b064-4951-b4c5-32d89363ad1d
  • 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 bf7fcf0 into main Oct 4, 2026
5 checks passed
@ChuckBuilds
ChuckBuilds deleted the fix/ufc-bundled-separator-icon branch October 4, 2026 18:28
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