Repository navigation
fix(ui): make Control UI terminal readable in light mode - #123184
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 10:02 AM ET / 14:02 UTC. ClawSweeper reviewWhat this changesThe PR adds a readable light-mode ANSI palette for the Control UI terminal and replaces the gateway greeting’s fixed colors with theme-aware ANSI-16 escapes. Merge readinessKeep open for maintainer review: this is a member-authored, maintainer-labeled UI fix with plausible visual proof, but the review environment could not read the checkout to verify current source, scoped policy, or history. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI passes its selected color mode into the browser terminal theme, while the gateway writes the terminal’s initial greeting bytes. The terminal client maps semantic ANSI colors to its active palette before displaying commands and the greeting. flowchart LR
A[Control UI color mode] --> B[Terminal theme]
B --> C[ANSI color palette]
D[Gateway greeting] --> E[ANSI-16 escape codes]
C --> F[Browser terminal]
E --> F
F --> G[Readable terminal output]
Decision needed
Why: The environment failure prevents the independent current-main, history, and scoped-policy checks required for an automated merge judgment. Before merge
Agent review detailsSecurityNone. PR surfaceSource +25, Tests 0. Total +25 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the dedicated per-mode ANSI palette and semantic greeting colors if an exact-head source review confirms the terminal client consumes these color slots as shown and the visual contrast evidence remains representative. Do we have a high-confidence way to reproduce the issue? No: the supplied screenshots describe a concrete visual reproduction, but the review sandbox failed before the current checkout or attached proof could be independently exercised or inspected. Is this the best way to solve the issue? Unclear: the submitted semantic ANSI-16 approach is a plausible owner-boundary repair, but the checkout failure prevents comparison with current terminal-theme callers and sibling theme handling. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 843017073cc2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Addressing the ClawSweeper rank-up move (exact-head source review; its sandbox failed with a
The wedged |
The light terminal theme reused the dark-background ANSI palette (1.4-2.6:1 contrast on #f7f8fa; brightWhite was 1.06), and the intro banner hardcoded 256-color indices 223/216 that bypass the client theme entirely. Light mode now gets its own darkened ANSI-16 palette (>=4.5:1, bright variants darker for emphasis, brightWhite maps to strongest ink), and the banner emits themable ANSI-16 yellow/bright-red so each mode owns its rendering. Dark mode is visually unchanged.
0becc65 to
9ae3098
Compare
|
Merged via squash.
|
…3184) The light terminal theme reused the dark-background ANSI palette (1.4-2.6:1 contrast on #f7f8fa; brightWhite was 1.06), and the intro banner hardcoded 256-color indices 223/216 that bypass the client theme entirely. Light mode now gets its own darkened ANSI-16 palette (>=4.5:1, bright variants darker for emphasis, brightWhite maps to strongest ink), and the banner emits themable ANSI-16 yellow/bright-red so each mode owns its rendering. Dark mode is visually unchanged.
What Problem This Solves
The Control UI terminal is nearly unreadable in light mode. The light theme in
ui/src/components/terminal/terminal-theme.tsre-mapped only black/white and reused the dark-background ANSI palette for the other 14 slots, leaving 1.4–2.6:1 WCAG contrast on the#f7f8fasurface (yellow 1.63, brightYellow 1.38, brightWhite 1.06 — white on white). On top of that, the gateway intro banner (src/gateway/terminal/intro-banner.ts) hardcoded 256-color indices 223/216 (pale tan/salmon), which bypass the client theme entirely, so the greeting and claw art washed out on light no matter what the palette said.Why This Change Was Made
Light backgrounds need darker ANSI colors — the same convention every paired terminal theme follows (Ghostty, iTerm). And the server can't know the client's color mode, so the banner must speak semantic ANSI-16 that the client theme renders per mode instead of fixed 256-color values.
LIGHT_ANSIpalette with the same hue identities, all ≥4.95:1 on#f7f8fa(normal slots ~5.0–5.6, bright slots ~6.5–7.5). Bright variants go darker than normal ones so bold/bright text stays emphatic; brightWhite maps to the strongest ink.User Impact
Operators using the Control UI in light mode get a readable terminal — prompt colors,
lsoutput, and the intro banner all render at accessible contrast. Dark mode looks the same as before.Evidence
Screenshots captured from the mocked Control UI dev server driving the real ghostty terminal runtime (
createIsolatedGhosttyTerminal+terminalTheme), writing the exact banner bytes each revision'scomposeTerminalIntroBanneremits plus a representative ANSI-16 prompt/lssample.Validation:
node scripts/run-vitest.mjs src/gateway/terminal/intro-banner.test.ts— green (asserts the new ANSI-16 escapes)node scripts/check-changed.mjs— exit 0 (format, lint, import cycles, guard lanes)gpt-5.6-sol, high): clean, "patch is correct (0.99)"WCAG contrast on
#f7f8fa, before → after: red 2.61→5.10, green 1.93→4.96, yellow 1.63→4.95, blue 2.46→5.11, magenta 2.62→5.58, cyan 2.23→5.11, brightRed 2.18→6.93, brightGreen 1.63→6.52, brightYellow 1.38→6.67, brightBlue 1.96→6.74, brightMagenta 1.96→7.45, brightCyan 1.62→6.76, brightWhite 1.06→18.42.