Repository navigation
feat: $HOME/.splashboard/ home-dir layout + ReadStore fetcher - #43
Conversation
… + ship ReadStore fetcher Two changes landing together because ReadStore's path resolution sits on top of the new home-dir layout. **Home directory refactor (src/paths.rs)** Every splashboard-owned file now lives under \`\$HOME/.splashboard/\` — same name as the per-directory config convention, so users see one place for all their splashboard state regardless of platform: \$HOME/.splashboard/ ├── config.toml (was ~/.config/splashboard/config.toml) ├── trust.toml (was ~/.local/share/splashboard/trusted.toml) ├── cache/ (was ~/.cache/splashboard/) └── store/ (new — ReadStore files) Previously these used the \`dirs\` crate, which returns platform-native paths (\`~/Library/Application Support/...\` on macOS, \`%APPDATA%\` on Windows). That's fine for GUI apps but awkward for a Unix-flavored CLI tool; users rightly expect dotfile conventions. One visible dir makes backup, sync, docs, and troubleshooting substantially easier. Overridable via the \`SPLASHBOARD_HOME\` env var for tests and CI. No automatic migration — pre-1.0, existing cache/trust stores are disposable and \`config.toml\` is a one-time manual move. **ReadStore fetcher (src/fetcher/read_store.rs)** Fills the gap left by closing #5 (plugin protocol) and #20 (command widget). Users write arbitrary data to \`\$HOME/.splashboard/store/<id>.<ext>\`; splashboard reads and renders per the widget's declared shape. - Always \`Safety::Safe\` — path is derived from sanitized widget id under a fixed home subdir, so a hostile local config has no path-traversal vector. - Supports every \`Body\` shape: lines, entries, ratio, number_series, point_series, bars, image, calendar, heatmap. - file_format: json | toml | text. Text is only valid for shape=lines. - Missing file → empty-but-valid body for the declared shape (silent). - Cache key includes widget id and shape so distinct widgets don't collide. Closes #38. **Dogfood** The repo's own config now ships a ReadStore demo slot that reads \`\$HOME/.splashboard/store/habit.json\` as a heatmap. Empty by default; users drop a JSON blob there to see their own grass. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Warning Rate limit exceeded
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 5 minutes and 28 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
✨ Finishing Touches🧪 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 |
Until now each renderer silently drew nothing when its body was empty — heatmap skipped, bar_chart left blank, image no-op'd. The widget slot looked absent, which is visually indistinguishable from a layout bug. Dispatch-layer short-circuit: `render_payload` asks `is_empty_body` first and routes to a centered, dim em-dash placeholder when true. Single treatment for every shape, no per-renderer work. Especially useful for ReadStore widgets (missing file → empty body of the declared shape) but helps any widget whose upstream data hasn't landed yet. Ratio (0.0 is real data) and Calendar (month/year are always present) are never considered empty. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Replaces the single em-dash with a two-line centered placeholder when there's vertical room: a dim dotted-circle glyph (◌) above the caption \"nothing here yet\". Shrinks to a single line if the slot is too short. Vertical centering via a Fill / Length / Fill layout, italic + dim styling so it fades into the background without looking like a real value. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The heatmap ReadStore demo needed users to craft a JSON blob before they saw anything useful. Swap to a text-file-backed notes slot so the demo reads exactly how most ReadStore use cases will: drop some text in \$HOME/.splashboard/store/<id>.txt, see it render. id renamed to `scratch`, row height reduced to 5 (suits short notes). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Closes #38.
Summary
Two changes landing together because ReadStore's path resolution sits on the new home-dir layout.
Home-dir layout (`src/paths.rs`)
All splashboard state moves under `$HOME/.splashboard/` — one visible place on every platform, matching the per-directory config convention users already know:
```
$HOME/.splashboard/
├── config.toml # was ~/.config/splashboard/config.toml
├── trust.toml # was ~/.local/share/splashboard/trusted.toml
├── cache/ # was ~/.cache/splashboard/
└── store/ # new, for ReadStore
```
Previously we used the `dirs` crate, which returns platform-native paths (`~/Library/Application Support/...` on macOS, `%APPDATA%` on Windows). Fine for GUI apps, awkward for a Unix-flavored CLI tool where dotfile conventions are the norm. Users asked for one visible dir.
Overridable via `SPLASHBOARD_HOME` env var (tests, CI, power users). No automatic migration — pre-1.0, existing cache/trust stores are disposable and `config.toml` is a one-time manual move.
ReadStore fetcher (`src/fetcher/read_store.rs`)
Fills the gap left by closing #5 (plugin protocol) and #20 (command widget). Users write arbitrary data to `$HOME/.splashboard/store/.`; splashboard deserializes and renders per the widget's declared shape.
Dogfood
The repo's `.splashboard/config.toml` now has a ReadStore demo slot pointing at `$HOME/.splashboard/store/habit.json` as a heatmap. Empty by default; users drop a JSON blob there to see their own grass grid.
Test plan
🤖 Generated with Claude Code