Skip to content

Modified to work with Military.com updated RSS feed - #594

Merged
rjison merged 4 commits into
tronbyt:mainfrom
rjison:MilitaryNewsUpdate
Jul 28, 2026
Merged

Modified to work with Military.com updated RSS feed#594
rjison merged 4 commits into
tronbyt:mainfrom
rjison:MilitaryNewsUpdate

Conversation

@rjison

@rjison rjison commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Also updated colors to be more readable.

Summary by CodeRabbit

  • New Features

    • Refined Military News headline selection using a single daily RSS feed with branch-specific keyword filtering.
    • Updated branch headline color palettes, including randomized coloring for the “All Branches” view.
    • Preserves the three scrolling headlines experience with configurable scroll timing.
  • Bug Fixes

    • Improved behavior when the RSS content is missing or contains no items, ensuring no stale/empty rendering.
    • Improved news retrieval headers and caching TTL handling for more consistent daily refreshes.
  • Chores

    • Refreshed the app manifest update timestamp.

@rjison
rjison requested a review from tavdog as a code owner July 28, 2026 18:23
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 63762d97-ccd7-4209-9d33-7ede2f0ccbad

📥 Commits

Reviewing files that changed from the base of the PR and between 1525c9b and 91444e5.

📒 Files selected for processing (2)
  • apps/militarynews/manifest.yaml
  • apps/militarynews/military_news.star
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/militarynews/manifest.yaml
  • apps/militarynews/military_news.star

📝 Walkthrough

Walkthrough

Changes

Military news filtering and rendering

Layer / File(s) Summary
Branch palettes and filters
apps/militarynews/manifest.yaml, apps/militarynews/military_news.star
Updates the manifest timestamp, defines six branch palettes and keyword filters, and removes the unused math import.
RSS retrieval and headline selection
apps/militarynews/military_news.star
Fetches one cached RSS feed with updated headers, handles missing or empty XML, filters items by branch, selects three headlines, and renders them using the selected palette and scroll configuration.

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
Loading

Suggested reviewers: tavdog

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: adapting the app to Military.com’s updated RSS feed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
apps/militarynews/military_news.star (2)

228-247: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Extract 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 lift

Consider 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. Use canvas.width() with SCALE = 2 if canvas.is2x() else 1, tb-8 for 1x / terminus-16 for 2x, and halve the delay when canvas.is2x() so scroll speed is preserved. show_instructions_screen needs the same treatment for consistency.

As per coding guidelines: "Support 2x rendering by using canvas.size(), canvas.width(), canvas.height(), and canvas.is2x() as appropriate", "Use tb-8 as the default 1x font and terminus-16 as the default 2x font", and "For render.Marquee animations, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4145d1e and 1525c9b.

📒 Files selected for processing (2)
  • apps/militarynews/manifest.yaml
  • apps/militarynews/military_news.star

Comment thread apps/militarynews/military_news.star
Comment thread apps/militarynews/military_news.star
@rjison
rjison merged commit d2ab4d4 into tronbyt:main Jul 28, 2026
1 check passed
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