Motivation
#137 (theme iter 2) explicitly scopes detection to session start ("Detection runs once on startup, result is fixed for the session") and tells users to restart the TUI on mid-session terminal-theme change. That's a reasonable v1 contract — but a one-keystroke flip is a high-value polish for users on dual-mode terminals (macOS auto-dark, base16-shell switches, dual-monitor light/dark) without paying the OSC 11 re-detection cost #137 deferred.
This issue is the runtime override that #137 deferred.
Scope
P0:
P1:
Pitfalls
- 🟡 Keybind collision:
t and T are not currently used in the global keymap (verify against `crates/scitadel-tui/src/app.rs` at issue time). `e` is taken in PaperDetail for annotation-edit; `T` should be safe but check.
- 🟡 Cycle vs. binary toggle: today only two themes exist (dark, light). If `scitadel-light` / `scitadel-dark` extras land later, `T` should cycle through registered themes, not stay binary. Implement as cycle from day one to avoid the rewrite.
- 🟡 Toggle vs. detection precedence: a runtime toggle overrides whatever `auto` resolved to. Don't re-trigger detection on the next startup based on the toggle — `auto` should still mean "detect at startup". The toggle is session-only.
- 🟢 Persisting the choice is out of scope here; if the user wants their pick remembered, that's `ui.theme = light` in config or `--theme light` on launch.
Acceptance
References
Motivation
#137 (theme iter 2) explicitly scopes detection to session start ("Detection runs once on startup, result is fixed for the session") and tells users to restart the TUI on mid-session terminal-theme change. That's a reasonable v1 contract — but a one-keystroke flip is a high-value polish for users on dual-mode terminals (macOS auto-dark, base16-shell switches, dual-monitor light/dark) without paying the OSC 11 re-detection cost #137 deferred.
This issue is the runtime override that #137 deferred.
Scope
P0:
T(orCtrl+T) toggles betweendalton-darkanddalton-lightfor the running sessiontheme: dalton-light(mirrors the startup toast from feat(tui): light mode + auto-detect (theme iter 2) #137 P1)P1:
:theme <name>command-mode entry (if/when command mode lands) for explicit set rather than togglePitfalls
tandTare not currently used in the global keymap (verify against `crates/scitadel-tui/src/app.rs` at issue time). `e` is taken in PaperDetail for annotation-edit; `T` should be safe but check.Acceptance
References