Skip to content

fix(ui): make Control UI terminal readable in light mode - #123184

Merged
steipete merged 1 commit into
mainfrom
steipete/terminal-light-mode-contrast-4ef88d
Aug 13, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/terminal-light-mode-contrast-4ef88d

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Control UI terminal is nearly unreadable in light mode. The light theme in ui/src/components/terminal/terminal-theme.ts re-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 #f7f8fa surface (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 mode gets a dedicated LIGHT_ANSI palette 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.
  • The banner emits ANSI-16 yellow (headline) and bright red (claw art): warm tan/salmon on dark (visually close to the previous fixed colors), dark gold/crimson on light.
  • Dark mode palette is unchanged; light selection highlight follows the darker blue.

User Impact

Operators using the Control UI in light mode get a readable terminal — prompt colors, ls output, and the intro banner all render at accessible contrast. Dark mode looks the same as before.

Evidence

before after
light light before light after
dark dark before dark after

Screenshots captured from the mocked Control UI dev server driving the real ghostty terminal runtime (createIsolatedGhosttyTerminal + terminalTheme), writing the exact banner bytes each revision's composeTerminalIntroBanner emits plus a representative ANSI-16 prompt/ls sample.

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)
  • Codex autoreview (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.

@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 13, 2026 12:26
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Aug 13, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 10:02 AM ET / 14:02 UTC.

ClawSweeper review

What this changes

The 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 readiness

⚠️ Ready for maintainer review - 4 items remain

Keep 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
Reviewed head: 0becc658d84a390b6644e29132857009a1cebcb7
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The submitted patch and visual evidence are coherent, but the review environment prevented the independent source, policy, and history checks needed for a stronger rating.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository state identifies a member-authored PR, so the external-contributor proof gate does not apply; the body nevertheless supplies direct before/after terminal screenshots from the stated runtime setup.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository state identifies a member-authored PR, so the external-contributor proof gate does not apply; the body nevertheless supplies direct before/after terminal screenshots from the stated runtime setup.
Evidence reviewed 4 items Submitted UI implementation: The supplied PR diff at the stated head adds a separate light ANSI palette in the terminal theme and selects it for light mode.
Submitted gateway behavior: The supplied PR diff changes the greeting headline and art from fixed 256-color escapes to ANSI-16 yellow and bright red, which the client palette can render per mode.
Submitted visual proof: The PR body provides before/after light and dark screenshots and describes exercising the real Ghostty terminal runtime with the emitted greeting bytes; this directly addresses the visible readability claim.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Decision needed

Question Recommendation
Should this member-authored, maintainer-labeled visual accessibility repair be merged after an exact-head source review confirms the palette is applied by the current Ghostty terminal integration? Refresh source review and merge: Confirm the current terminal-theme call path and greeting test at the PR head, then merge if the submitted light and dark visual evidence matches runtime behavior.

Why: The environment failure prevents the independent current-main, history, and scoped-policy checks required for an automated merge judgment.

Before merge

  • Resolve merge risk (P1) - The sandbox failure prevents independent confirmation that the proposed Ghostty theme shape, its callers, scoped guidance, and current-main changes remain compatible; a maintainer should refresh that source review before merge.
  • Resolve merge risk (P1) - The patch has a net production increase of 25 lines for the new light palette; the dedicated palette appears directly tied to the accessibility repair, but its necessity could not be compared with existing shared theme abstractions.
  • Complete next step (P2) - This member-authored, maintainer-labeled PR needs a human exact-head source refresh because the review environment could not inspect the checkout; it is not an automated repair candidate.
Agent review details

Security

None.

PR surface

Source +25, Tests 0. Total +25 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 35 10 +25
Tests 1 2 2 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 37 12 +25

Review metrics

Metric Value Why it matters
Production versus test delta production +35/-10 (net +25); tests +2/-2 The new palette is concrete accessibility behavior, but the positive production growth should be checked against any existing theme abstraction before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add P2: The reported light-mode terminal contrast defect affects a bounded Control UI workflow without evidence of a broader runtime outage.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Repository state identifies a member-authored PR, so the external-contributor proof gate does not apply; the body nevertheless supplies direct before/after terminal screenshots from the stated runtime setup.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository state identifies a member-authored PR, so the external-contributor proof gate does not apply; the body nevertheless supplies direct before/after terminal screenshots from the stated runtime setup.

Label justifications:

  • P2: The reported light-mode terminal contrast defect affects a bounded Control UI workflow without evidence of a broader runtime outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository state identifies a member-authored PR, so the external-contributor proof gate does not apply; the body nevertheless supplies direct before/after terminal screenshots from the stated runtime setup.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Repository state identifies a member-authored PR, so the external-contributor proof gate does not apply; the body nevertheless supplies direct before/after terminal screenshots from the stated runtime setup.

Evidence

What I checked:

  • Submitted UI implementation: The supplied PR diff at the stated head adds a separate light ANSI palette in the terminal theme and selects it for light mode. (ui/src/components/terminal/terminal-theme.ts:30, 0becc658d84a)
  • Submitted gateway behavior: The supplied PR diff changes the greeting headline and art from fixed 256-color escapes to ANSI-16 yellow and bright red, which the client palette can render per mode. (src/gateway/terminal/intro-banner.ts:27, 0becc658d84a)
  • Submitted visual proof: The PR body provides before/after light and dark screenshots and describes exercising the real Ghostty terminal runtime with the emitted greeting bytes; this directly addresses the visible readability claim. (0becc658d84a)
  • Inspection infrastructure failure: The only attempted read-only checkout inspection failed before command execution with bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted; current-main source, scoped AGENTS.md files, history, and attachments could not be independently inspected.

Likely related people:

  • steipete: Repository context identifies a member-authored one-commit patch on the terminal theme and greeting surfaces; feature-history attribution could not be inspected because checkout reads failed. (role: member author and current implementation owner; confidence: medium; commits: 0becc658d84a; files: ui/src/components/terminal/terminal-theme.ts, src/gateway/terminal/intro-banner.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh the exact-head source review once checkout reads are available, including the terminal-theme consumer and greeting test.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

Addressing the ClawSweeper rank-up move (exact-head source review; its sandbox failed with a bwrap loopback error before it could read the checkout) — maintainer exact-head review performed at 0becc658d84a390b6644e29132857009a1cebcb7 via the repo-native scripts/pr review artifacts:

  • Terminal-theme consumer path verified at head: terminalTheme(mode) is consumed by ui/src/components/terminal/terminal-panel-session-controller.ts (theme passed at terminal creation) and ui/src/components/terminal/terminal-panel-session-rendering.ts (updateTerminalSessionTheme re-applies it via renderer.setTheme + forced render on mode switch, since ghostty-web 0.4.0 ignores post-open option themes). Both paths receive the new LIGHT_ANSI/DARK_ANSI split with no other consumers in the tree.
  • Greeting test verified at head: src/gateway/terminal/intro-banner.test.ts asserts the exact ANSI-16 escape bytes (\x1b[33m headline, \x1b[91m art) — green at head, fails on pre-fix code.
  • Production LOC growth (+25): there is no existing shared theme abstraction that expresses per-mode ANSI palettes — the light theme previously piggybacked on the dark palette with two spot overrides, which is the bug. The palette literal is the capability; the screenshots in the PR body show why it cannot be derived from the dark values.
  • Visual evidence was captured on the real ghostty runtime (createIsolatedGhosttyTerminal) at both revisions, writing each revision's exact composeTerminalIntroBanner bytes.

The wedged preflight/Scan changed paths jobs from the first attempt were provider-orphaned (queued 2.5h while newer runs on the same Blacksmith label executed); both runs were cancelled and re-fired and are pending on attempt 2.

@steipete steipete closed this Aug 13, 2026
@steipete steipete reopened this Aug 13, 2026
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.
@steipete
steipete force-pushed the steipete/terminal-light-mode-contrast-4ef88d branch from 0becc65 to 9ae3098 Compare August 13, 2026 20:52
@steipete
steipete merged commit dbea5a7 into main Aug 13, 2026
128 checks passed
@steipete
steipete deleted the steipete/terminal-light-mode-contrast-4ef88d branch August 13, 2026 21:14
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 14, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant