Repository navigation
feat(ui): user-selectable accent color for the Control UI - #128432
Conversation
Adds an Accent color section to Settings -> Appearance: curated preset swatches plus a native custom color input. The choice persists as the gateway-synced ui.prefs.accent (#rrggbb) and takes precedence over the operator-level ui.seamColor, falling back to the active theme's accent when cleared. The shared apply path now also derives readable --accent-foreground/--primary-foreground ink from accent luminance, so light accents keep dark text on primary controls. Bundled accent-invariant cleanup: the embedded terminal resolves its background/cursor/foreground from live computed tokens instead of a hand-copied claw palette (fixes desync on knot/dash/custom themes), a baked rgba(255,92,92) gradient now uses color-mix over --accent, and duplicated diff-tint literals collapse into --danger-subtle/--ok-subtle. Environment branding moved behind a lazy runtime module (-2.5KB gzip startup JS).
Status-dot glows, callout gradients, compaction-indicator borders, chip borders, and dreams pulse animations baked literal green/blue/amber/red rgba values -- several stale copies of old --danger/--info hexes -- so they ignored theme families and light mode's deeper status hues. All 22 sites now color-mix over --ok/--warn/--warn-strong/--danger/--info.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Reusing .settings-theme-card--<theme> on the accent swatch made theme-card Playwright locators resolve to two elements (strict-mode violation in the prefs-reconnect e2e suite). The default swatch now uses .settings-accent-theme--<theme>, added alongside the theme-card selectors in the theme-invariant chip var blocks.
|
Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 10:25 PM ET / August 24, 2026, 02:25 UTC. ClawSweeper reviewWhat this changesAdds a gateway-synced Control UI accent preference, selectable in Appearance, and applies its tokens to interface controls and the embedded terminal. Merge readinessNo blocking patch defect remains after rechecking the prior findings. This maintainer-authored, protected PR should remain open for normal human review rather than automated cleanup. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherThe Control UI stores a local presentation mirror, synchronizes selected preferences through Gateway config, and refreshes CSS tokens when settings or server config change. Those tokens drive the visible interface and terminal color replies. flowchart LR
A[Appearance settings] --> B[Local preference mirror]
B --> C[Gateway config patch]
C --> D[Server preference snapshot]
D --> E[Theme token application]
E --> F[Control UI controls]
E --> G[Embedded terminal]
G --> H[Terminal color replies]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +296, Tests +388, Docs +4, Generated +1. Total +689 across 37 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the single synced-preference and token-application flow, and land it only after normal maintainer review confirms the coupled-version configuration contract remains accepted. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a new Appearance capability rather than repairing an existing defect. Its browser E2E coverage provides a concrete after-change exercise path. Is this the best way to solve the issue? Yes. It extends the existing synced AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1ac7f0161c9e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
The accent apply path set --primary but not --primary-hover, so dark Claw/Knot primary buttons reverted to the theme hover color while an accent was active (ClawSweeper P2). Derive it from --primary like the accent hover, clear it on reset, and prove the resolved hover color via a painted probe in the appearance e2e.
|
ClawSweeper findings addressed in 3d08dfd:
|
|
Merged via squash.
|
…28432) * feat(ui): user-selectable accent color for the Control UI Adds an Accent color section to Settings -> Appearance: curated preset swatches plus a native custom color input. The choice persists as the gateway-synced ui.prefs.accent (#rrggbb) and takes precedence over the operator-level ui.seamColor, falling back to the active theme's accent when cleared. The shared apply path now also derives readable --accent-foreground/--primary-foreground ink from accent luminance, so light accents keep dark text on primary controls. Bundled accent-invariant cleanup: the embedded terminal resolves its background/cursor/foreground from live computed tokens instead of a hand-copied claw palette (fixes desync on knot/dash/custom themes), a baked rgba(255,92,92) gradient now uses color-mix over --accent, and duplicated diff-tint literals collapse into --danger-subtle/--ok-subtle. Environment branding moved behind a lazy runtime module (-2.5KB gzip startup JS). * fix(ui): derive status glows and tints from semantic tokens Status-dot glows, callout gradients, compaction-indicator borders, chip borders, and dreams pulse animations baked literal green/blue/amber/red rgba values -- several stale copies of old --danger/--info hexes -- so they ignored theme families and light mode's deeper status hues. All 22 sites now color-mix over --ok/--warn/--warn-strong/--danger/--info. * fix(ui): scope default accent swatch chip vars to a swatch class Reusing .settings-theme-card--<theme> on the accent swatch made theme-card Playwright locators resolve to two elements (strict-mode violation in the prefs-reconnect e2e suite). The default swatch now uses .settings-accent-theme--<theme>, added alongside the theme-card selectors in the theme-invariant chip var blocks. * fix(ui): carry --primary-hover through the accent override The accent apply path set --primary but not --primary-hover, so dark Claw/Knot primary buttons reverted to the theme hover color while an accent was active (ClawSweeper P2). Derive it from --primary like the accent hover, clear it on reset, and prove the resolved hover color via a painted probe in the appearance e2e.
…ots and never live-updates the chat window (#128703) * fix(macos): honor user accent precedence in config snapshot and live-update chat window The Control UI user accent (ui.prefs.accent) landed in #128432/#128577 with precedence user accent -> operator ui.seamColor -> theme default, and the gateway's talk.config payload already applies it. The macOS app had two gaps: - ChannelsStore.applyUIConfig read raw ui.seamColor from the config.get snapshot and clobbered the user accent set from talk.config depending on arrival order. It now resolves ui.prefs.accent ?? ui.seamColor via a testable helper mirroring the gateway precedence. - The native chat window read AppStateStore.seamColorHex once at window construction, so accent changes never live-updated. MacChatSurface now reads the @observable store in body, deleting the one-shot userAccent plumbing. Docs: configuration-reference.md documents the precedence for native-app chrome. Regression test fails pre-fix (snapshot returned the operator seam color instead of the user accent). * fix(macos): refresh config from gateway config.changed events Addresses the review finding that no macOS consumer turned the gateway's hash-only config.changed broadcast into refreshed shared state, so a Control UI accent change never reached an open native chat window while the app ran. ChannelsStore now subscribes to gateway pushes and re-fetches config.get on config.changed, reconnect snapshots, and sequence gaps. The refresh applies non-force so an in-progress local settings draft wins (the gateway rejects stale-hash writes anyway). The in-flight reload queue gains a closed pending level (none/refresh/force) so a refresh arriving during a load is coalesced instead of dropped, and a requeued refresh cannot clobber a dirty draft the way the old boolean force-pending did.
…ots and never live-updates the chat window (openclaw#128703) * fix(macos): honor user accent precedence in config snapshot and live-update chat window The Control UI user accent (ui.prefs.accent) landed in openclaw#128432/openclaw#128577 with precedence user accent -> operator ui.seamColor -> theme default, and the gateway's talk.config payload already applies it. The macOS app had two gaps: - ChannelsStore.applyUIConfig read raw ui.seamColor from the config.get snapshot and clobbered the user accent set from talk.config depending on arrival order. It now resolves ui.prefs.accent ?? ui.seamColor via a testable helper mirroring the gateway precedence. - The native chat window read AppStateStore.seamColorHex once at window construction, so accent changes never live-updated. MacChatSurface now reads the @observable store in body, deleting the one-shot userAccent plumbing. Docs: configuration-reference.md documents the precedence for native-app chrome. Regression test fails pre-fix (snapshot returned the operator seam color instead of the user accent). * fix(macos): refresh config from gateway config.changed events Addresses the review finding that no macOS consumer turned the gateway's hash-only config.changed broadcast into refreshed shared state, so a Control UI accent change never reached an open native chat window while the app ran. ChannelsStore now subscribes to gateway pushes and re-fetches config.get on config.changed, reconnect snapshots, and sequence gaps. The refresh applies non-force so an in-progress local settings draft wins (the gateway rejects stale-hash writes anyway). The in-flight reload queue gains a closed pending level (none/refresh/force) so a refresh arriving during a load is coalesced instead of dropped, and a requeued refresh cannot clobber a dirty draft the way the old boolean force-pending did.
What Problem This Solves
The Control UI's accent color was effectively hardcoded to each theme's signature (claw red
#ff5c5cby default) with no user control. An operator-level override existed (ui.seamColor, shipped 2026.7.1) but was never surfaced in any UI, making it undiscoverable. Separately, several surfaces baked literal copies of accent/status colors — the embedded terminal hand-copied the claw palette (desyncing on Knot/Dash/custom themes), and status glows/tints carried stalergbacopies of old--danger/--infovalues that never adapted to theme families or light mode.Why This Change Was Made
Users want to pick their own accent without editing gateway config. The existing token layer and seam-color apply path already do the heavy lifting, so this promotes accent to a first-class synced user preference and consolidates both inputs into one apply path, then fixes the accent/status-literal drift in the same invariant sweep.
User Impact
ui.prefs.accent(#rrggbb), following you across devices like theme/mode, with the standard provenance/reset affordances. Precedence: user pref → operatorui.seamColor→ theme default.--accent-foreground/--primary-foregroundfrom accent luminance, so light accents (mint, amber) get readable dark ink on primary controls — this also fixes the pre-existing seamColor path.color-mixvalues), so terminals follow Knot/Dash/custom themes and user accents instead of always rendering the claw palette.--ok/--warn/--warn-strong/--danger/--infoviacolor-mixinstead of stale literals, so they finally track theme family and light mode.docs/web/control-ui.mdAppearance section andui/docs/design-system/color-tokens.md.Evidence
pnpm ui:build,pnpm lint:ui:styles,pnpm ui:i18n:baseline/verify,pnpm tsgo:ui/tsgo:core/tsgo:test:ui,pnpm check:base-config-schema,pnpm check:bundled-channel-config-metadata,pnpm check:changed.pnpm test ui/src/app(10,047 passed),pnpm test ui/src/styles(9,995),pnpm test ui/src/pages/config(10,064), plus a 326-test targeted regression run over the new prefs/presentation/terminal/config surfaces.OPENCLAW_CAPTURE_UI_PROOF=1 pnpm test:ui:e2e— 13 Chromium tests covering startup application, gateway sync, preset selection, custom colors, luminance ink, theme switching, operator-default restore, and terminal computed-color verification.