Repository navigation
fix(web): keep red text readable with high contrast on - #4852
Conversation
High contrast lightens panels and rows toward white but left the red --destructive token alone, so red status text on a panel fell to 3.5-3.8:1. Move the theme literal to --destructive-base and, in high contrast only, mix --destructive 65% toward --contrast-boost so it keeps 4.5:1 on the lightest surface (--surface-raised, 4.77:1). Solid fills under white text already use --destructive-fill and are unchanged. Red's 10% tint now derives from the lightened red, so the high-contrast --destructive-label is that same red (4.75:1 on its tint over a hovered row). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 5 minutes. View limit details
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
With high contrast on, the lightened red of the failed segment sits within 1.3:1 of the near-white encoding segment, so the two run together when they are adjacent. Put a small gap between segments, as the storage meter on the same page already does, so each boundary shows whatever the colours or the admin accent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.2-sol, reviewed f7a2985)
Score: 8/10. One finding.
S1 (low): the Downloads preparation state bar loses a segment boundary in high contrast.
- Trigger: high contrast on, default accent, and both Encoding and Failed jobs present.
web/src/pages/admin-downloads/PreparationTab.tsxdraws the state bar as touching segments, andfailedusesbg-destructive. - Impact: the lightened red sits next to the near-white Encoding segment at 1.31:1 (3.08:1 before this change), so the two segments run together and the bar's proportions are hard to read at a glance. The legend still shows the counts.
- Evidence: reproduced in Chromium with the pinned stylesheet and the chart's classes.
- Repair: add a contrasting separator or gap between segments so each boundary shows whatever the colours or accent.
The new test fails on main and with a 50% mix, all seven focused tests pass, and plain red text measures 4.78:1 on the raised surface.
Posted by the implementing run on the reviewer's behalf, because the reviewer's tool couldn't attach the commit. Resolution: fixed in da69f09, which puts a gap between the bar's segments, as the storage meter on the same page already does.
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.2-sol, reviewed da69f09)
Score: 9/10. S1 is resolved: the 2px gap shows the panel between every adjacent pair whatever the accent, the rounded ends clip only the outside of the bar, and the flex items shrink to absorb the gaps without overflowing.
S2 (low): the storage meter's two threshold ticks are harder to tell apart in high contrast.
- Trigger: a filesystem that shares scratch space, with the cleanup ceiling set to 94%. The cleanup tick (
bg-warning) and the scratch tick (bg-destructive) inweb/src/pages/admin-downloads/StorageTab.tsxare identical 2px lines at 94% and 95%, so they touch on a narrow meter. - Impact: their computed lightness contrast drops from 2.00:1 to 1.18:1 with high contrast on, so it is harder to see where cleanup starts and playback admission stops.
- Repair: give the ticks distinct shapes or put them on opposite edges of the meter, with matching symbols in the legend.
Posted by the implementing run on the reviewer's behalf. Resolution: not changed in this PR. The two ticks were already below 3:1 from each other before it (2.00:1). Hue, not lightness, tells them apart in both versions (yellow against red before, yellow against pink now), and the legend under the meter names each tick. Overlapping thresholds are a property of the meter's design rather than of this colour change.
…tructive-text # Conflicts: # web/docs/design-system.md
Problem
Closes #4856
Related issue: N/A
Validation tasks: none
Other clients: Apple N/A (web stylesheet token; apps have their own palettes); Android N/A (same); Roku N/A (same)
With high contrast on, the web app lightens panels, rows and raised surfaces toward white but left the red
--destructivecolour as it was. Red status text drawn directly on those surfaces drops below the 4.5:1 WCAG AA minimum, while the same text passes with high contrast off. On the admin Devices page, the red anomaly count in the stats strip measures 3.80:1 and the red "Anomaly" status in the device readout 3.50:1. About 240text-destructiveuses sit on these surfaces, so this affects the whole app, not one page.Approach
High contrast now lightens
--destructiveitself, the same way it already lightens the surface, border and muted-text tokens. The theme's literal moves to--destructive-base, and the high-contrast block mixes--destructive65% toward--contrast-boost. That keeps red text at 4.5:1 on the lightest surface high contrast produces (--surface-raised, 4.77:1). Red text does sit on that surface, for example in a dragged collection row.Solid red backgrounds under white text (destructive buttons and badges) already use
--destructive-fill, which doesn't change. The remainingbg-destructiveuses are small dots and bars. They get lighter too, and that helps them: base red reaches only 2.0 to 2.5:1 against the lightened hover and raised surfaces, below the 3:1 minimum for graphics, and the lighter red reaches 4.8 to 5.9:1. The red 10% tints behind small labels now come from the lighter red, so the high-contrast--destructive-labelbecomes that same red (4.75:1 on its tint over a hovered row). Without that change it would fall to about 4.4:1.A rule targeting
.text-destructive, like the existing high-contrast rule for.text-muted-foreground, would leave the tints alone. It would misshover:text-destructive(31 uses), the opacity variants, and red icons and borders, though.The Downloads preparation state bar drew its segments touching, so with high contrast on the lighter red "failed" segment ran into the near-white "encoding" one (1.31:1 between them). The bar now leaves a small gap between segments, as the storage meter on the same page already does, so each boundary shows whatever the colours or admin accent. That gap is the one change visible with high contrast off. Nothing else changes there.
Validation
highContrastContrast.test.tschecks high-contrast red against high-contrast--surface-raised. It fails on main and also fails when the mix drops to 50%.make test-web(3095 tests), local-path and size-ratchet checks all pass.Evidence
Before and after captures of the admin Devices page at phone, tablet and desktop widths with high contrast on, plus desktop with high contrast off, the per-element contrast measurements, and the Downloads preparation state bar before and after the segment gap.
Evidence: https://evidence.siloserver.org/r/silo-server/hc-destructive-text/
Risks
With high contrast on, red reads as a lighter, pinker red, including status dots. Each dot checked has a text label beside it. Success, warning and info text have the same problem on lightened surfaces. That is tracked in #4851 and not changed here.
Checklist
Council review
This ran as a follow-up run: one reviewer per round.
Rounds: 2, last reviewed da69f09
Visual review: 1 round, captures from this change's token values
Fixed: the preparation state bar's red and near-white segments ran together in high contrast (Sol S1, da69f09). Answered: the storage meter's cleanup and scratch ticks are harder to tell apart by lightness in high contrast when set a point apart (Sol S2). They were already under 3:1 from each other, hue still separates them, and the legend names each. The visual review's findings were all outside this change. The red-tint badges at default contrast belong to #4845, and the device row's dot, the faint
DEFAULTbadge and the clipped phone search placeholder looked the same before the fix.AI Disclosure
web/docs/design-system.md. It also raised the dot colour change, which is answered under Approach. A simplify pass trimmed duplicate comments. For the visual and background reviews, see Council review above.🤖 Generated with Claude Code
Note
Fix unreadable red destructive text in high-contrast mode
--destructivenow derives from a new--destructive-basetoken and, in high-contrast mode, mixes 65% toward--contrast-boost.--destructive-labeluses that same lightened value.--destructive-baseto#ef4444; its destructive foreground and fill colors are unchanged.AA_TEXTagainst the raised surface.gap-0.5between state segments in the admin downloads preparation summary bar.Macroscope summarized d76f415.