Skip to content

refactor(config): split settings.toml + dashboard.toml, rename from config.toml #82

Closed

Description

@unhappychoice

Tracks #76 (0.x release scope).

Background

Today: $HOME/.splashboard/config.toml is a single file that carries [general] + [theme] + widgets + rows all together. ./.splashboard/config.toml (per-dir) has the same structure.

UX problems:

  1. Re-running splashboard install --template <preset> (feat: "splashboard install" — one-shot setup (rc wiring + starter config from template) #58) overwrites the user's edited [theme] / [general] along with the dashboard.
  2. When implementing a one-shot splashboard theme <name> command, editing the same file as the dashboard definition has too broad a blast radius.
  3. Per-dir config is "the dashboard specific to this repo" — not a place to override the user's preferences. The filename config.toml doesn't convey that scope.
  4. cd into a project without config still shows the home splash — the killer feature (different splash per project) doesn't fire. A project default is needed.

Proposed file layout

$HOME/.splashboard/
├── settings.toml               # [general] + [theme] — user preferences
├── home.dashboard.toml         # non-git / $HOME / ambient context
├── project.dashboard.toml      # default when sitting at a git repo root with no repo-side override
├── cache/
├── store/
└── trust.toml

# per-project override (walk-up lookup target)
./.splashboard/dashboard.toml
./.splashboard.toml              # shorthand (loaded directly as a dashboard)

home.dashboard.toml / project.dashboard.toml / dashboard.toml share the same schema (widgets + rows).

Dashboard resolution logic

Design principle: only render the project-specific splash when sitting at the root of that project. Otherwise it gets annoying firing on every subdirectory.

At startup (and on --on-cd), decide in this order:

  1. walk-up local (direct only): if CWD directly has ./.splashboard/dashboard.toml or ./.splashboard.toml → render it.
  2. project root: if (1) misses and the repo root returned by gix::discover(cwd) equals CWD (= CWD is the repo top) → render $HOME/.splashboard/project.dashboard.toml.
  3. home: if all of the above miss → $HOME/.splashboard/home.dashboard.toml.

Key properties:

  • (2) does not hit in subdirectories. cd into src/ or docs/ and CWD doesn't match repo root, so "nothing happens" (silent exit on --on-cd).
  • walk-up stays "direct only" for per-dir config. A parent dir's .splashboard/ doesn't render in a subdirectory. Matches the current --on-cd behavior.
  • $HOME exception: for people who keep dotfiles in a git repo at $HOME, CWD == $HOME skips the git check and forces home.

Settings is always at HOME — per-dir settings override is out of scope for 0.x.

Migration

Breaking change within 0.x. The old config.toml is supported for one release:

  • If $HOME/.splashboard/config.toml exists, on first launch:
    • Extract [general] + [theme] into settings.toml.
    • Extract widgets + rows into home.dashboard.toml.
    • Rename config.toml to config.toml.bak.
    • stderr: "migrated".
  • For per-dir ./.splashboard/config.toml: suggest renaming to ./.splashboard/dashboard.toml (non-destructive — old name still readable but warns).
  • Drop config.toml support one release later (targeted 0.2.0).

Definition of Done

  • Split src/config.rs into SettingsConfig + DashboardConfig
  • src/paths.rs: settings_path() / home_dashboard_path() / project_dashboard_path() + walk-up impl
  • Dashboard resolution (direct-local → git-root-match → home fallback + $HOME exception)
  • Old-config.toml migration + deprecation warning
  • Split the baked default into default_home_dashboard.toml + default_project_dashboard.toml + default_settings.toml
  • Rename the dogfood ./.splashboard/config.toml to ./.splashboard/dashboard.toml
  • Update the Configuration page in docs (docs: expand docs-site with guide section (Getting Started / Configuration / Presets / Themes / Trust / Cookbook) #78) to match

Out of scope

Activity

  1. added
    feat
    on Apr 22, 2026
  2. added a commit that references this issue on Apr 22, 2026
    7c75e69
  3. added a commit that references this issue on Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions