Repository navigation
feat(config): TOML config with per-directory discovery (#2) - #25
Conversation
Declarative config replaces the hardcoded programmatic layout in main.rs:
- src/default_config.toml: built-in default, bundled via include_str!
- Config types mirror the runtime Layout tree at a 2-level (rows × cols)
granularity — enough for splash layouts, ergonomic in TOML.
- SizeSpec / BorderSpec / RenderType deserialize via serde's default
externally-tagged enum repr (`width = { fill = 1 }` / `border = "rounded"`).
- Config::to_layout converts the declarative tree into the runtime
Layout built by #3, preserving panel titles and borders.
## Config discovery
`resolve_config_path` walks up from the current directory looking for
`.splashboard.toml`; if none found, falls back to
`$XDG_CONFIG_HOME/splashboard/config.toml`; if that's missing too, uses
the baked-in default.
This enables per-project dashboards: drop a `.splashboard.toml` at the
root of any repo and `splashboard` run inside that tree picks it up.
The cd-hook piece that triggers the splash automatically is out of
scope here — that's #6 shell integration.
Main.rs now loads config at startup, derives layout from it, and
matches widget ids against stub payload builders. Real fetchers replace
the stubs in #4 and the widget implementation issues.
Closes #2
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 49 minutes and 30 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 ignored due to path filters (1)
📒 Files selected for processing (4)
✨ 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 |
Adds a second candidate for project-local config, preferred over the flat dotfile when both exist in the same directory. The directory form lets projects group future companion files (plugins/, themes/, cache/) under one `.splashboard/` root alongside the config — same pattern as .github/, .vscode/, .cargo/. Discovery order at each ancestor directory, first match wins: 1. .splashboard/config.toml 2. .splashboard.toml Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Declarative TOML config replaces the programmatic Layout in
main.rs. Built-in default lives atsrc/default_config.toml(bundled viainclude_str!). Config covers all axes: widget definitions + layout tree + panel decoration.Schema (2-level: rows × cols)
sizespecs ({ fill = 1 }/{ length = 6 }/{ min = 6 }/{ max = 30 }/{ percentage = 50 }) map to the full Ratatui Constraint repertoire via core: Layout engine (widget positioning) #3'sSize.title+borderattach aPanelto that row or widget (group-style or per-widget).Discovery order
At each ancestor directory walking up from CWD, first match wins:
./.splashboard/config.toml— directory form (future companions:plugins/,themes/,cache/)./.splashboard.toml— flat dotfile$XDG_CONFIG_HOME/splashboard/config.toml— globalDrop either form at the root of any project and
splashboardrun inside that tree picks it up automatically. The cd-hook that triggers the splash without typingsplashboardis scope for #6 shell integration.What's still hardcoded
Widget payloads are produced by
stub_*functions inmain.rsmatched by id. Real fetchers (sysinfo, git log, HTTP clients, subprocess plugins) replace the stubs in #4 async/cache + the per-widget issues (#7–#14, #20).Test plan
cargo build(zero warnings)cargo test(46 passed: 12 payload + 12 render + 9 layout + 13 config)cargo clippy --all-targets -- -D warningscargo fmt --checkCloses #2.
🤖 Generated with Claude Code