Skip to content

feat(fetcher): add rss feed reader - #153

Merged
unhappychoice merged 3 commits into
mainfrom
feat/rss-fetcher
Apr 26, 2026
Merged

unhappychoice merged 3 commits into
mainfrom
feat/rss-fetcher

Conversation

@unhappychoice

Copy link
Copy Markdown
Owner

Summary

Implements rss fetcher (RSS 2.0 / RSS 1.0 / Atom / JSON Feed via feed-rs) — the canonical read more main slot candidate from #150 (home_feed morning briefing preset). First built-in Network-class fetcher, so this PR also fixes a latent UX issue surfaced by it: trust / error / timeout / unknown-fetcher placeholders all emitted Body::TextBlock, which list_links (and any other shape-strict renderer) rejected — users saw renderer list_links cannot display TextBlock instead of 🔒 requires trust. Both fixes ship together because rss + list_links is the canonical pairing #150 specifies.

Refs #67 (Social & Media — RSS / news), #150 (home_feed preset).

Commits

  • fix(runtime): make trust/error placeholders shape-aware — adds fetcher::placeholder_body(shape, lines) helper; routes every placeholder constructor through it using each widget's renderer-derived shape.
  • feat(fetcher): add rss feed reader — new src/fetcher/rss.rs, registered in Registry::with_builtins. feed-rs = "2" added to Cargo.toml.

Reference page (preview)

Fetcher rss

  • Kind: cached
  • Safety: Network (local configs must be splashboard trust-ed before fetching)
  • Shapes: linked_text_block (default), text_block

Options

name type required default description
url string (http / https) required – Feed URL — RSS 2.0, RSS 1.0, Atom, or JSON Feed.
count integer (1..=20) optional 5 Number of feed entries to display.

Hardening

  • URL scheme allowlist: http / https only (rejects file://, data:, etc.)
  • Response body capped at 5 MB to bound exposure to a runaway feed.
  • Cache key incorporates the URL hash so multiple rss widgets pointing at different feeds don't collide.

Compatible renderers — list_links (LinkedTextBlock), plus the standard text_block family (text_plain, list_plain, animated_*).

Test plan

  • cargo test — 726 passed (18 new for rss + 2 for placeholder shape adaptation).
  • cargo clippy --all-targets -- -D warnings clean.
  • cargo fmt --all -- --check clean.
  • cargo run --bin splashboard -- catalog fetcher rss prints schema + compatible renderers.
  • Local smoke test: 3-widget dashboard (list_links default + count override + text_block fallback) renders feed entries correctly under SPLASHBOARD_TRUST_ALL=1.
  • Without trust: all three widgets show 🔒 requires trust (previously two of them showed cannot display TextBlock).
  • #[ignore]'d live test against https://blog.rust-lang.org/feed.xml runs green (cargo test -- --ignored fetcher::rss::tests::live).

Out of scope

🤖 Generated with Claude Code

unhappychoice and others added 2 commits April 26, 2026 16:37
Trust gate, fetch error, timeout, unknown-fetcher, and shape-mismatch
placeholders all emitted `Body::TextBlock`, causing renderers that only
accept other shapes (notably `list_links` → `LinkedTextBlock`) to surface
"renderer X cannot display TextBlock" instead of the actual reason. Add
`fetcher::placeholder_body(shape, lines)` and route every placeholder
through it using each widget's renderer-derived shape.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Supports `LinkedTextBlock` (default — clickable rows for `list_links`)
and `TextBlock` shapes. Options: `url` (required, http/https only) and
`count` (1..=20, default 5). Network safety class — local configs must
be `splashboard trust`-ed before fetching. Caps response body at 5MB.
Refs #150.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 26, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@unhappychoice has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 19 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 9 minutes and 19 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5e62cd9e-7b90-4082-97e2-11aef8223dc5

📥 Commits

Reviewing files that changed from the base of the PR and between c4e8ee2 and cf33ee8.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • Cargo.toml
  • src/fetcher/mod.rs
  • src/fetcher/rss.rs
  • src/runtime.rs
  • src/trust.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/rss-fetcher

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.

@codecov

codecov Bot commented Apr 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.89691% with 78 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.16%. Comparing base (4a0d9f8) to head (cf33ee8).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/fetcher/rss.rs 79.79% 60 Missing ⚠️
src/fetcher/mod.rs 82.53% 11 Missing ⚠️
src/runtime.rs 53.84% 6 Missing ⚠️
src/trust.rs 93.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #153      +/-   ##
==========================================
- Coverage   78.29%   78.16%   -0.13%     
==========================================
  Files         107      113       +6     
  Lines       20429    21378     +949     
==========================================
+ Hits        15995    16711     +716     
- Misses       4434     4667     +233     
Files with missing lines Coverage Δ
src/trust.rs 83.21% <93.33%> (+0.18%) ⬆️
src/runtime.rs 80.64% <53.84%> (-0.13%) ⬇️
src/fetcher/mod.rs 83.97% <82.53%> (+0.64%) ⬆️
src/fetcher/rss.rs 79.79% <79.79%> (ø)

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Atom entries can carry both `rel="self"` (entry-as-resource permalink in
the feed) and `rel="alternate"` (the article body URL). Picking the
first non-empty href grabbed `rel="self"` on common Atom shapes, so
`list_links` rendered links that bounced back into the feed instead of
the article. Per RFC 4287 the article URL is `rel="alternate"` (which
is also the default when `rel` is absent — matching RSS 2.0's single-
link case). Falls back to the first non-empty link if no alternate is
declared.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@unhappychoice
unhappychoice merged commit 0d5ebb2 into main Apr 26, 2026
7 checks passed
@unhappychoice
unhappychoice deleted the feat/rss-fetcher branch April 26, 2026 07:59
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