Modified to work with Military.com updated RSS feed - #594
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughChangesMilitary news filtering and rendering
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant get_military_news
participant RSS
participant main
get_military_news->>RSS: HTTP GET with RSS headers and cache TTL
RSS-->>get_military_news: Feed response or None
main->>main: Match item text using BRANCH_FILTERS
main->>main: Select three headlines
main-->>main: Render selected titles with branch palette
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
apps/militarynews/military_news.star (2)
228-247: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueExtract the random-pick loop.
The same six-line "pick N at random without replacement" block appears three times. A small helper (
pick_random(pool, count)) collapses all three call sites and keeps the selection rules readable.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/militarynews/military_news.star` around lines 228 - 247, Extract the repeated random-without-replacement selection logic into a pick_random(pool, count) helper. Update all three existing random-pick call sites to use it, preserving the current count limits, empty-pool behavior, ordering, and non-mutating handling of the source pools.
257-284: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftConsider adding 2x rendering support to the rewritten render block.
Width is hardcoded to 64 and the font is
"5x8", so this renders at 1x only. Usecanvas.width()withSCALE = 2 if canvas.is2x() else 1,tb-8for 1x /terminus-16for 2x, and halve thedelaywhencanvas.is2x()so scroll speed is preserved.show_instructions_screenneeds the same treatment for consistency.As per coding guidelines: "Support 2x rendering by using
canvas.size(),canvas.width(),canvas.height(), andcanvas.is2x()as appropriate", "Usetb-8as the default 1x font andterminus-16as the default 2x font", and "Forrender.Marqueeanimations, halve the delay for 2x rendering to maintain scroll speed".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/militarynews/military_news.star` around lines 257 - 284, Update the rewritten render block and show_instructions_screen to support 2x rendering: derive SCALE from canvas.is2x(), use canvas.width() for marquee widths, select tb-8 at 1x and terminus-16 at 2x, and halve the marquee delay when 2x is active while preserving existing offsets scaled appropriately.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/militarynews/military_news.star`:
- Around line 220-227: Update the selected_branch == "military" branch to build
its randomized pool from the matched items collection rather than
nonmatching_items, so up to three military headlines are selected while
preserving the existing empty-pool handling and selection logic.
- Around line 71-114: Remove the unused BRANCH_FILTERS duplication by folding
any necessary inline-only keywords, including CDATA variants, into
BRANCH_FILTERS. Replace the per-branch elif ladder in the matching logic with a
lookup that iterates the dictionary and selects the matching branch, preserving
the existing classification behavior without separate hardcoded keyword lists.
---
Nitpick comments:
In `@apps/militarynews/military_news.star`:
- Around line 228-247: Extract the repeated random-without-replacement selection
logic into a pick_random(pool, count) helper. Update all three existing
random-pick call sites to use it, preserving the current count limits,
empty-pool behavior, ordering, and non-mutating handling of the source pools.
- Around line 257-284: Update the rewritten render block and
show_instructions_screen to support 2x rendering: derive SCALE from
canvas.is2x(), use canvas.width() for marquee widths, select tb-8 at 1x and
terminus-16 at 2x, and halve the marquee delay when 2x is active while
preserving existing offsets scaled appropriately.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ba37c764-b24a-4b7a-ae08-045793635d8f
📒 Files selected for processing (2)
apps/militarynews/manifest.yamlapps/militarynews/military_news.star
Also updated colors to be more readable.
Summary by CodeRabbit
New Features
Bug Fixes
Chores