Skip to content

fix(ui): design revision — highlight contrast, ActionRow captions, list rows, filter behaviour - #175

Merged
Ardnived merged 4 commits into
mainfrom
feat/design-tokens-retune
Aug 28, 2026
Merged

Ardnived merged 4 commits into
mainfrom
feat/design-tokens-retune

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

First of three PRs from a designer's revision pass. Stacked: #2 (typeface) is based on this branch, #3 (icons) on that.

Four independent items, one commit each.

001 · Highlight retune

The highlighted (active-filter) state painted body text on a tinted surface at 3.09:1 in the light theme — under the 4.5:1 WCAG AA floor, with a highlighted ToggleGroup's day letters the worst case.

before after
tinted surface bg-primary-3 bg-primary-2
label on it text-primary-11 text-primary-12
hover hover:bg-primary-4 hover:bg-primary-3
switch / slider track bg-primary-6 bg-primary-5

Measured: 3.09 → 7.30 light, 7.57 → 12.36 dark. Expressed in ramp steps, not colours, so it holds for every tenant — the brand ramps are generated at runtime from a fixed lightness ladder and only hue/saturation come from the client's seed.

Borders and the selected data-[state=on] fills are untouched. So is bg-primary-3 wherever it is the flat variant of Button/Chip/Alert or the list row's press state — same step, different role. Verified in the browser that Button flat and Chip did not move.

⚠ The brief listed ten atoms taking highlight; there are eight. There is no Switch atom (it is an appearance on Checkbox) and no Radio atom (only RadioGroup).

004 · ActionRow captions follow the colour prop

The caption was pinned to text-primary-12 dark:text-primary-11 in the slot recipe while the circle beside it took its role from controlSurface — so every non-primary circle wore a primary word. All sixteen cells of the story's colour × variant matrix rendered primary captions; they now resolve to four distinct colours, one per row.

color defaults to primary, so every existing call site is unmoved.

005 · List row counter and chevron

Both were unstyled and inherited the row's foreground — the same weight as the title. Stepped down, and not to the same place: the count is still information (text-gray-10), the chevron only restates what tapping the row does (text-gray-9). Measured luminance: title 0.0144 < count 0.227 < chevron 0.2664.

ListItem is the sole owner of that markup — Countries and Region consume it — so nothing needed de-duplicating and no other use of text-end/text-xl is touched.

006 · Filter view interactivity

⚠ Most of what the brief reported was already true. The Filter view is a real filter: it holds a draft seeded from the URL and the per-group Clear links are already conditional. The pre-selected state the designer saw is FilterView.stories.tsx, which deliberately seeds a dirty draft. Two things genuinely were broken:

Deselect. Format and Frequency could be set but not un-set from the control — the only two filters with that hole. Radix already fires onValueChange('') on onItemDeactivate; a next && patch(…) truthiness guard swallowed the empty string. Mapped to the 'any' sentinel the URL codec omits. The file's own comment already described deselect-to-clear as the intended design.

The row jump. Real, and measured. The label row is items-baseline with different line boxes (text-sm 19.5px vs text-xs ~20px), so mounting Clear grew the row and pushed every section below it down.

Fixed by reserving the space — Clear is hidden, never unmounted — rather than pinning a measured pixel height. Deterministic, survives the typeface change in the next PR and a translation that wraps, and visibility: hidden also takes the button out of the tab order and the accessibility tree.

Verified in Chrome with getBoundingClientRect() before/after, as the brief asked: all six rows at exactly 20px, and no section's top moves by any amount, in either direction.

The layout fix lives in the shared FilterGroup, so it also covers the Date, Language and Region groups — wider than the brief's stated scope, but a no-visual-change stabilisation. Their controls are untouched.

Verification

lint · typecheck · test:run (1397) · build · size all green. New specs were each confirmed to fail against the reintroduced defect at its real site before being kept — including de-vacuuming two assertions that initially passed for the wrong reason on an empty list.

Browser-verified in Ladle: Checkbox in all five states, the day-picker ToggleGroup, the ActionRow matrix, List/ListItem, and Button + Chip to confirm they did not move.

🤖 Generated with Claude Code

Ardnived and others added 4 commits August 28, 2026 11:12
The highlighted (active-filter) state painted body text on a tinted surface at
3.09:1 in the light theme — under the 4.5:1 WCAG AA floor, with a highlighted
ToggleGroup's day letters the worst case. Move the surface one step lighter and
the text one step darker: 3.09 -> 7.30 light, 7.57 -> 12.36 dark.

  bg-primary-3       -> bg-primary-2    tinted surface
  text-primary-11    -> text-primary-12 label on it
  hover:bg-primary-4 -> hover:bg-primary-3
  bg-primary-6       -> bg-primary-5    switch / slider track

Expressed in ramp STEPS, not colours, so it holds for every tenant: the brand
ramps are generated at runtime from a fixed lightness ladder, and only the hue
and saturation come from the client's seed.

Borders and the selected `data-[state=on]` fills are deliberately untouched, as
is `bg-primary-3` wherever it is the `flat` variant of Button / Chip / Alert or
the list row's press state — same step, different role, and changing it there
would be a regression.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The caption under each circle was pinned to `text-primary-12 dark:text-primary-11`
in the slot recipe while the circle beside it took its role from `controlSurface`
— so every non-primary circle wore a primary word. Visible sixteen times over in
the story's colour x variant matrix, where all four rows rendered primary captions.

`color` now drives a variant on the recipe. It defaults to `primary`, so every
existing call site renders exactly as before.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Both were unstyled and inherited the row's default foreground — the same weight
as the title, which flattened the row. Step them down, and not to the same place:
the count is still information (gray-10), the chevron only restates what tapping
the row already does (gray-9). The title keeps `text-foreground` and stays the
loudest thing in the row.

`ListItem` is the sole owner of this markup — Countries and Region consume it
rather than re-implementing it — so there is nothing to de-duplicate and no other
use of `text-end` or `text-xl` is touched.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Two fixes in the filter form.

**Deselect.** Format and Frequency could be set but not un-set from the control
itself — the only two filters with that hole. Radix's single-select already fires
`onValueChange('')` on `onItemDeactivate` when you press the item that is on, so
the capability was always there; a `next && patch(...)` truthiness guard swallowed
the empty string. Map it to the `'any'` sentinel the URL codec omits. The file's
own comment already described deselect-to-clear as the intended design.

**The label row no longer jumps.** The row is `items-baseline` and its two
children have different line boxes — the label is `text-sm` (19.5px), "Clear" is
`text-xs` (~20px) — so mounting Clear on selection grew the row and pushed every
section below it down the page. Clear is now hidden rather than unmounted, so it
holds its space in the flex layout and the row's height cannot change. Measured
in Chrome: all six rows sit at exactly 20px and no section's top moves by any
amount, in either direction.

Reserving the space is deterministic where pinning a measured pixel height is not
— it survives a font change and a translation that wraps — and `visibility:
hidden` also takes the button out of the tab order and the accessibility tree, so
a hidden control is never reachable.

The layout fix lives in the shared `FilterGroup`, so it also covers the Date,
Language and Region groups. Their controls are untouched.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sahajatlas-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: ca530b6
Status: ✅  Deploy successful!
Preview URL: https://7e46395a.sahajatlas-design.pages.dev
Branch Preview URL: https://feat-design-tokens-retune.sahajatlas-design.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sahajatlas with  Cloudflare Pages  Cloudflare Pages

Latest commit: ca530b6
Status: ✅  Deploy successful!
Preview URL: https://bbcf3430.sahajatlas.pages.dev
Branch Preview URL: https://feat-design-tokens-retune.sahajatlas.pages.dev

View logs

@Ardnived
Ardnived merged commit 49371d0 into main Aug 28, 2026
5 checks passed
@Ardnived
Ardnived deleted the feat/design-tokens-retune branch August 28, 2026 22:41
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.

1 participant