Skip to content

flight-tracker: scale layouts across display sizes (1.4.0)#102

Open
ChuckBuilds wants to merge 5 commits intomainfrom
fix/flight-tracker-scaling
Open

flight-tracker: scale layouts across display sizes (1.4.0)#102
ChuckBuilds wants to merge 5 commits intomainfrom
fix/flight-tracker-scaling

Conversation

@ChuckBuilds
Copy link
Copy Markdown
Owner

@ChuckBuilds ChuckBuilds commented Apr 14, 2026

Summary

  • Fixes text-row overlap on 32px-tall panels across all flight detail/area/stats layouts.
  • Adds adaptive row dropping via a priority-ordered _row_plan() helper — rows that don't fit on short displays are dropped lowest-priority first rather than overlapping.
  • Makes the font tier selection width-aware: the 16pt font_large tier now requires both height>=64 and width>=192, so 128×64 wide-mode no longer picks a font too large for its info zone.
  • Truncates the route string (e.g. JFK-LAX) to the info-zone width; previously only airline name and aircraft type were truncated, so the route could overrun into the metrics zone.
  • Adds optional fonts.large_size / fonts.medium_size / fonts.small_size config overrides (0 = auto).
  • Bumps ledmatrix-flights to 1.4.0.

Note: this branch was split off from fix/masters-wrap-text-and-manifest, so the diff includes two earlier masters-tournament commits (17333f0, 9ad0c67) that are already in that branch/PR.

Test plan

  • Sideload on a 64×32 panel, confirm area/stats/condensed layouts show 2–3 rows without overlap
  • Sideload on a 128×32 panel, confirm route truncation and no cross-zone overrun
  • Sideload on a 128×64 panel in condensed mode (default auto-pick) to confirm no regression
  • Try setting fonts.medium_size = 8 in config and verify the override applies

Summary by CodeRabbit

  • New Features

    • ledmatrix-flights: Added configurable font size controls and adaptive layout scaling for optimal text display across various LED matrix heights.
    • masters-tournament: Added live birdie and eagle alert detection with prioritized display of score improvements during tournaments.
  • Bug Fixes

    • Fixed text wrapping behavior for oversized words in tournament displays.
  • Chores

    • Updated plugin versions and metadata.

Chuck and others added 5 commits April 10, 2026 15:48
…sized words, sync manifest date

- In _wrap_text, flush any accumulated current_line before starting
  character-level breaking of an oversized word, preventing previous
  text from being glued to the broken characters
- Update last_updated in manifest.json to 2026-04-10 to match the
  2.3.0 release date

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Track player scores between leaderboard updates and detect score
improvements. When a player makes birdie or better, queue a live alert
that renders with the appropriate styling (gold header for eagles,
green for birdies) via the existing render_live_alert renderer.

Alerts rotate on a configurable dwell timer (live_action.duration),
then fall back to showing the current leader.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adaptive row-dropping based on available display height so flight
detail, area, and stats layouts no longer overlap on 32px-tall
panels. Adds optional fonts.large_size/medium_size/small_size config
overrides and makes the h<48 font tier visually distinct.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previous commit updated the versions[] entry but missed the top-level
"version" field, so the registry stayed on 1.3.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
At narrow displays the large font tier (16pt) was selected based on
height alone, so 128x64 panels in wide mode picked a font too big for
their 64px info zone. Now the 16pt tier requires width>=192. Also
truncate the route string to the info zone width - previously only
the airline name and aircraft type were truncated, so 'JFK-LAX' at
10pt overran into the metrics zone on 128-wide panels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

📝 Walkthrough

Walkthrough

This PR releases version 1.4.0 of the ledmatrix-flights plugin with adaptive layout rendering and configurable font sizes, and enhances the masters-tournament plugin with live birdie/eagle alert detection. Updates include new font configuration schema, refactored row-priority rendering logic, alert queueing for score improvements, and a text wrapping fix for oversized words.

Changes

Cohort / File(s) Summary
ledmatrix-flights adaptive layout
plugins/ledmatrix-flights/config_schema.json, plugins/ledmatrix-flights/renderer.py
Added optional fonts config object with large_size, medium_size, small_size overrides (0–32). Refactored renderer to use widescreen width checks, introduced _row_plan for priority-based row dropping, and changed rendering methods to adaptively include/exclude rows based on available vertical space instead of fixed row counts.
ledmatrix-flights version release
plugins/ledmatrix-flights/manifest.json, plugins.json
Bumped ledmatrix-flights version from 1.3.0 to 1.4.0 with release notes documenting layout scaling and font overrides. Updated last_updated timestamps to 2026-04-14.
masters-tournament live alerts
plugins/masters-tournament/manager.py
Added score change detection tracking (_previous_scores) and alert queue rotation. Live-action display mode now prioritizes birdie/eagle alerts from _alert_queue with configurable dwell timer, falling back to leader status if no alerts exist.
masters-tournament text rendering
plugins/masters-tournament/masters_renderer.py
Fixed _wrap_text to prevent character chunking from continuing onto a partially built line by appending non-empty current line before per-character chunk loop.
masters-tournament metadata
plugins/masters-tournament/manifest.json
Updated last_updated timestamp from 2026-04-09 to 2026-04-10.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

  • #59: Introduces foundational FlightWall renderer that this PR builds upon with font-size overrides and adaptive row-dropping enhancements.
  • #75: Modifies ledmatrix-flights renderer and config schema for font selection and adaptive layout logic in the same code areas.
  • #94: Updates masters-tournament/manager.py control flow and live-display behavior for tournament metadata and phase logic alongside this PR's alert detection changes.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: the ledmatrix-flights plugin scaling layouts across display sizes and bumping to version 1.4.0, which aligns with the primary objective of fixing text-row overlap through adaptive row dropping and width-aware font selection.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/flight-tracker-scaling
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix/flight-tracker-scaling

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
plugins/masters-tournament/manager.py (1)

383-388: Minor: hole_par is fetched but not used by get_score_description.

Looking at get_score_description in masters_helpers.py, it only examines score_to_par and ignores the hole_par parameter. The current approach works correctly for single-hole score changes, but if multiple holes are played between API updates (e.g., -2 from two birdies), it would incorrectly classify as "Eagle".

This edge case is unlikely with frequent updates, but consider adding a guard to only generate alerts when abs(change) <= 3 to avoid false classifications from multi-hole gaps.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/masters-tournament/manager.py` around lines 383 - 388, The code
computes hole_par but get_score_description ignores it, so add a guard in
manager.py around the alert logic to only generate alerts for single/multi-hole
safe changes by checking abs(change) <= 3 (e.g., before calling
get_score_description or before the "Only alert" if-block); keep the existing
variables (change, hole_par, AUGUSTA_HOLES) and simply skip alerting when
abs(change) > 3 to avoid misclassifying multi-hole gaps.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@plugins/masters-tournament/manager.py`:
- Around line 383-388: The code computes hole_par but get_score_description
ignores it, so add a guard in manager.py around the alert logic to only generate
alerts for single/multi-hole safe changes by checking abs(change) <= 3 (e.g.,
before calling get_score_description or before the "Only alert" if-block); keep
the existing variables (change, hole_par, AUGUSTA_HOLES) and simply skip
alerting when abs(change) > 3 to avoid misclassifying multi-hole gaps.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 91b74cc4-566f-4559-a4af-4fe8e97e5b08

📥 Commits

Reviewing files that changed from the base of the PR and between 12109c5 and a7a7e7f.

📒 Files selected for processing (7)
  • plugins.json
  • plugins/ledmatrix-flights/config_schema.json
  • plugins/ledmatrix-flights/manifest.json
  • plugins/ledmatrix-flights/renderer.py
  • plugins/masters-tournament/manager.py
  • plugins/masters-tournament/manifest.json
  • plugins/masters-tournament/masters_renderer.py

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