Repository navigation
fix(ui): keep warn text readable on warn tints in light palettes - #20184
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 168a915 Description read[DESCRIPTION-READ] 4bc2398828956fc9def2375a19c3cadc0578ad28ca3b4f114b327600c3cd3bb2 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Check by eye that the three hover-only controls (connections tip, auto-nudge, PR auto-merge) still read as warnings when hovered in a light theme. [UX-REVIEWED] 168a915 Description read[DESCRIPTION-READ] 562b71a503e0e6577590ff00e03d0e94ec7ecb90f37271e6740c27efbf3ae7e7 That sha256 names everything this verdict read: the PR description, plus the 11 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check that the queued-message card and the memory-mode chip still look right in light mode: their glass text now mixes toward black at 50%, where it used to mix toward What this change shipsInventory (7 items) — 7 justifiedIntent: make warn-coloured text on warn-tinted chips, pills and notices readable in every light theme. This is a FIX (closes #20071).
[FIRST-PRINCIPLES-REVIEWED] 168a915 Description read[DESCRIPTION-READ] 8eede5246201349cae10b4c338ca6a03b9abc9789ecd073332dcc86abe8dfe47 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
95df4ed to
7f83446
Compare
7f83446 to
1095f4e
Compare
|
|
|
In light palettes, `text-warn` on a `bg-warn-subtle` or `bg-warn/N` fill sat below the 4.5:1 text floor (1.9:1 in rosepine-light, 4.2:1 in `light`). #20056 fixed the same hue on `glass-warn` panes only. One token now carries both. `--warn-text` is `--warn` in dark palettes and, under `[data-mode="light"]`, half the hue darkened toward black, so it stays amber-brown and still reads as a warning. The share is set by the strongest tint the source pairs it with (`bg-warn/30`): 50% clears it at 5.4:1 in the worst light palette, 60% would drop it to 4.2:1. The `text-warn-text` utility paints it on the lines that put plain `text-warn` on a warn tint; `.glass-warn-fg` reads the same token. Controls whose tint only appears on hover keep plain `text-warn` at rest and take `hover:text-warn-text`. glassWarnTextContrast.test.ts reads the share from index.css, measures the token against every tint the source pairs with it in every light palette, pins dark palettes to plain `--warn`, and refuses a source line that still puts plain `text-warn` on a warn tint or a `glass-warn` pane. Closes #20071
1095f4e to
168a915
Compare
|
|
iamwhatever
left a comment
There was a problem hiding this comment.
APPROVE at 168a915.
One derived token, --warn-text, fixes warn text on warn tints in light palettes. It is plain --warn by default and 50% toward black under [data-mode="light"] (index.css#L676-L677). It is bridged as text-warn-text, and .glass-warn-fg reuses it (#L3611). Dark palettes are unchanged. The renames are mechanical, and the extended contrast test both measures every paired tint in all 18 light palettes and refuses new plain text-warn on a tint. The UX and First Principles punchlines have current-head answers, and the ok/danger follow-up is tracked in #20201 (deferred-finding, assigned, due date). All checks on this head are green, and the branch merges cleanly into current main. No tests were run locally.
— crew-pr-reviewer (r100)
Problem / Motivation
Goal: Warn-coloured text on a warn-tinted chip, pill or notice is readable in every light theme.
In a light theme,
text-warnon abg-warn-subtleorbg-warn/Nfill reads as gold on pale yellow: 1.9:1 in rosepine-light, 2.1:1 in catppuccin-light, 4.2:1 in the defaultlightpalette, all under the 4.5:1 WCAG text floor. 64 source lines pair the two. #20056 fixed the same hue onglass-warnpanes only.Why it matters
Status pills ("running", "needs update", "fails validation"), warning notices and filter chips are where the dashboard tells the user something needs attention. In a light theme they are the hardest text on the page to read.
Not a goal
--warn, and a test pins that.bg-warn-subtle,bg-warn/N): fills and borders do not change.bg-warnbuttons withtext-warn-fg: already black-or-white on the hue.What changed (motivation → approach → change)
Plain
--warnis a mid-yellow in every light palette, and the fills are that same yellow at 10-30% over a near-white surface, so the text and its background share a hue and a brightness.One token now carries the fix for the glass and the fills alike.
--warn-textis--warnin dark palettes and, under[data-mode="light"], half the hue darkened toward black: it stays amber-brown, so it still reads as a warning. The share is set by the strongest tint the source pairs it with (bg-warn/30, the VectorMemoryCard filter pill): 50% clears it at 5.4:1 in the worst light palette, 60% would drop it to 4.2:1. Like--shadow-float, the token lives outside the[data-theme]blocks so a pack cannot set it.tailwind-theme.cssbridges it astext-warn-text; the 61 lines that put plaintext-warnon a warn tint paint that utility, a mechanical rename acrosswebsite/src/components,website/src/pages,website/src/appsandwebsite/src/app-sdk, and.glass-warn-fgreads the same token, so #20056's rule is now an alias. Three controls with no tint at rest (the connections prerequisite tip, the auto-nudge button, the PR auto-merge button) keep plaintext-warnand takehover:text-warn-textwith their hover tint. The artifact sync notice's button sits inside the tinted notice, so it takes the darker text at rest like its notice.--warnon warn-subtlebg-warn/30)Backwards compatibility
Compatible: a new token and a new utility;
text-warn,--warnand every fill keep their values, and.glass-warn-fgpaints the same colour family it did.Removes nothing: the diff adds a token and renames class strings; no path, record, key or function goes away.
Tests
website/src/test/glassWarnTextContrast.test.ts(extended from #20056):index.cssand measures--warn-textagainst every warn tint the source pairs withtext-warn-text(-subtle,/10,/15,/30), over--bg,--bg-elevatedand--card, in all 18 light palettes: every pairing is at least 5.4:1;glass-warntint keeps its own 4.5:1 check;--warn-texttovar(--warn)and no[data-mode="dark"]rule sets it;text-warnwithbg-warn-subtle,bg-warn/Norglass-warnfails the test; a tint that only appears underhover:must come withhover:text-warn-text.Mutation checks run locally: a 60% share fails on amoled-light
bg-warn/30(4.20:1); reverting one site totext-warnis named by the scan.KiroPrerequisiteGate.test.tsxand theCrewLogPanelsnapshot follow the class rename. Determinism: the suite reads files and does arithmetic, no timers or network; the three touched test files ran 3 times (252 tests each, green), and the 37 test files that nametext-warnran once plain and once under--sequence.shuffle(1510 tests, green both times); after the share change the 41 related files ran green again (1529 tests).Manual verification
website/scripts/capture-warn-text-contrast.mjsrenders the built stylesheet on the chip, pill and notice shapes in rosepine-light, everforest-light, light and dark, before and after (below).Screenshots / video
rosepine-light, before (gold on pale yellow) and after:
everforest-light, light and dark (the control)
Related Issues
Closes #20071
Pattern harvest
Rule candidate: review-prompt
Pattern: a status hue used as text on its own tinted fill, with no light-mode variant of the text token
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)