Repository navigation
feat(templates): add home_feed preset — morning briefing - #159
Conversation
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]>
📝 WalkthroughWalkthroughThis PR introduces a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
📒 Files selected for processing (6)
docs-site/src/content/docs/guides/getting-started.mddocs-site/src/content/docs/guides/presets.mdxdocs-site/src/content/docs/showcases.mdsrc/templates/home_feed.tomlsrc/templates/mod.rsxtask/src/main.rs
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]>
Summary
home_feedto 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).bg = "subtle": figlet date masthead,good morninggreeting, liveDay · HH:MM, and an almanac strip (moon · zodiac · day-of-year).random_fortuneflourish onheight = "auto"so 1-line cookies hug the closing line and multi-line ones get the room they need.TEMPLATES, the xtask snapshot list, the docs-site presets / getting-started / showcases pages.text_plain.natural_heightnow counts TextBlock lines (and\n-separated Text lines) instead of falling through to the trait default of1. Without this, the fortune footer'sheight = "auto"collapsed to a single row and clipped multi-line cookies.Trust
rssandreddit_subreddit_postsare Network-class. Installed to\$HOME/.splashboard/home.dashboard.toml(global config) the preset is implicitly trusted; dropped into a per-directory.splashboard/dashboard.tomlit needssplashboard trustbefore the network panels render.Test plan
templates::testsfor the new template plus three newtext_plain::natural_height_*cases)docs-site/src/assets/rendered/home_feed.html./.splashboard/dashboard.tomlaftersplashboard trustRelated
🤖 Generated with Claude Code