feat(tui): Phase 3 — /theme command, OS light/dark auto-follow, sunken output panels#99
Merged
Conversation
Turns the Phase-1 theme foundation into a real user-facing feature.
- theme.rs: a ThemeMode { Dark, Light, Ansi, Auto } decoupled from the
resolved palette so Auto can re-resolve when the OS appearance changes.
set_mode/cycle_mode/mode() manage a single global (mode + palette under
one lock); poll_auto_appearance() re-queries and swaps the palette when
mode = Auto. macOS reads AppleInterfaceStyle; other platforms return
None (Linux XDG portal / Windows registry are a follow-up).
- command.rs: new /theme [dark|light|ansi|auto] command (empty cycles),
registered in COMMANDS so it appears in help + completions.
- hi-tui: handle_theme applies the mode live (the whole UI re-reads the
theme each frame) and echoes it; the idle event loop polls OS
appearance ~every 5s when mode = auto (a no-op — no subprocess — for
fixed modes). hi-cli prints the "TUI only" note.
HI_THEME still seeds the initial mode (now default auto). Runtime /theme
applies for the session.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Tool-output body lines now sit in a subtle sunken panel on truecolor themes, so a block of shell/command output reads as one grouped unit beneath its ◆ header (grok's expanded-panel look). - flatten() tags each visible ToolOutput body line with a `panel` base background (truecolor only; ansi leaves it at the terminal default). The fold footer stays plain so the fold boundary reads as the panel's edge. - render pads panel-tagged lines to the full inner width: a Line background only paints behind its text, so a trailing space span in the panel color turns the per-glyph tint into a full-width block. Non-racy test asserts the body carries theme().panel iff the active palette paints backgrounds; the full-width fill is verified with a screen-dump probe. Deferred still (need block-cursor/live-block/markdown engine): per-block selection folding, the running accent-wave, sticky headers, mouse selection, a real markdown engine. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A pre-existing unformatted `pub use tools::{…}` block reached this branch
via the main merge; CI's cargo fmt --all --check flagged it. Whitespace
only.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
os_appearance only constructs OsAppearance::{Dark,Light} on macOS; on
Linux CI the detector always returns None, so the variants are matched
but never built and -D dead-code rejected them. Platform-conditional
dead code — annotate the enum.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues the grok-inspired TUI work (Phase 1+2 already on main). Two focused, tested increments; no render-model rewrite, no new dependencies.
Phase 3a —
/themecommand + OS light/dark auto-followTurns the Phase-1 theme foundation into a user-facing feature.
ThemeMode { Dark, Light, Ansi, Auto }decoupled from the resolved palette soAutore-resolves when the OS appearance changes./theme [dark|light|ansi|auto]— empty arg cycles; applies live (the whole UI re-reads the theme each frame) and echoes the mode. Registered inCOMMANDS(help + completions)./themein--plainprints a "TUI only" note.AppleInterfaceStyle; the idle event loop polls ~every 5s when mode =auto(a no-op with no subprocess for fixed modes). Linux XDG-portal / Windows-registry detection is a noted follow-up.Phase 3b — sunken output panels
Tool-output body lines now sit in a subtle sunken panel on truecolor themes, so a block of command output reads as one unit beneath its
◆header (grok's expanded-panel look).flatten()tags each visibleToolOutputbody line with apanelbase background (truecolor only; ansi leaves it at terminal default); the fold footer stays plain as the panel's edge.Linebackground only paints behind text, so a trailing bg space turns the per-glyph tint into a full-width block (verified with a screen-dump probe).Deferred (need a block-cursor / live-block / markdown engine)
Per-block selection folding, the running accent-wave animation, sticky prompt headers, mouse selection, a real markdown/syntect engine. These need render-model surgery and are honest P4+ work.
Verification
152 hi-tui + 151 hi-agent tests pass;
cargo clippy -D warnings+cargo fmtclean; ratchet updated. Theme-global mutations are deliberately not unit-tested (they'd race parallel color-asserting render tests); the mode logic is covered by pure tests and the live behavior by screen-dump probes.🤖 Generated with Claude Code