Repository navigation
feat(web): raise UI contrast for text and borders - #788
Conversation
There was a problem hiding this comment.
Important
The sweep works, but the tier it puts almost every secondary label on lands at 4.0:1 in light mode, below the 4.5:1 WCAG AA bar this PR sets for itself. That is the one thing worth settling before merge.
Approach: sound — raising the base tokens and applying an opacity floor fixes the cause (components layering alpha over an already-passable token) instead of repainting surfaces one by one, and the mapping is consistent.
Reviewed changes — I audited 8584f52 line by line: apart from the token values, the Gantt test selector and the data-gantt-group attribute, every changed line is an opacity substitution matching the mapping in the description.
- Tokens —
--muted-foreground#737373→#5f5f5f (light) and #888→#a0a0a0 (dark);--border/--inputand--sidebar-borderraised in both themes. - Text sweep —
text-muted-foreground/30–/60→/80and/70–/90→ full strength across 114 files; 251 sites now use/80. - Border sweep —
border-/divide-/ring-/bg-border/10–/35→/50,/40→/60; the Gantt gridline moved from/12to/30. - Test stability — the Gantt group lookup in
gantt-view.test.tsxnow uses[data-gantt-group]instead of a border class.
Note that the diff also carries the three stacked PRs (#785, #786, #787); this review is scoped to 8584f52, and those commits are covered in their own reviews.
⚠️ The main tier is 4.0:1, below the AA threshold the PR states
The PR table sets WCAG AA at 4.5:1, then maps the 251 swept text sites to /80, which composites #5f5f5f at 80% over white to #7f7f7f — 4.00:1. It is a big improvement over the old 2.3:1, but the primary claim of the PR ("secondary text was faded past readability") is only partly met on light surfaces, and it is worse on bg-muted panels (~3.7:1). Either the floor or the token has to move for the PR to deliver what it says.
Technical details
# Light-theme secondary text lands at 4.0:1
## Affected sites
- `apps/web/src/index.css:61` — `--muted-foreground: #5f5f5f`
- all 251 `text-muted-foreground/80` uses produced by the sweep, e.g. `apps/web/src/components/projects/interactions/task-row.tsx:552` and `apps/web/src/routes/_authenticated/projects/$projectId/activity/index.tsx:284`
- contrast math assumes the default `--background: #ffffff`; on `--muted: #f5f5f5` the same pair is ~3.7:1
## Required outcome
- The dominant text tier clears 4.5:1 on white in light mode, or the PR drops the AA framing and states the floor it is actually targeting.
- Dark mode already passes (5.15:1) and needs no change.
## Suggested approach
- Cheapest: map `/30–/60` to `/90` instead of `/80` — 5.02:1 light, 6.28:1 dark, and still a distinct tier below full-strength muted text.
- Alternative: darken `--muted-foreground` to about `#555555`, which makes `/80` composite to ~4.5:1; re-check the full-strength tier and dark mode afterward.
- `/85` is not enough (4.48:1), so the floor needs to be `/90` or the token needs the change.
## Open questions
- Is the light-mode tier intentionally allowed under AA for hierarchy, or is 4.5:1 the real target?ℹ️ Sidebar secondary text keeps its old fade
app-sidebar.tsx was not part of the contrast commit, so its own token (text-sidebar-foreground) still carries /30–/50 opacities, including real labels — the untitled-doc fallback, "empty folder", the "Add" label, "no documents yet", and the theme label. At --sidebar-foreground: #111111 on white, /40 composites to ~2.6:1 and /30 to ~2.0:1, so the sidebar still shows the readability problem this PR fixes elsewhere. No action may be needed if it is deliberately deferred, but it is the most visible surface left out and worth a line in the description either way.
Technical details
# `text-sidebar-foreground` opacities were not swept
## Affected sites
- `apps/web/src/components/app-shell/app-sidebar.tsx:491`, `:887`, `:896`, `:1100`, `:2153` — user-visible text at `/30–/50`
- same file, icon/chevron sites at `/30–/40`: `:355`, `:471`, `:512`, `:746`, `:751`, `:753`, `:780`, `:1089`, `:1148`, `:1492`, `:1591`, `:1900`, `:2000`, `:2068`
- `--sidebar-foreground` is `#111111` (light) on `#ffffff`, so `/40` ≈ 2.6:1 and `/30` ≈ 2.0:1
## Required outcome
- Either apply the same opacity floor to the sidebar token in this sweep, or note that the sidebar is out of scope so the omission is not read as an oversight.
## Open questions
- Was `text-sidebar-foreground` intentionally excluded because the sidebar has its own token and palette?deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
|
Thanks for the review. Both points are addressed in 62e703e:
The description is updated with the per-surface table. Lint, build and tests pass, apart from 🤖 Generated with Claude Code |
There was a problem hiding this comment.
✅ No new issues found.
Approach: unchanged and still the right one — the follow-up moves the opacity floor rather than repainting components one by one, and the new floor clears AA on light surfaces.
Reviewed changes — reviewed the single follow-up commit since the prior pullfrog review (8584f52): the WCAG AA fix and the sidebar sweep.
- Raised the text floor to
/90— all 251 swepttext-muted-foregroundsites now composite to 5.02:1 on white and ~4.7:1 on--mutedin light mode (was 4.00:1 at/80), with dark mode at 6.28:1, so the dominant tier finally meets the 4.5:1 bar the PR states. - Swept the sidebar —
app-sidebar.tsx'stext-sidebar-foreground/30–/50moved to/60across 18 lines, covering the user-visible labels (untitled-doc fallback, empty folder, "Add", "no documents yet", theme label) at ~4.95:1 light / ~6.4:1 dark; no sidebar text below/60remains. - Updated the description — the token and opacity tables now match the code (two tiers:
/90and full strength).
The delta is opacity-only: a normalized diff of 8584f52..HEAD shows exactly the 251 /80→/90 substitutions plus the 18 sidebar lines, with no other edits and no duplicate attributes.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
pikann
left a comment
There was a problem hiding this comment.
LGTM! Thank you so much for your contribution. Please help resolve the merge conflicts when you have a moment so I can merge this PR.
Secondary text and hairlines were faded well past readability. The base tokens were fine on their own (muted text 4.7:1 on white), but components layered heavy opacity on top: ~380 uses of muted text at /30-/60 rendered at roughly 1.5-2.3:1, and borders at /10-/30 were close to invisible (1.04-1.12:1). Tokens (index.css): - --muted-foreground: #737373 -> #5f5f5f (light, 6.4:1), #888888 -> #a0a0a0 (dark, 7.6:1) - --border/--input: #d4d4d4 -> #c8c8c8 (light), #2a2a2a -> #3a3a3a (dark) - --sidebar-border: #e8e8e8 -> #dedede (light), #1e1e1e -> #2a2a2a (dark) Opacity floors across components (mechanical sweep): - text-muted-foreground /30-/60 -> /90 (>= 4.5:1 on background, muted and secondary surfaces in both themes; /85 would still fail at 4.48:1), /70-/90 -> full strength, so two tiers remain - text-sidebar-foreground /30-/50 -> /60 (4.94:1 light, 6.53:1 dark); the sidebar has its own foreground token - border/divide/ring/bg-border /10-/35 -> /50, /40 -> /60; Gantt gridlines /12 -> /30 so they stay lighter than row dividers. The dashed row dividers from Paca-AI#785 are left as tuned. The Gantt drag tests located groups by a border class; they now use a `data-gantt-group` attribute so styling changes don't break them. Rebuilt on current master (after Paca-AI#784, Paca-AI#785-Paca-AI#787, Paca-AI#789) so the new file-management components get the same treatment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
62e703e to
7fa2d26
Compare
|
Rebased onto current Instead of hand-merging the conflicts with #784 (file management), I re-applied the contrast rules to the new
🤖 Generated with Claude Code |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — reviewed the single rebased commit since the prior pullfrog review (62e703e): the contrast sweep re-applied onto current master, including the file-management surfaces that landed since.
- Rebased to one commit — a normalized diff against
masterleaves only opacity substitutions, the six token values inindex.css, the Gantt test selector, thedata-gantt-groupattribute and onecn()reformat inui/trace.tsx; no master changes were overwritten by the re-application. - Swept the new file-management components —
files-sidebar-section.tsx(sidebar-foreground/40 → /60) andblocknote-file-panel.tsx(border-border/40 → /60) both follow the stated mapping, and notext-muted-foregroundopacity below/90ortext-sidebar-foregroundbelow/60remains anywhere inapps/web/src. - Dropped already-merged changes —
gantt-nesting.test.tsxand the Gantt docs are now inmaster, so they no longer appear in the PR; the Gantt group lookup still resolves through[data-gantt-group], which wraps the group header.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Summary
Secondary text and hairlines across the app are faded past readability. The base tokens are fine on their own (muted text is 4.7:1 on white), but components add heavy opacity on top:
text-muted-foreground/60text-muted-foreground/50text-muted-foreground/40border-border/20WCAG AA asks for 4.5:1 for text.
Tokens (
index.css)--muted-foreground--border/--input--sidebar-borderOpacity floors (mechanical sweep, 115 files)
text-muted-foreground/30–/60→/90;/70–/90→ full strength. Two tiers of secondary text remain, and both meet AA on every surface:text-muted-foreground/90, light/90, dark(
/85would still fail at 4.48:1 on white, so the floor is/90.)text-sidebar-foreground/30–/50→/60(4.94:1 light, 6.53:1 dark). The sidebar uses its own foreground token;/60and above already passed.border-/divide-/ring-/bg-border/10–/35→/50, and/40→/60. Gantt gridlines/12→/30, so they stay lighter than the row dividers.text-foreground/*and decorative dashed outlines are untouched.The Gantt drag tests found groups by a border class. They now use a
data-gantt-groupattribute, so later styling changes won't break them.Type of Change
Checklist
data-attribute differs only in an opacity value.Testing
bun run lint,bun run buildand the fullbun run testpass, exceptGitSettings.test.tsx › shows the platform's reason on error…, which also fails locally on unmodifiedmaster(it's timing-sensitive).🤖 Generated with Claude Code