fix(masters): paginate course overview across all 18 holes#87
fix(masters): paginate course overview across all 18 holes#87ChuckBuilds merged 3 commits intomainfrom
Conversation
render_course_overview only split holes into 2 pages (front/back nine) and broke early when holes didn't fit on screen, silently dropping holes 4-9 and 13-18. Now calculates how many holes fit and paginates across all 18 holes, matching the pattern used by render_past_champions and render_leaderboard. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughUpdated rendering logic: Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
- Compact layout logo increased from 48x20 max to 56x28 max, and positioned to use available space better - Large layout logo reduced from 55% to 45% width to give more room for the countdown text - Countdown now shows "8d 14h" instead of just "8" when days > 0, and "HOURS TO GO" instead of "HOURS" for sub-day countdowns - Text positioned dynamically below logo instead of at fixed mid_y Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
plugins/masters-tournament/masters_renderer.py (2)
1-15:⚠️ Potential issue | 🟡 MinorBump PATCH version in manifest.json and init.py.
The commit "fix(masters): enlarge countdown logo and show days + hours" is a bug fix and requires a PATCH version bump per coding guidelines. Update version from 2.0.0 to 2.0.1 in
plugins/masters-tournament/manifest.jsonandplugins/masters-tournament/__init__.py.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@plugins/masters-tournament/masters_renderer.py` around lines 1 - 15, Update the package PATCH version from 2.0.0 to 2.0.1 in both plugin manifest and module init: open plugins/masters-tournament/manifest.json and change the "version" field value to "2.0.1", then open plugins/masters-tournament/__init__.py and update the __version__ (or VERSION) constant from "2.0.0" to "2.0.1" so both sources match the new patch release.
854-874:⚠️ Potential issue | 🟡 MinorDuplicate text rendering in large display layout when countdown is in days or hours mode.
When
days > 0orhours > 0, the same text appears at both the top and bottom of the countdown block:
- Line 866 renders
until_text(which equalsunit_text) at the top- Lines 872-875 render
unit_textagain at the bottomFor example, when 5 days remain, "UNTIL THE MASTERS" displays above and below the "5d 14h" countdown. This redundancy wastes display space and creates visual clutter on the limited large display (128x64).
The suggested fix is reasonable: only display the bottom unit label when
days <= 0(hours mode), avoiding duplication in the more common days-countdown scenario where the full label already appears at the top.Suggested fix
count_y = block_y + detail_h + 2 self._text_shadow(draw, (right_cx - cw // 2, count_y), count_text, self.font_score, COLORS["masters_yellow"]) - if unit_text: + if unit_text and days <= 0: uw = self._text_width(draw, unit_text, self.font_detail) draw.text((right_cx - uw // 2, count_y + count_h + 2), unit_text, fill=COLORS["light_gray"], font=self.font_detail)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@plugins/masters-tournament/masters_renderer.py` around lines 854 - 874, The top label (until_text) is being drawn and then unit_text is drawn again below when days>0/hours>0 causing duplicate labels; update the rendering logic in the large layout block (the code around until_text, unit_text, draw.text, and the bottom draw of unit_text) so that the bottom label is only drawn when days <= 0 (i.e., hours-mode), leaving the existing top draw (and its "TO MASTERS" fallback) unchanged; conditionally wrap the bottom draw of unit_text (the draw.text call at count_y + count_h + 2) with a check on days so it is skipped for days>0.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@plugins/masters-tournament/masters_renderer.py`:
- Around line 1-15: Update the package PATCH version from 2.0.0 to 2.0.1 in both
plugin manifest and module init: open plugins/masters-tournament/manifest.json
and change the "version" field value to "2.0.1", then open
plugins/masters-tournament/__init__.py and update the __version__ (or VERSION)
constant from "2.0.0" to "2.0.1" so both sources match the new patch release.
- Around line 854-874: The top label (until_text) is being drawn and then
unit_text is drawn again below when days>0/hours>0 causing duplicate labels;
update the rendering logic in the large layout block (the code around
until_text, unit_text, draw.text, and the bottom draw of unit_text) so that the
bottom label is only drawn when days <= 0 (i.e., hours-mode), leaving the
existing top draw (and its "TO MASTERS" fallback) unchanged; conditionally wrap
the bottom draw of unit_text (the draw.text call at count_y + count_h + 2) with
a check on days so it is skipped for days>0.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 811eaa80-0c2d-451d-b061-ea35e2f3ff14
📒 Files selected for processing (2)
plugins/masters-tournament/masters_renderer.pyplugins/masters-tournament/masters_renderer_enhanced.py
Show the big countdown number first (8d 14h), with "UNTIL THE MASTERS" underneath in gray — cleaner than repeating the label above and below. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
plugins/masters-tournament/masters_renderer.py (1)
889-903: Minor vertical centering improvement for the "NOW" case.When
unit_textis empty (the"NOW"state),text_block_hstill includes2 + detail_hfor the label, causing"NOW"to render slightly above vertical center on non-tiny compact displays. Consider conditionally omitting the label height:♻️ Optional: tighten vertical centering when label is empty
label = unit_text - text_block_h = count_h + 2 + detail_h + text_block_h = count_h + (2 + detail_h if label else 0) text_y = logo_bottom + max(0, (remaining - text_block_h) // 2) cw = self._text_width(draw, count_text, self.font_score) self._text_shadow(draw, ((self.width - cw) // 2, text_y), count_text, self.font_score, COLORS["masters_yellow"]) - lw = self._text_width(draw, label, self.font_detail) - draw.text(((self.width - lw) // 2, text_y + count_h + 2), - label, fill=COLORS["light_gray"], font=self.font_detail) + if label: + lw = self._text_width(draw, label, self.font_detail) + draw.text(((self.width - lw) // 2, text_y + count_h + 2), + label, fill=COLORS["light_gray"], font=self.font_detail)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@plugins/masters-tournament/masters_renderer.py` around lines 889 - 903, The vertical centering is off when unit_text is empty because text_block_h always adds the label height (2 + detail_h); update the logic in the block that computes text_block_h and draws the label (references: self.tier, unit_text, label, text_block_h, detail_h, text_y, draw.text, self._text_width, self.font_detail) so that when unit_text == "" (the "NOW" case) you omit the extra 2 + detail_h from text_block_h and skip drawing the label (or draw nothing), then recompute lw only when drawing the label; this ensures count_text is vertically centered correctly on non-tiny compact displays.
🤖 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/masters_renderer.py`:
- Around line 889-903: The vertical centering is off when unit_text is empty
because text_block_h always adds the label height (2 + detail_h); update the
logic in the block that computes text_block_h and draws the label (references:
self.tier, unit_text, label, text_block_h, detail_h, text_y, draw.text,
self._text_width, self.font_detail) so that when unit_text == "" (the "NOW"
case) you omit the extra 2 + detail_h from text_block_h and skip drawing the
label (or draw nothing), then recompute lw only when drawing the label; this
ensures count_text is vertically centered correctly on non-tiny compact
displays.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 66a2ecb1-437c-4f6d-ae57-265bb03c10c6
📒 Files selected for processing (1)
plugins/masters-tournament/masters_renderer.py
Summary
max_holesfrom available display height and paginates all 18 holes, matching the pattern used byrender_past_championsandrender_leaderboardOther paginated modes (leaderboard, past_champions, tournament_stats, schedule) were verified to already use the correct
total_pages+ slice pattern and are unaffected.Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit