Skip to content

docs(presets): align preset guide with shipped templates - #94

Merged
unhappychoice merged 4 commits into
mainfrom
docs/presets-match-templates
Apr 24, 2026
Merged

unhappychoice merged 4 commits into
mainfrom
docs/presets-match-templates

Conversation

@unhappychoice

@unhappychoice unhappychoice commented Apr 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Drop the stale "preset fetchers are pending" note — all four templates now ship in src/templates/.
  • Rewrite home_splash / home_daily / home_github sections to match the widgets actually embedded: terminal figlet + greeting + clock, quote + day hero + calendar|almanac + world_clock|system + elapsed gauges, and avatar + basic_static handle + github_user profile respectively.
  • Sync the project_github_activity TOML listing with the shipped template (font ansi_shadow, padded titles, title_align = "center").
  • Swap the "Applying a preset" footer to point users at src/templates/<name>.toml as the copy source; keep the splashboard install --template note tied to feat: "splashboard install" — one-shot setup (rc wiring + starter config from template) #58.

Relates to #77 (preset work).

Test plan

  • npx astro build in docs-site/ — 74 pages built, /guides/presets/index.html rendered.
  • Visual check of the rendered page (dist/guides/presets/index.html) to confirm ASCII previews fit and the embedded project_github_activity.html render still sits correctly.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Documentation

    • Updated guides with clearer, more concise preset descriptions and widget compositions.
    • Added visual previews of Home and Project presets.
    • Removed outdated forward-looking notes and pending screenshot references.
    • Clarified trust and consent behavior descriptions.
  • Style

    • Improved landing page layout spacing for better visual consistency.

@coderabbitai

coderabbitai Bot commented Apr 23, 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 51 minutes and 47 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 51 minutes and 47 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: 8a7bf8ce-0ae8-49f5-8e36-a416a08ad5ef

📥 Commits

Reviewing files that changed from the base of the PR and between 4422a6f and 6cb5c83.

📒 Files selected for processing (19)
  • docs-site/astro.config.mjs
  • docs-site/src/content/docs/guides/concepts.md
  • docs-site/src/content/docs/guides/concepts/fetcher.md
  • docs-site/src/content/docs/guides/concepts/index.md
  • docs-site/src/content/docs/guides/concepts/renderer.md
  • docs-site/src/content/docs/guides/concepts/shape.md
  • docs-site/src/content/docs/guides/concepts/widget.md
  • docs-site/src/content/docs/guides/configuration.md
  • docs-site/src/content/docs/guides/cookbook.md
  • docs-site/src/content/docs/guides/getting-started.md
  • docs-site/src/content/docs/guides/presets.mdx
  • docs-site/src/content/docs/guides/read-store.md
  • docs-site/src/content/docs/guides/themes.md
  • docs-site/src/content/docs/guides/trust.md
  • docs-site/src/content/docs/index.mdx
  • docs-site/src/content/docs/showcases.md
  • docs-site/src/styles/snapshot.css
  • xtask/src/dashboard_snapshot.rs
  • xtask/src/main.rs
📝 Walkthrough

Walkthrough

This PR updates documentation by removing outdated notes about future features, redesigns preset guidance with embedded template previews and updated widget composition, and refactors snapshot rendering in xtask to support multiple preset templates with realtime fetcher handling and environment variable scrubbing.

Changes

Cohort / File(s) Summary
Documentation Cleanup
docs-site/src/content/docs/guides/getting-started.md, docs-site/src/content/docs/guides/themes.md, docs-site/src/content/docs/index.mdx, docs-site/src/content/docs/showcases.md
Removes forward-looking notes about prebuilt binaries, pending screenshots, and auto-generated reference pages; updates Presets section to remove issue reference.
Preset Documentation Redesign
docs-site/src/content/docs/guides/presets.mdx
Replaces 0.x narrative with shorter template-driven guidance; adds imports and embeds HTML previews of Home presets; rewrites widget composition tables for Home presets (greeting/clock/date/calendar/almanac/world-clock/system/time-elapsed); condenses Project preset section by removing large TOML blocks.
Trust Documentation Update
docs-site/src/content/docs/guides/trust.md
Removes 0.x-specific claims about consent prompts; clarifies that current fetchers are classified Safe and trust gate is active upon Network widget addition; revises Exec classification paragraph.
Splash Page Layout Styling
docs-site/src/styles/snapshot.css
Adds CSS spacing overrides for wide screens without sidebar to remove hero padding and set consistent .splash-landing margin-top and heading spacing.
Snapshot Generation Logic
xtask/src/dashboard_snapshot.rs
Introduces realtime fetcher detection: constructs FetchContext with widget id, format, timeout, and options; uses realtime.compute() for realtime fetchers; retains previous behavior for cached fetchers.
Dashboard Rendering Refactor
xtask/src/main.rs
Changes snapshot rendering from single configured preset to multiple templates (home_splash, home_daily, home_github, project_github_activity) with shared sizing constants; adds preprocessing step to scrub environment variables for deterministic output.

Sequence Diagram

sequenceDiagram
    actor Renderer
    participant SnapshotGen as Snapshot Generator
    participant Fetcher
    participant FetchContext
    participant Widget

    Renderer->>SnapshotGen: Render snapshot for preset
    SnapshotGen->>Fetcher: Check if realtime?
    
    alt Realtime Fetcher
        Fetcher-->>SnapshotGen: Yes, is_realtime
        SnapshotGen->>FetchContext: Construct context<br/>(widget_id, format, 50ms timeout, shape, options)
        FetchContext-->>SnapshotGen: Context created
        SnapshotGen->>Fetcher: compute(&context)
        Fetcher->>Widget: Generate Payload
        Widget-->>SnapshotGen: Payload result
    else Cached Fetcher
        Fetcher-->>SnapshotGen: No, not realtime
        SnapshotGen->>Fetcher: override_from_format(...)<br/>or sample_body(shape)
        Fetcher-->>SnapshotGen: Payload result
    end
    
    SnapshotGen-->>Renderer: Rendered output
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 Snapshots now snap with style and flair,
Presets rendered with utmost care,
Realtime fetchers dance their dance,
While stale docs fade at a glance,
Spacing aligned, the CSS sings—
What happy updates this PR brings! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(presets): align preset guide with shipped templates' directly summarizes the main change: updating documentation to match the actual shipped preset templates.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/presets-match-templates

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 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.80%. Comparing base (005c895) to head (6cb5c83).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #94      +/-   ##
==========================================
- Coverage   78.81%   78.80%   -0.02%     
==========================================
  Files          82       82              
  Lines       12902    12902              
==========================================
- Hits        10169    10167       -2     
- Misses       2733     2735       +2     

see 2 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: 1

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

Inline comments:
In `@xtask/src/main.rs`:
- Around line 83-96: scrub_host_env() currently removes KITTY_WINDOW_ID but not
TERM, so detect_terminal() can still detect Kitty via TERM == "xterm-kitty" and
leak terminal-specific behavior; update scrub_host_env() to also remove the
"TERM" environment variable (call std::env::remove_var("TERM") in the same
unsafe block or loop of keys) so detect_terminal() cannot observe TERM and
snapshots remain deterministic.
🪄 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: c1b60ada-1c39-44e3-b2da-be51b7f64453

📥 Commits

Reviewing files that changed from the base of the PR and between 3f313d6 and 4422a6f.

📒 Files selected for processing (9)
  • docs-site/src/content/docs/guides/getting-started.md
  • docs-site/src/content/docs/guides/presets.mdx
  • docs-site/src/content/docs/guides/themes.md
  • docs-site/src/content/docs/guides/trust.md
  • docs-site/src/content/docs/index.mdx
  • docs-site/src/content/docs/showcases.md
  • docs-site/src/styles/snapshot.css
  • xtask/src/dashboard_snapshot.rs
  • xtask/src/main.rs
💤 Files with no reviewable changes (3)
  • docs-site/src/content/docs/guides/themes.md
  • docs-site/src/content/docs/guides/getting-started.md
  • docs-site/src/content/docs/index.mdx

Comment thread xtask/src/main.rs
Comment on lines +83 to +96
fn scrub_host_env() {
for key in [
"WT_SESSION",
"GHOSTTY_RESOURCES_DIR",
"KITTY_WINDOW_ID",
"ALACRITTY_WINDOW_ID",
"ALACRITTY_LOG",
"WEZTERM_PANE",
"TERM_PROGRAM",
] {
// SAFETY: xtask is a single-threaded CLI entry point; no other threads can race this.
unsafe { std::env::remove_var(key) };
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find all env var reads in fetcher code to confirm scrub coverage.
rg -nP --type=rust -C1 '\b(std::env::var|env!|env\()\s*\(?\s*"' src/fetcher/

Repository: unhappychoice/splashboard

Length of output: 3041


Add TERM to the scrub list to prevent Kitty from leaking on dev machines.

detect_terminal() triggers the Kitty branch via KITTY_WINDOW_ID.is_some() || TERM == "xterm-kitty". The scrub list removes KITTY_WINDOW_ID but leaves TERM in place, so a dev running xtask inside Kitty (where TERM=xterm-kitty) will still produce snapshots identified as "Kitty"—the exact non-determinism this function exists to prevent.

🛡️ Fix
 fn scrub_host_env() {
     for key in [
         "WT_SESSION",
         "GHOSTTY_RESOURCES_DIR",
         "KITTY_WINDOW_ID",
         "ALACRITTY_WINDOW_ID",
         "ALACRITTY_LOG",
         "WEZTERM_PANE",
         "TERM_PROGRAM",
+        "TERM",
     ] {
         // SAFETY: xtask is a single-threaded CLI entry point; no other threads can race this.
         unsafe { std::env::remove_var(key) };
     }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fn scrub_host_env() {
for key in [
"WT_SESSION",
"GHOSTTY_RESOURCES_DIR",
"KITTY_WINDOW_ID",
"ALACRITTY_WINDOW_ID",
"ALACRITTY_LOG",
"WEZTERM_PANE",
"TERM_PROGRAM",
] {
// SAFETY: xtask is a single-threaded CLI entry point; no other threads can race this.
unsafe { std::env::remove_var(key) };
}
}
fn scrub_host_env() {
for key in [
"WT_SESSION",
"GHOSTTY_RESOURCES_DIR",
"KITTY_WINDOW_ID",
"ALACRITTY_WINDOW_ID",
"ALACRITTY_LOG",
"WEZTERM_PANE",
"TERM_PROGRAM",
"TERM",
] {
// SAFETY: xtask is a single-threaded CLI entry point; no other threads can race this.
unsafe { std::env::remove_var(key) };
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@xtask/src/main.rs` around lines 83 - 96, scrub_host_env() currently removes
KITTY_WINDOW_ID but not TERM, so detect_terminal() can still detect Kitty via
TERM == "xterm-kitty" and leak terminal-specific behavior; update
scrub_host_env() to also remove the "TERM" environment variable (call
std::env::remove_var("TERM") in the same unsafe block or loop of keys) so
detect_terminal() cannot observe TERM and snapshots remain deterministic.

unhappychoice and others added 4 commits April 24, 2026 09:26
…ghten landing

Extend xtask's DASHBOARD_SNAPSHOTS to render every shipped template
(src/templates/home_*.toml, src/templates/project_github_activity.toml)
at a uniform 120×42 canvas so they sit side-by-side under .splash-landing
at identical physical size. Teach dashboard_snapshot::sample_payloads to
call RealtimeFetcher::compute for realtime fetchers so widget format /
options land in the preview; scrub host-identifying env vars before
rendering so the snapshot is deterministic across dev machines.

Rewrite presets.mdx to match what the templates actually ship today
(home_splash = terminal figlet + greeting + clock, home_daily = 2-col
almanac dashboard, home_github = avatar + contributions + activity,
project_github_activity = figlet repo hero + 3 activity rows), split
into Home / Project sections, drop the hand-drawn ASCII mockups and
the 160-line TOML listing in favour of live-render + widget table.

Landing page: drop the "Example: project_github_activity" meta paragraph
so the preview sits directly under the hero, and tighten the vertical
rhythm — zero out .hero's padding-block-end on splash templates and
widen .sl-container's sibling gap to 3.25rem so the button→preview gap
matches the 1.5em h2 top-margin below (both ≈ 52px).

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

The flat concepts.md covered each piece in a paragraph. Move to a
directory with the overview at the index plus four full pages, each
focused on what a user needs to understand to configure, debug, or
extend that piece:

- concepts/ (overview) — the composition equation, the "why" of the
  split, cross-links to each deep dive.
- concepts/widget.md — fields, shape resolution, lifecycle (cached vs
  realtime paths), every placeholder state (loading / trust / empty /
  error), the animation window, and the config scope hierarchy.
- concepts/shape.md — every one of the 12 variants with Rust Body
  struct, JSON payload example, compatible renderers, typical
  fetchers, empty-state rules, and the add-a-shape recipe.
- concepts/fetcher.md — Cached vs Realtime contracts, FetchContext,
  Safety classification with threat-model examples, options /
  cache keys / sample_body, the two ReadStore / basic_static escape
  hatches, and the add-a-fetcher recipe.
- concepts/renderer.md — the full trait surface, RenderOptions,
  alignment rules, empty-state handling, default-per-shape table,
  naming convention, animation integration, and the add-a-renderer
  recipe.

Sidebar gains a nested Concepts group plus a ReadStore entry so the
new pages cluster under Guides.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…are-data format

ReadStore sat as one section in the cookbook, but it's the escape
hatch users land on most often and has a non-obvious file format
(bare inner data struct, not the Body `{shape, data}` envelope the
rest of the system uses). That detail wasn't called out and was the
most common source of copy-paste breakage.

Add guides/read-store.md covering:
- why and when to use it
- the bare-data vs envelope distinction with ✅ / ❌ side-by-side
- how the shape is picked (from the paired renderer, not the file)
- every supported shape (10 of 12 — Badge / Timeline are out) with a
  minimal JSON example
- the file_format option (json / toml / text)
- four end-to-end examples (habit tracker, goal progress, custom
  sparkline, workout heatmap)
- path / safety / what ReadStore isn't

Trim cookbook's ReadStore section to a one-paragraph pointer and
redirect every `cookbook/#readstore-custom-widgets-without-code`
anchor to the new page. Link the configuration.md file_format bullet
to the Shape concept page. Drop the closed-by-design #5 / #20
parentheticals from the trust guide and rewrite the Network-rollout
note so it stands on its own without tracker links.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Doc pages should stand on their own without pointing at the issue
tracker. Strip:

- themes.md opening :::note that deferred preset screenshots to
  issue #78 / #77.
- getting-started.md paragraph pointing at issue #16 for prebuilt
  binaries ("cargo install" alone is enough for the reader).
- showcases.md preset-pending line citing issue #77.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@unhappychoice
unhappychoice force-pushed the docs/presets-match-templates branch from 8beb55f to 6cb5c83 Compare April 24, 2026 00:27
@unhappychoice
unhappychoice merged commit 54f941f into main Apr 24, 2026
7 checks passed
@unhappychoice
unhappychoice deleted the docs/presets-match-templates branch April 24, 2026 00:53
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