Skip to content

Make the stock/odds tickers pixel-perfect on the LED grid - #258

Merged
ChuckBuilds merged 1 commit into
mainfrom
claude/nfl-leaderboard-display-q1kul0-tickers
Aug 5, 2026
Merged

Make the stock/odds tickers pixel-perfect on the LED grid#258
ChuckBuilds merged 1 commit into
mainfrom
claude/nfl-leaderboard-display-q1kul0-tickers

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Pull Request

Summary

Applies the same pixel-perfect fixes from #255 to the three other tickers that needed them: anti-aliased text in all three, and the height * 1.2 logo crop in odds-ticker. news already had this — it's where the fontmode idiom came from — so it's untouched.

Note: this was meant to go into #255, but that merged while I was working. Per the repo's branch rules a merged PR can't take new commits, so this is a fresh branch off the new main and a new PR. It rebases cleanly on top of #256.

Type of change

  • Bug fix in an existing plugin
  • New plugin (also fill out the SUBMISSION.md checklist below)
  • New feature for an existing plugin
  • Documentation only
  • Repo-wide change (registry script, hook, top-level docs)

Plugin(s) affected

stock-news (2.4.6 → 2.5.0), ledmatrix-stocks (2.6.0 → 2.7.0), odds-ticker (1.1.10 → 1.2.0)

Related issues

Follow-up to #255.

What changed, and how much it mattered

PIL anti-aliases text by default, and on a 1:1 LED matrix a partially-lit pixel is a visibly dim LED, not a smooth edge. None of these three set fontmode. Each now routes every draw surface — including the scratch canvases used only to measure text, so metrics can't disagree with what's drawn — through a _pixel_draw() helper.

Measured on the string AAPL +1.2% Earnings:

Plugin Case Before After
stock-news auto font size on a 32px panel (= 10) 57% partial-lit 0%
odds-ticker user-set font size of 12 41% partial-lit 0%
ledmatrix-stocks user-set font size of 12 41% partial-lit 0%

odds-ticker and ledmatrix-stocks default their element sizes to 8, which is already on Press Start 2P's grid — so their defaults were crisp by luck rather than by construction, and only custom sizes were affected. Their default look is unchanged. stock-news is the one with a visible default-case fix.

Font grid (stock-news only). Its auto size is max(6, min(16, height // 3)), which lands on 10 for a 32px panel — off Press Start 2P's 8px grid, so strokes alternate 1px and 2px wide even with anti-aliasing off. It's now snapped to the grid. Only the 32px case changes (10 → 8); 48/64/96px panels already resolved to 16. An explicit font_size is honoured as typed.

Logos (odds-ticker only). logo_size = int(height * 1.2) combined with y_pos = (height - logo_size) // 2 gives -3 on a 32px panel, so the top and bottom 3px of every team logo was cropped off the panel — the same bug the leaderboard had. Logos now fit inside it.

Test plan

  • Loaded the plugin in LEDMatrix on real hardware

  • Loaded the plugin in LEDMatrix emulator mode (EMULATOR=true python3 run.py)

  • Rendered against a core checkout; measured before/after anti-aliasing and logo geometry directly in pixels

  • Verified the web UI configuration form against the schema (no schema changes in this PR)

  • N/A — repo-wide / docs-only change

  • Safety harness: all three plugins PASS at all 8 sizes. stock-news and odds-ticker were re-run after the rebase onto fix(odds-ticker): restore team logos for NCAA basketball and baseball #256. ledmatrix-stocks was slow to verify — it retries blocked Yahoo Finance calls for every symbol at every size — but its run has since completed and passes; its files are byte-identical between that run and the rebased HEAD, so the result covers the code in this PR.

  • check_module_collisions.py: OK across 43 plugins.

  • check_manifest_version_fields.py: OK for all three.

  • news's own 16 tests still pass (it is untouched, but it shares the idiom).

  • Bandit on the changed files: no new findings. Codacy: 0 new issues.

Remaining gap: not verified on real hardware — no panel in this environment, so the crispness claims rest on pixel measurements, not a photo of the matrix.

Required for plugin changes

  • Bumped version in plugins/<id>/manifest.json for all three, each with a versions changelog entry
  • class_name matches the actual class in each entry point
  • entry_point matches the real file
  • Updated the plugin's README.md if config keys changed — no config keys changed in this PR
  • config_schema.json is the source of truth for the web UI form — no schema changes needed
  • Pre-commit hook ran successfully (plugins.json synced)

Checklist

  • My commits follow the message convention in CONTRIBUTING.md
  • I read CONTRIBUTING.md and CODE_OF_CONDUCT.md
  • I've not committed any secrets

Notes for reviewer

  • plugins.json carries unrelated version bumps. update_registry.py syncs every plugin, and the registry in main was stale for ~15 plugins whose manifests were already ahead. Since CLAUDE.md says the file is generated and must not be hand-edited, I left the script's output as-is rather than surgically reverting those lines. They're the same values update-registry.yml would write on the next push to main.
  • The scoreboards were deliberately left out. 10 of the 11 also lack fontmode (baseball is partially done: 3 of 17 draw surfaces). Separately, they scale logos to display_height * 1.5 — but unlike the ticker case that reads like an intentional design, a large team logo bleeding off the panel behind the score, so I didn't touch it. Both are worth a follow-up if you want them; say the word and the scoreboard fontmode sweep is mechanical.
  • odds-ticker's _pixel_draw was applied by regex across both files; I verified fix(odds-ticker): restore team logos for NCAA basketball and baseball #256's LEAGUE_LOGO_DIRS and _missing_logo_warned work survived the rebase intact and coexists with it.

Follows the same three defects fixed in the leaderboard (#255). news
already had this -- it is where the fontmode idiom came from -- so it is
untouched here.

Anti-aliasing. PIL anti-aliases text by default, and on a 1:1 LED matrix
a partially-lit pixel is a visibly dim LED rather than a smooth edge.
None of these three plugins set fontmode, so all their text carried the
fringe. Each now routes every draw surface -- including the scratch
canvases used only to measure text, so metrics cannot disagree with what
is drawn -- through a _pixel_draw() helper that sets fontmode "1".

How much that mattered differed per plugin, measured on the string
"AAPL +1.2% Earnings":

- stock-news derives its font size from the panel height when one is not
  configured, and height//3 lands on 10 for a 32px panel. Press Start 2P
  only rasterises cleanly at multiples of 8, so 57% of the lit pixels
  were partial. Now 0%.
- odds-ticker and ledmatrix-stocks default their element sizes to 8,
  already on the grid, so their defaults were crisp by luck rather than
  by construction -- any size a user set in the customization UI was
  not. At a configured 12: 41% partial before, 0% after.

Font grid. stock-news' auto size is now snapped to the font's grid, so
the 32px panel gets 8 instead of 10 and glyph pixels map 1:1 rather than
alternating 1px and 2px strokes. Only that case changes; 48/64/96px
panels already resolved to 16. An explicit font_size is honoured as
typed.

Logos. odds-ticker sized team logos to int(height * 1.2) and then
centred them with (height - logo_size) // 2, which is -3 on a 32px
panel -- so the top and bottom of every logo was cropped off the panel,
the same bug the leaderboard had. Logos now fit inside the panel.

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

coderabbitai Bot commented Aug 5, 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: 41 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: 5cd22fa3-ca5b-4be7-ad5a-fe6ad301bcbc

📥 Commits

Reviewing files that changed from the base of the PR and between 5411354 and 52b613e.

📒 Files selected for processing (9)
  • plugins.json
  • plugins/ledmatrix-stocks/chart_renderer.py
  • plugins/ledmatrix-stocks/display_renderer.py
  • plugins/ledmatrix-stocks/manifest.json
  • plugins/odds-ticker/manager.py
  • plugins/odds-ticker/manifest.json
  • plugins/odds-ticker/odds_renderer.py
  • plugins/stock-news/manager.py
  • plugins/stock-news/manifest.json

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

Metric Results
Complexity 5

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 eddae83 into main Aug 5, 2026
4 checks passed
@ChuckBuilds
ChuckBuilds deleted the claude/nfl-leaderboard-display-q1kul0-tickers branch August 5, 2026 23:14
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