Skip to content

fix(ui): restore WCAG AA contrast for muted webchat text (AI-assisted) - #110195

Merged
steipete merged 5 commits into
openclaw:mainfrom
stantheman0128:fix/107299-webchat-muted-wcag
Jul 29, 2026
Merged

steipete merged 5 commits into
openclaw:mainfrom
stantheman0128:fix/107299-webchat-muted-wcag

Conversation

@stantheman0128

@stantheman0128 stantheman0128 commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #107299

What Problem This Solves

Fixes an issue where webchat users on the dark theme would see secondary text (message timestamps, slash-menu argument hints) that falls below WCAG AA contrast (4.5:1), even though the shared --muted token itself already meets AA on declared dark backgrounds.

Why This Change Was Made

Prior closed PR #107562 brightened the shared dark --muted tokens globally. ClawSweeper correctly blocked that: at current main, #8b8b94 / #898990 already pass AA on --bg, --bg-elevated, and --bg-muted.

The remaining HEAD failure is composited opacity on real chat selectors:

Selector Before Composited on --bg AA
.chat-group-timestamp color: var(--muted); opacity: 0.7 ~3.34:1 FAIL
.slash-menu-args color: var(--muted); opacity: 0.65 ~3.04:1 FAIL

This PR removes that opacity dimming so muted text renders at the already-AA token color, documents the dark-theme AA floor in base.css, and adds a regression test for token and composited pairings.

AI-assisted contribution (Cursor/Grok). Human author: Stan Shih (stantheman0128).

User Impact

  • Dark-theme message timestamps and slash-command argument hints are readable at WCAG AA.
  • Shared theme tokens are unchanged, so unrelated muted surfaces keep their intended hierarchy.
  • Future palette or opacity regressions on these pairings fail CI via theme-contrast.test.ts.

Evidence

Computed contrast (sRGB relative luminance) on current main tokens --muted #8b8b94:

Before (opacity composite on --bg #0e1015):

  • timestamp opacity: 0.7 => ~3.34:1 FAIL
  • slash-args opacity: 0.65 => ~3.04:1 FAIL

After (full-opacity --muted):

  • on --bg #0e1015: 5.63:1 PASS
  • on --bg-elevated #191c24: 5.04:1 PASS
  • on --bg-muted #1f2330: 4.64:1 PASS
  • on --card #161920: 5.21:1 PASS

Focused test:

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/styles/theme-contrast.test.ts

 Test Files  1 passed (1)
      Tests  2 passed (2)

CI follow-up (8a3c09633c): narrowed luminance/CSS-var helpers with proper undefined guards so pnpm check:test-types passes under strict indexed access. Local re-run: vitest 2/2 passed; pnpm check:test-types exit 0.

Dark-theme Control UI proof (after fix)

Redacted Control UI browser capture on this branch (mock gateway e2e session; no private paths or tokens). Combined frame forces the hover-gated message footer visible so timestamp and slash menu can appear together; measured colors/opacities are the real post-fix rules.

Dark theme both surfaces: timestamp 2m ago and slash-menu args

Crops:

Timestamp crop: OpenClaw 2m ago

Slash menu crop with muted args

Full Control UI frame:

Full dark Control UI

Runtime computed styles from that capture (data-theme-mode=dark, --muted #8b8b94 on --bg #0e1015):

  • .chat-group-timestamp: color: rgb(139, 139, 148); opacity: 1; label 2m ago
  • .slash-menu-args: color: rgb(139, 139, 148); opacity: 1; text <message> (from /redirect)

Artifact release: https://github.com/stantheman0128/openclaw/releases/tag/pr-110195-wcag-proof

Related: closed unmerged #107562 (token brightening without current-main failing selector). This PR addresses the proven composited failure instead.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 25, 2026, 1:05 AM ET / 05:05 UTC.

ClawSweeper review

What this changes

Removes opacity dimming from dark-theme Webchat timestamps and slash-command argument hints, documents the contrast invariant, and adds regression coverage for the affected CSS colors and opacity combinations.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal maintainer review. It makes a narrowly scoped accessibility repair, has focused regression coverage, and includes redacted after-fix Control UI screenshots; the only remaining review-state concern is that its clean branch is behind current main, so the final merge should be evaluated against the current merge result.

Likely related people: the submitted patch is currently attributable to stantheman0128; current-main ownership provenance could not be established from the supplied review material.

Priority: P2
Reviewed head: 39469f097430f20d37d70aadf0caad6318bfdcfe

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-evidenced UI accessibility repair with no supported correctness finding; final current-main merge review remains appropriate.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Redacted after-fix Control UI screenshots directly show the timestamp and slash-menu argument surfaces in dark mode, alongside reported computed full-opacity styles; no private data is visible in the described artifacts.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Redacted after-fix Control UI screenshots directly show the timestamp and slash-menu argument surfaces in dark mode, alongside reported computed full-opacity styles; no private data is visible in the described artifacts.
Evidence reviewed 5 items Targeted selector repair: The proposed patch removes opacity: 0.7 from the grouped-message timestamp and opacity: 0.65 from slash-menu arguments while retaining the existing var(--muted) token, avoiding the previously rejected global token-brightening approach.
Regression coverage: The branch adds theme-contrast.test.ts to calculate token contrast, composite opacity colors, and assert the affected dark-theme pairings and selector rules.
Real UI proof: The PR body and follow-up comment provide redacted dark-theme Control UI screenshots showing both affected surfaces after the fix, with reported computed styles of full-opacity rgb(139, 139, 148).
Findings None None.
Security None None.

How this fits together

The Control UI renders grouped chat messages and slash-command suggestions from CSS theme tokens. These two muted-text selectors sit on dark chat backgrounds, so their final composited foreground color determines whether secondary UI text remains readable.

flowchart LR
  ThemeTokens[Dark theme tokens] --> ChatStyles[Chat and slash-menu styles]
  ChatStyles --> OpacityDecision[Muted-text opacity]
  OpacityDecision --> RenderedText[Rendered timestamp and argument hints]
  RenderedText --> ContrastCheck[Contrast regression test]
  ContrastCheck --> Webchat[Accessible Webchat UI]
Loading

Before merge

  • Resolve merge risk (P1) - The PR is marked mergeable but behind main; review or rebase against the current merge result is needed before landing so the CSS and focused test still apply cleanly to current UI styles.
  • Complete next step (P2) - No concrete repair is indicated; the remaining action is ordinary maintainer merge review of a branch behind current main.
Agent review details

Security

None.

PR surface

Source +2, Tests +149. Total +151 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 5 3 +2
Tests 1 149 0 +149
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 154 3 +151

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #107299
Summary: This PR is a concrete candidate fix for the open Webchat dark-theme muted-text contrast report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the selector-level fix and regression test, then land the current merge result once maintainers confirm it remains clean against current main.
  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 selector-level fix and regression test, then land the current merge result once maintainers confirm it remains clean against current main.

Do we have a high-confidence way to reproduce the issue?

Unclear for a fresh live current-main run in this review, but the source path is concrete: the two selectors apply muted text with opacity on dark chat surfaces, and the PR documents the resulting composite contrast failure.

Is this the best way to solve the issue?

Yes. Removing opacity only from the failing selectors preserves the shared muted-token hierarchy while repairing the demonstrated rendered-text failure; it is narrower than globally brightening the token as the closed related PR proposed.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b82d8e56b643.

Labels

Label justifications:

  • P2: This is a bounded Webchat accessibility/readability repair with a limited but user-visible dark-theme impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Redacted after-fix Control UI screenshots directly show the timestamp and slash-menu argument surfaces in dark mode, alongside reported computed full-opacity styles; no private data is visible in the described artifacts.
  • proof: sufficient: Contributor real behavior proof is sufficient. Redacted after-fix Control UI screenshots directly show the timestamp and slash-menu argument surfaces in dark mode, alongside reported computed full-opacity styles; no private data is visible in the described artifacts.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Redacted after-fix Control UI screenshots directly show the timestamp and slash-menu argument surfaces in dark mode, alongside reported computed full-opacity styles; no private data is visible in the described artifacts.

Evidence

What I checked:

  • Targeted selector repair: The proposed patch removes opacity: 0.7 from the grouped-message timestamp and opacity: 0.65 from slash-menu arguments while retaining the existing var(--muted) token, avoiding the previously rejected global token-brightening approach. (ui/src/styles/chat/grouped.css:261, 39469f097430)
  • Regression coverage: The branch adds theme-contrast.test.ts to calculate token contrast, composite opacity colors, and assert the affected dark-theme pairings and selector rules. (ui/src/styles/theme-contrast.test.ts:1, 39469f097430)
  • Real UI proof: The PR body and follow-up comment provide redacted dark-theme Control UI screenshots showing both affected surfaces after the fix, with reported computed styles of full-opacity rgb(139, 139, 148). (39469f097430)
  • Current PR validation: The supplied check summary reports successful UI, type, lint, build, security, and real-behavior-proof checks for the current head. (39469f097430)
  • Related issue ownership: The PR explicitly targets the still-open Webchat dark-theme contrast report and addresses its concrete timestamp and slash-argument failure path rather than changing every muted token consumer. (ui/src/styles/base.css:20, 39469f097430)

Likely related people:

  • stantheman0128: Authored the current PR commits that modify the two Webchat selectors and add their contrast regression test; no independent current-main ownership trail was available in the supplied material. (role: recent contributor to the exact CSS and regression-test surface; confidence: low; commits: 593393ca70e0, 384abb2902da, cf6b5a365b56; files: ui/src/styles/chat/grouped.css, ui/src/styles/chat/layout.css, ui/src/styles/theme-contrast.test.ts)

Rank-up moves

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

  • Confirm the clean merge result against current main before landing.

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.

History

Review history (6 earlier review cycles)
  • reviewed 2026-07-17T21:59:30.979Z sha 464dc220f5b405c2177a3eac83173d25cdebd04f :: needs real behavior proof before merge. :: [P2] Make luminance channels statically defined
  • reviewed 2026-07-19T11:47:00.724Z sha 8a3c09633cf8f503abe6b30eb71321ca10470b47 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-19T12:51:54.967Z sha 8a3c09633cf8f503abe6b30eb71321ca10470b47 :: needs changes before merge. :: [P3] Shorten the base-theme explanatory comment
  • reviewed 2026-07-19T14:03:25.709Z sha d0657a31c2572ef7937c8f2214c1e8c993b1b853 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T14:45:45.058Z sha d0657a31c2572ef7937c8f2214c1e8c993b1b853 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T15:28:40.437Z sha d0657a31c2572ef7937c8f2214c1e8c993b1b853 :: needs maintainer review before merge. :: none

@stantheman0128

Copy link
Copy Markdown
Contributor Author

Thanks for the CI catch.

Pushed 8a3c09633c on the same branch: theme-contrast.test.ts now narrows regex/array matches before use so strict test types are happy (requireCssColor helper, explicit undefined checks).

Local verify:

pnpm tsgo:test:ui
# exit 0

pnpm exec vitest run --config vitest.config.ts src/styles/theme-contrast.test.ts
# Test Files  1 passed (1)
# Tests  2 passed (2)

Note: checks-node-compact-small-11 looked unrelated (flaky src/cron/command-runner.test.ts timeout / missing child.pid). Happy to re-check once CI re-runs.

@stantheman0128

Copy link
Copy Markdown
Contributor Author

CI fix landed in 8a3c09633c: theme-contrast.test.ts now guards luminance channels and CSS var lookups so pnpm check:test-types passes. Local vitest + check:test-types both green.

Dark-theme Control UI screenshot is still blocked in this environment (no local Control UI session for a redacted after-fix capture).

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 19, 2026
@stantheman0128

Copy link
Copy Markdown
Contributor Author

Dark-theme Control UI proof for the muted contrast fix.

Redacted after-fix screenshot (mock gateway Control UI e2e on this branch; no private paths or tokens):

Dark theme timestamp and slash-menu args

Computed styles in that capture:

  • theme: dark; --muted #8b8b94 on --bg #0e1015
  • .chat-group-timestamp: opacity 1, color rgb(139, 139, 148), label 2m ago
  • .slash-menu-args: opacity 1, color rgb(139, 139, 148), text <message>

PR Evidence section updated with the same artifact.
Release: https://github.com/stantheman0128/openclaw/releases/tag/pr-110195-wcag-proof

@clawsweeper re-review

@stantheman0128

Copy link
Copy Markdown
Contributor Author

Updated dark-theme Control UI proof (clearer crops).

Combined frame (timestamp 2m ago + slash-menu <message> args):

Both surfaces

Timestamp crop:

Timestamp

Slash-menu args crop:

Slash menu

Computed styles (data-theme-mode=dark, --muted #8b8b94):

  • .chat-group-timestamp: opacity 1, color rgb(139, 139, 148), text 2m ago
  • .slash-menu-args: opacity 1, color rgb(139, 139, 148), text <message>

Note: the message footer is hover-gated in normal UI; the combined frame forces that footer visible so both surfaces can appear in one shot. Measured selector colors/opacities are the real after-fix rules.

PR Evidence section updated. Release: https://github.com/stantheman0128/openclaw/releases/tag/pr-110195-wcag-proof

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 19, 2026
@stantheman0128
stantheman0128 force-pushed the fix/107299-webchat-muted-wcag branch from 8a3c096 to d0657a3 Compare July 19, 2026 13:59
@stantheman0128

Copy link
Copy Markdown
Contributor Author

Addressed the ClawSweeper follow-ups on d0657a31c2:

  1. Condensed the dark-theme --muted rationale in ui/src/styles/base.css to two short lines, keeping the no-opacity-dimming invariant.
  2. Rebased onto current origin/main (5ae1f7f0f5) and force-pushed this same branch.

Local checks after rebase:

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/styles/theme-contrast.test.ts
# Test Files  1 passed (1)
# Tests  2 passed (2)

pnpm tsgo:test:ui
# exit 0

Existing screenshot proof still applies; no new capture needed for this cleanup.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 19, 2026
@stantheman0128
stantheman0128 force-pushed the fix/107299-webchat-muted-wcag branch 4 times, most recently from 7c159e2 to 1d79e67 Compare July 23, 2026 09:47
@stantheman0128
stantheman0128 force-pushed the fix/107299-webchat-muted-wcag branch 3 times, most recently from 4a9aba6 to 5fe59e3 Compare July 23, 2026 11:11
stantheman0128 and others added 3 commits July 23, 2026 19:52
Dark theme --muted tokens already meet AA, but chat timestamps and
slash-arg hints applied opacity that composited below 4.5:1. Drop the
opacity dimming and add a token/composited contrast regression test.

Co-authored-by: Cursor <[email protected]>
Shorten the dark-theme --muted WCAG rationale to the repo inline-comment style while keeping the no-opacity-dimming invariant.

Co-authored-by: Cursor <[email protected]>
@stantheman0128
stantheman0128 force-pushed the fix/107299-webchat-muted-wcag branch from 5fe59e3 to cf6b5a3 Compare July 23, 2026 11:52
@stantheman0128

Copy link
Copy Markdown
Contributor Author

Quick status check: this PR is still open (not merged yet). Thanks @steipete for merging main into the branch today (803996f0) — that should help the final landing.

ClawSweeper still shows ready for maintainer look; all checks green on the latest run. Happy to rebase again on request.

Stan Shih (@stantheman0128)

@steipete
steipete merged commit 0a2ca5d into openclaw:main Jul 29, 2026
97 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
openclaw#110195)

* fix(ui): restore WCAG AA contrast for muted webchat text

Dark theme --muted tokens already meet AA, but chat timestamps and
slash-arg hints applied opacity that composited below 4.5:1. Drop the
opacity dimming and add a token/composited contrast regression test.

Co-authored-by: Cursor <[email protected]>

* fix(ui): narrow theme contrast test types for strict TS

Co-authored-by: Cursor <[email protected]>

* fix(ui): condense muted contrast comment

Shorten the dark-theme --muted WCAG rationale to the repo inline-comment style while keeping the no-opacity-dimming invariant.

Co-authored-by: Cursor <[email protected]>

* ci: retrigger after unrelated tui-backend.test timeout

Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
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 P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

[Bug]: Webchat dark theme secondary text (--muted) fails WCAG AA contrast (3.1-3.5:1) — readability regression, no contrast guardrail

2 participants