You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
Yogthos
committed
ui: phosphor theme (80s CRT green)
Adds a centralized color theme with two presets and a default-on
phosphor-green palette. Errors stay red and warnings stay yellow
across every preset — the semantic urgency channel doesn't get
traded for aesthetics.
## New module
`src/ui/theme.rs` — `Theme` struct with semantic roles (agent, user,
system, tool, perm, result, error, warn, accent, dim, header,
divider, banner_*) and two presets:
- `phosphor` (default) — green accents on black for the assistant
chat, dim green for results/tool output, bright green for headers/
banner. Permission prompts use yellow so they stand loud.
- `plain` — the pre-theme white assistant / cyan accent look. Set
`"theme": "plain"` in config.json if green-on-black doesn't suit
your terminal background.
The active theme is initialized once at boot from `cfg.theme` and
read everywhere via helper fns (`theme::agent()`, `theme::error()`,
…) so future palette swaps don't ripple across call sites.
## Welcome banner
`render_session` now opens with a 4-line CRT-style box-drawn banner:
╔══════════════════════════════════════════╗
║ ░ DIRGE ░ PHOSPHOR ░ v1.0.0 ║
║ provider: openai · model: gpt-4 ║
╚══════════════════════════════════════════╝
Truncates gracefully on narrow terminals (clamps inner width to
`terminal_width - 4`).
## Call-site migration
The 213 references to `C_AGENT` / `C_ERROR` / `C_TOOL` / `C_PERM` /
`C_RESULT` constants in `src/ui/mod.rs` + `src/ui/slash.rs` are now
`c_agent()` / etc. fn calls that delegate to the theme module. Spelling
stayed similar so the diff is mechanical search-replace plus tiny
shims at the top of each file.
`renderer.rs` panel + status + input-prompt color literals (`Color::Cyan`,
`Color::DarkGrey`, `Color::DarkYellow`) replaced with theme accessors
(`accent()`, `dim()`, `warn()`). Picker (file picker + list picker)
got the same treatment.
`events.rs::render_session` now uses themed colors for user `>` /
assistant `<` / system `#` prefixes (`theme::user/agent/system`).
The leading `░` glyph on AGENTS.md/compaction status lines gives the
banner aesthetic a little continuity into the chat scrollback.
## Config
New `theme: Option<String>` field on `Config`. Documented in CONFIG.md
+ a short note in README.md. CLI flag intentionally omitted — palette
is a long-lived per-user preference, not a per-invocation choice.
## Tests
3 new in `ui::theme::tests`:
- `presets_are_distinct`
- `error_and_warn_stay_loud` (locks in the red/yellow contract for
every shipping preset)
- `init_with_unknown_name_falls_back`
Totals:
- [x] `cargo test --features plugin` -> 599 pass, 0 fail (was 596 + 3).
- [x] `cargo build --features plugin` -> 0 warnings.
- [x] `cargo build` -> 0 warnings.
- [x] `./target/debug/dirge --version` works.
Copy file name to clipboardExpand all lines: CONFIG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,7 @@ Accepted top-level keys:
81
81
|`show_edit_diff`| boolean | Show colorized diff output for `edit` tool results (`-` red, `+` green, `@@` cyan). Default: `true`. |
82
82
|`tool_result_max_chars`| integer | Maximum characters to show before truncating tool output with `[N more chars]`. Default: `500`. |
83
83
|`default_prompt`| string | Prompt name to activate on startup. Default: `code`. |
84
+
|`theme`| string | UI color theme. `phosphor` (default — 80s CRT green-on-black) or `plain` (pre-theme white/cyan). Unknown values fall back to `phosphor` with a warning. |
84
85
|`mcp_servers`| object | MCP server map when compiled with the `mcp` feature. When omitted, defaults to a single Exa Web Search server; see below. |
85
86
|`acp_servers`| object | ACP server config map when compiled with the `acp` feature. See the ACP section below. |
86
87
|`acp_host`| string | TCP bind host for ACP server mode (equivalent to `--acp-host`). |
0 commit comments