Skip to content

feat(web): raise UI contrast for text and borders - #788

Merged
pikann merged 1 commit into
Paca-AI:masterfrom
robertcoroianu:feat/ui-contrast
Nov 19, 2026
Merged

pikann merged 1 commit into
Paca-AI:masterfrom
robertcoroianu:feat/ui-contrast

Conversation

@robertcoroianu

@robertcoroianu robertcoroianu commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Rebased onto current master (after #784, #785–#787 and #789), so this is now a single commit. The sweep was re-applied by rule rather than by hand-merging conflicts, so the new file-management components get the same treatment.

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:

Light Dark Uses
text-muted-foreground/60 2.3:1 2.7:1 84
text-muted-foreground/50 2.0:1 2.2:1 100
text-muted-foreground/40 1.7:1 1.8:1 47
border-border/20 1.08:1 1.04:1 29

WCAG AA asks for 4.5:1 for text.

Tokens (index.css)

Token Light Dark
--muted-foreground #737373 → #5f5f5f (6.4:1) #888 → #a0a0a0 (7.6:1)
--border / --input #d4d4d4 → #c8c8c8 #2a2a2a → #3a3a3a
--sidebar-border #e8e8e8 → #dedede #1e1e1e → #2a2a2a

Opacity 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 background muted secondary
    /90, light 5.02:1 4.68:1 4.51:1
    full, light 6.39:1 5.86:1 5.60:1
    /90, dark 6.28:1 5.64:1 5.43:1
    full, dark 7.57:1 6.66:1 6.38:1

    (/85 would 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; /60 and 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-group attribute, so later styling changes won't break them.

Type of Change

  • Other (UI / accessibility)

Checklist

  • The change is focused and scoped: contrast only. Every changed line apart from the tokens, the test selector and the data- attribute differs only in an opacity value.
  • Related documentation is updated: n/a.
  • New structure or direction is explained clearly: contrast numbers above.
  • I avoided unnecessary detail or premature abstraction.

Testing

  • bun run lint, bun run build and the full bun run test pass, except GitSettings.test.tsx › shows the platform's reason on error…, which also fails locally on unmodified master (it's timing-sensitive).
  • Checked manually in the dev stack.

🤖 Generated with Claude Code

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/--input and --sidebar-border raised in both themes.
  • Text sweep — text-muted-foreground/30–/60 → /80 and /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 /12 to /30.
  • Test stability — the Gantt group lookup in gantt-view.test.tsx now 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?

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@robertcoroianu

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Both points are addressed in 62e703e:

  • AA tier: moved the swept tier from /80 to /90 (251 sites). It is now ≥4.5:1 on every surface in both themes: 5.02 / 4.68 / 4.51 on background / muted / secondary in light mode, and 5.4–6.3 in dark. /85 would still fail (4.48:1), and darkening the token to #555 would have pushed full-strength muted text close to the foreground color and flattened the hierarchy, so I raised the floor instead.
  • Sidebar: in scope, not deferred. text-sidebar-foreground /30–/50 → /60 (20 sites in app-sidebar.tsx and ui/sidebar.tsx): 4.94:1 light, 6.53:1 dark. Values of /60 and above already passed.

The description is updated with the per-surface table. Lint, build and tests pass, apart from GitSettings.test.tsx, which also fails on master.

🤖 Generated with Claude Code

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 swept text-muted-foreground sites now composite to 5.02:1 on white and ~4.7:1 on --muted in 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's text-sidebar-foreground/30–/50 moved to /60 across 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 /60 remains.
  • Updated the description — the token and opacity tables now match the code (two tiers: /90 and 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.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pikann pikann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@robertcoroianu

Copy link
Copy Markdown
Contributor Author

Rebased onto current master to resolve the conflicts (now one commit, 7fa2d26).

Instead of hand-merging the conflicts with #784 (file management), I re-applied the contrast rules to the new master, including the /90 and sidebar follow-up from the review. I then checked the result:

  • Every file that master didn't touch is identical to the version reviewed here.
  • Apart from the tokens, the Gantt test hook and one Biome reformat, every changed line differs only in an opacity value.
  • New in this version: files-sidebar-section.tsx and blocknote-file-panel.tsx from feat: implement drive-style file management and related features #784 now follow the same floors.

bun run lint, bun run build and the full bun run test pass (1762/1762).

🤖 Generated with Claude Code

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 master leaves only opacity substitutions, the six token values in index.css, the Gantt test selector, the data-gantt-group attribute and one cn() reformat in ui/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) and blocknote-file-panel.tsx (border-border/40 → /60) both follow the stated mapping, and no text-muted-foreground opacity below /90 or text-sidebar-foreground below /60 remains anywhere in apps/web/src.
  • Dropped already-merged changes — gantt-nesting.test.tsx and the Gantt docs are now in master, so they no longer appear in the PR; the Gantt group lookup still resolves through [data-gantt-group], which wraps the group header.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pikann
pikann merged commit 753e684 into Paca-AI:master Nov 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants