Skip to content

feat(templates): add home_feed preset — morning briefing - #159

Merged
unhappychoice merged 3 commits into
mainfrom
feat/home-feed-preset
Apr 26, 2026
Merged

unhappychoice merged 3 commits into
mainfrom
feat/home-feed-preset

Conversation

@unhappychoice

@unhappychoice unhappychoice commented Apr 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds home_feed to the home preset gallery — fills the "outside content / 朝刊" axis (sibling of feat: ship dashboard presets (home_splash / home_daily / home_github / project_github_activity) #77's home_splash / home_daily / home_github and feat(templates): add a second project-side preset (self/project axis) #96's home_minimal).
  • Hero band on bg = "subtle": figlet date masthead, good morning greeting, live Day · HH:MM, and an almanac strip (moon · zodiac · day-of-year).
  • Body: 2 cols × 3 rows of curated feeds — HN | r/programming, Wired | BBC Tech, Engadget | Wikipedia on this day.
  • Footer: a daily random_fortune flourish on height = "auto" so 1-line cookies hug the closing line and multi-line ones get the room they need.
  • Wires the new template into TEMPLATES, the xtask snapshot list, the docs-site presets / getting-started / showcases pages.
  • Includes a renderer fix: text_plain.natural_height now counts TextBlock lines (and \n-separated Text lines) instead of falling through to the trait default of 1. Without this, the fortune footer's height = "auto" collapsed to a single row and clipped multi-line cookies.

Trust

rss and reddit_subreddit_posts are Network-class. Installed to \$HOME/.splashboard/home.dashboard.toml (global config) the preset is implicitly trusted; dropped into a per-directory .splashboard/dashboard.toml it needs splashboard trust before the network panels render.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test (856 + 12 pass — includes the four templates::tests for the new template plus three new text_plain::natural_height_* cases)
  • cargo xtask regenerated docs-site/src/assets/rendered/home_feed.html
  • Live smoke-tested via ./.splashboard/dashboard.toml after splashboard trust

Related

🤖 Generated with Claude Code

Fills the "outside content / 朝刊" axis of the home gallery. Hero band
(`bg = "subtle"`) carries a figlet date masthead, "good morning" greeting,
live `Day · HH:MM`, and an almanac strip (moon · zodiac · day-of-year).
Body is 2 cols × 3 rows of curated feeds — HN | r/programming, Wired |
BBC Tech, Engadget | Wikipedia on this day. Footer closes with a daily
fortune.

Network-class widgets (rss, reddit_subreddit_posts) are implicitly trusted
when installed to the global home dashboard; per-directory configs need
`splashboard trust` first.

Closes #150.

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

coderabbitai Bot commented Apr 26, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR introduces a new home_feed dashboard preset template that presents a morning briefing layout with multiple feed sources including Hacker News, Reddit, and RSS. The template is registered in the codebase, documented in the guides and showcases, and configured for HTML snapshot rendering.

Changes

Cohort / File(s) Summary
Documentation Updates
docs-site/src/content/docs/guides/getting-started.md, docs-site/src/content/docs/guides/presets.mdx, docs-site/src/content/docs/showcases.md
Added home_feed to template lists and preset gallery; updated total preset count to eight; changed home_minimal quote widget from quote_of_day to random_quote.
Template Implementation
src/templates/home_feed.toml
New 280-line TOML template defining a morning briefing dashboard with hero time-of-day greeting, date subtitle, three-row body with curated feeds (Hacker News, RSS, Reddit, BBC, Wired, Engadget, Wikipedia), and fortune footer widget.
Template Registration
src/templates/mod.rs, xtask/src/main.rs
Registered home_feed template in the TEMPLATES array with TemplateContext::Home and added to DASHBOARD_SNAPSHOTS for HTML rendering.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #104: Adds new dashboard presets and modifies the same TEMPLATES registry, xtask snapshot rendering, and documentation paths.
  • #98: Touches the templates catalog and directly registers templates in src/templates/mod.rs consumed by downstream systems.
  • #94: Modifies the templates and documentation pipeline alongside snapshot rendering configuration in xtask.

Poem

🐰 A new feed for dawn's first peek,
With morning briefs—the week's mystique,
News and hacks in columns neat,
Coffee warms, the terminal's sweet.
Hop-hop! The briefing starts today! 📰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(templates): add home_feed preset — morning briefing' directly and clearly summarizes the main change: adding a new home_feed template preset with a morning briefing design.
Linked Issues check ✅ Passed All Definition of Done items from #150 are met: home_feed.toml created with required widgets, registered in TEMPLATES, documented on presets/getting-started/showcases pages, xtask snapshot configured, and template composition matches the specified design vocabulary.
Out of Scope Changes check ✅ Passed All changes are scoped to #150 objectives: template file, registration, documentation updates, and xtask snapshot configuration. No unrelated changes present; renderer improvements explicitly deferred.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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 feat/home-feed-preset

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 97.67442% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.78%. Comparing base (ebeca02) to head (0ac7f5a).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/render/text_plain.rs 97.67% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #159      +/-   ##
==========================================
+ Coverage   78.57%   78.78%   +0.20%     
==========================================
  Files         122      122              
  Lines       22706    22749      +43     
==========================================
+ Hits        17842    17922      +80     
+ Misses       4864     4827      -37     
Files with missing lines Coverage Δ
src/templates/mod.rs 97.84% <ø> (ø)
src/render/text_plain.rs 92.30% <97.67%> (+3.78%) ⬆️

... and 6 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.

@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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs-site/src/content/docs/guides/presets.mdx`:
- Line 100: The docs change replacing quote_of_day with random_quote and the
minor home_minimal quote tweak is fine but unrelated to the PR scope; update the
PR description to include a one-line note summarizing the doc change (mentioning
the key name random_quote and the home_minimal quote fix) and confirm it matches
the implementation in src/fetcher/random_quote/mod.rs (so reviewers can trace
the mapping); this ensures the reviewers know the change was intentional and
documented.

In `@src/templates/home_feed.toml`:
- Around line 21-26: The comment above the fortune widget is stale: it claims
the row uses length = "auto" when the actual widget "fortune" (fetcher
"random_fortune") is hard-coded to height = { length = 3 } and the renderer's
natural_height = 1 would cause auto to truncate; update the explanatory comment
to reflect that the fortune row is fixed-height (length = 3), note the renderer
natural_height behavior that prevents safe auto-sizing, and remove or reword the
misleading "auto" wording so the comment matches the actual configuration and
behavior.
- Around line 6-9: The fetcher reddit_subreddit_posts is incorrectly classified
as Safety::Safe; update its safety classification in
src/fetcher/reddit/subreddit_posts.rs so it returns Safety::Network instead of
Safety::Safe (look for the safety() / impl or constant that sets Safety for
reddit_subreddit_posts and change the enum value), since it accepts a
configurable subreddit option and thus is a Network-class fetcher.
🪄 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

Run ID: af32f93a-0be7-4671-b56d-7d276447a30b

📥 Commits

Reviewing files that changed from the base of the PR and between ebeca02 and 536425c.

📒 Files selected for processing (6)
  • docs-site/src/content/docs/guides/getting-started.md
  • docs-site/src/content/docs/guides/presets.mdx
  • docs-site/src/content/docs/showcases.md
  • src/templates/home_feed.toml
  • src/templates/mod.rs
  • xtask/src/main.rs

Comment thread src/templates/home_feed.toml Resolved
Comment thread src/templates/home_feed.toml Resolved
unhappychoice and others added 2 commits April 26, 2026 20:34
text_plain's `natural_height` previously fell through to the default `1`,
so `length = "auto"` rows hosting multi-line `TextBlock` (or `Text` with
embedded newlines) collapsed to a single row and clipped the trailing
content. Override to count lines per body — `Text` splits on `\n`,
`TextBlock` uses `lines.len()` — with a 1-row floor so empty bodies still
get drawn. text_plain doesn't wrap, so the count is independent of
`max_width`.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Now that text_plain's natural_height honours the TextBlock line count, the
footer can size to the cookie instead of reserving a fixed 3 rows that
leave whitespace under 1-line cookies.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@unhappychoice
unhappychoice merged commit 673a223 into main Apr 26, 2026
7 checks passed
@unhappychoice
unhappychoice deleted the feat/home-feed-preset branch April 26, 2026 11:39
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.

feat(templates): add home_feed preset — morning briefing (HN / today / read-more)

1 participant