Repository navigation
feat(a11y): the atlas widget can be used with a keyboard and a screen reader - #435
Conversation
…rary The widget's own views are what a visitor on wemeditate.com reaches, and nothing the host repo can check reaches inside the custom element. This adds the gate that does: axe-core, a tap-area probe and a keyboard walk, over every story in the component library, in Chromium at phone size. It is a browser and not a vitest file because jsdom has no layout: the same axe configuration there found 23 of the 127 findings this one does, and none of the 80 contrast failures. The Button atom grows the invisible 44px tap area the gate measures. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZGN3GTmhtxyD8MEQ2
… sees The gate measured each control by hit test at phone size. Three kinds of defect came back: controls drawn under 44px with nothing around them, an accessible name that dropped the control's own visible text (WCAG 2.5.3), and muted text under 4.5:1. Small controls grow an invisible 44px area rather than being redrawn, so nothing moves on a desktop. Where two such areas met — a header's controls, a filter group's Clear above its toggles — the later control took the shared pixels and both measured short, so those rows gain room on a touch screen instead. The toggle items are flush, so they take a drawn 44px. The geocoder's own input claims `role="combobox"` and never said whether it was expanded, so a screen reader was never told suggestions had appeared. Our own code sets it, as aria-live.ts already moves the live region. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZGN3GTmhtxyD8MEQ2
The place-search field becomes a named `search` landmark, so a reader can tell it from the results under it and the Filters dialog beside it. The Checkbox atom gains the `aria-label` it had no way to take, which is what left its own examples unnamed. `pnpm test:a11y` joins CI's gate job, after `pnpm ladle:build` — a step rather than a job, so the check the ruleset already requires is the one that carries it. The library's own pages are fixed too, not exempted: labelled demo fields, a corner cell that is no longer an empty header, and the spacing a matrix of controls needs once each one answers across 44px. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZGN3GTmhtxyD8MEQ2
Radix restores focus to a `Dialog.Trigger`, and the Modal atom renders none — it is controlled through `open`. Its handler then prevents the default and focuses nothing, so closing the "Report an issue" dialog put a keyboard viewer back on the host page's `<body>`. Measured in Chromium against the component library, and fixed as `CompactEmbedView`'s surface already fixes it: the root records the opener while the dialog is closed. Three details are load-bearing and each one was measured: the recorder listens on the widget's root rather than `document`, it ignores anything inside the dialog, and it cannot read focus during the dialog's own render — a render React discards and repeats re-reads it after the trap has moved focus, which made a first attempt pass one run in three. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZGN3GTmhtxyD8MEQ2
The review passes found the gate paying for work it did not need and the focus fix written twice. Both are now one thing each. `pnpm test:a11y` goes from ~180s to ~28s over the same 52 stories: the static server sends cache headers so a 950KB shell is not re-fetched and re-compiled on all 52 navigations, axe-core is served by URL instead of inlined 52 times over the protocol, the resting paint is resolved for tab stops rather than every element, and a flat 600ms sleep per story becomes a wait on the DOM going quiet. The sleep was also masking a race: at a fixed settle the calendar reported 28 contrast failures against a palette it had not applied yet. `useOpenerRestore` is the one implementation of the dialog focus bookkeeping, for the Modal atom and the compact embed's surface alike. Writing it once surfaced a third hazard neither copy had: the recorder re-runs as a dialog closes, with the x that closed it still focused, and recording that sends focus to a node already gone. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZGN3GTmhtxyD8MEQ2
The review read the installed `@mapbox/search-js-web` rather than the module's premise, and the premise was wrong: `hideResults()` writes `aria-expanded="false"` and the show path writes `"true"`. Only the initial state is missing, so the module now seeds an input that has no value and never writes again. As a second writer it would have overwritten a correct `"false"` the moment anything else in the wrapper mutated, and its own `hidden` test was a shape the library never produces. Three more the review caught, each a defect this branch introduced: - the contact link is pinned to 44px by the recipe's new coarse height, on exactly the phone where a long number has to wrap. tailwind-merge does not cancel a variant with an unprefixed class, so the skin relaxes it a second time. - the challenge frame was given `tabindex="0"` on expanding rather than having the attribute removed, which is one tab stop more than before. - a control resting against a viewport edge cannot be centred, so its probes fell off screen and it would have failed a required check for where it sat. The gate now counts those as unmeasured and says so. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZGN3GTmhtxyD8MEQ2
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sahajatlas-design | 95b0430 | Nov 19 2026, 11:34 PM |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the size of #432 and no larger: every ticket bullet has code behind it, and the gate blocks rather than warns. The 44px work is the right shape — one default with three named defeaters, measured by hit test, with the decision procedure in src/components/AGENTS.md instead of in 60 class edits.
Two things to settle. The gate hand-rolls what @axe-core/playwright does — a static server, an axe route, two injection paths — and never says why; the 650 KB-over-CDP argument is a real answer, so write it beside axeTag. And docs/embedding.md now promises a host more than the gate measures.
Findings
- should-fix —
docs/embedding.md:1279: the map's own controls are promised the 44px floor and the gate, and get neither. - should-fix —
MapSearch.tsx:125: a secondMutationObserveron the subtreearia-live.tsalready observes. - should-fix —
use-opener-restore.ts:56: Radix'sFocusScopealready records the opener; wasDialog.Trigger asChildtried? - consider —
ci.yml:65: the cache key hashes all ofpackage.json, not theplaywrightversion its comment claims. - consider —
check-a11y.mjs:582:unmeasuredis unbounded and cannot fail the gate.
What was checked
Read whole on the branch: check-a11y.mjs, use-opener-restore.ts, combobox-expanded.ts, aria-live.ts, _mime.mjs. Diffs read: ci.yml, package.json, both dialogs, Drawer.tsx, Button.tsx, ShareContent/, use-turnstile.ts, both stylesheets, both host-facing files. Ladder: _mime.mjs is an extraction with two callers, two modules are findings above, check-a11y.test.ts covers arithmetic. Contract: CHANGELOG.md and docs/embedding.md both carry the tap-floor and share-icon costs and name no CSP or Permissions-Policy change, which is right — nothing new is fetched.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The key was `hashFiles('package.json')`, while the comment beside it
claimed the pinned `playwright` version. Any dependency bump, any new
script, any version-field edit therefore re-downloaded ~170 MB of
Chromium on the critical path of the one required check, for a browser
whose version had not moved.
A step reads the version out of `package.json` and the key takes that
string, so only a playwright bump busts it.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjW4tPoPfSJvxHay7ib
`unmeasured` was a count in the run's one-line aside. The control that lands there is the one whose centre sits within half the floor of a viewport edge — a narrow control pinned to a corner, which is the shape the floor exists to catch — so a number says nothing about whether the floor quietly stopped applying to a story. Each one is now named with its story, grouped like a finding, and a warning annotation carries the count onto the run itself rather than into a job summary nobody opens. It stays a warning. A control the page has no room to scroll past is pinned where it sits, and failing on that would red the gate for a layout rather than for a tap area. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW4tPoPfSJvxHay7ib
The gate hand-rolls a static server, an axe route and two injection paths, and the file never said what the published package does worse. The answer is the same one the `url` branch beside it already rests on: that package pushes axe's source through the debugging protocol into every frame, which is the 650 KB this avoids, once per story. It also audits only axe, while two of the three checks here need the page regardless. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW4tPoPfSJvxHay7ib
`aria-live.ts` and `combobox-expanded.ts` each ran a `MutationObserver` over the same node with the same options, started from the same effect and torn down beside each other. Two subscriptions and two lifetimes for one subtree is the duplication `aria-live.ts` already argues against for patches: one change, not two. `geocoder-dom.ts` holds both repairs in one callback, behind `repairGeocoderDom`, and `MapSearch` now returns its single teardown. Hoisting the region mutates `document.body`, and the seed writes an attribute, so neither repair can re-enter the childList observer. Both specs merge into one file, each keeping its own fixture and its own argument. The two docs that named the old modules follow. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW4tPoPfSJvxHay7ib
The guide told a host that the map's locate, attribution and zoom controls answer to 44 × 44 and are checked on every change. None of that held. There is no zoom control; the attribution is exempt from the tap floor outright; and the check drives the component library, where the map renders its needs-a-token notice, so no map control is ever loaded for it to measure. It now names the two controls that exist, gives each one's measured size against mapbox-gl 3.35.0, says why the attribution may not be resized, and says why the check cannot reach either. The changelog entry carries the same exception, since this is the one page an embedding site reads. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW4tPoPfSJvxHay7ib
The hook says Radix restores focus to a trigger neither dialog has. It did not say why a trigger is unavailable, which is the first thing a reader asks before deciding the hook is redundant. All three openers are outside the dialog's own tree, one of them not even React's, and Radix's recorded value is unreachable without a trigger because `DialogContent` preventDefaults its own restore — read off the installed bundle. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW4tPoPfSJvxHay7ib
The step reads a field out of `package.json` and writes it to `$GITHUB_OUTPUT`. On a fork's pull request that file is unreviewed text, and a newline inside the value forges further step outputs. It now refuses anything that is not a plain three-part version, which also catches the field going missing rather than keying the cache on `undefined`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW4tPoPfSJvxHay7ib
`docs/testing.md` listed what the gate probes and not what it does with a control it cannot probe, which is now a named entry and a warning annotation. `scripts/AGENTS.md`'s inventory of the unit-lane half follows the second formatter. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW4tPoPfSJvxHay7ib
|
Six commits on the five threads and the review body, over a clean Adopted
Rebutted — use-opener-restore.ts:56: no opener here can be a Lint, typecheck, 2126 unit specs; 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
The merge queue ran this branch against main and went red twice. `SettingsMenu` takes `tv` from `tailwind-variants`, which main's lint rule refuses: the package entry ships a second merge engine. The import arrived here after that rule was written, so neither run could see it — this branch predates the rule, and main has the file on `clsx`. It now takes the one sanctioned import, `@/styles/tv`. The embed graph then shipped 336.2 of 336 KiB. main leaves 0.2 KiB spare and this branch adds 0.4, all of it in the injected stylesheet (141.0 → 141.4 KiB): the 44px tap areas, the row spacing they need to reach, and the contrast fixes. The chunk count is unchanged at 8, so nothing became newly eager and the `SENTRY_GAP_KIB` figures still hold at the count they were measured at. `embed` is budgeted 338; `standalone` ships 335.1 and keeps 336. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXpXkctRV69SmZvKJ6
…t-a11y CHANGELOG.md conflicted twice, both additive: main's #445 entry and this branch's two #432 entries landed in the same `### Changed` position, and their link definitions in the same place at the foot. Both sides kept, ordered by descending PR number like the entries around them. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjUuV5HDHKkDZZVCxFe
|
Merged Checked after the merge, because #445 rewrote the map layer this branch also touches: lean gate green (lint, typecheck, 2158 tests), 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Three resolutions: - `src/views/shared.tsx` — keep both. #435's `role="search"` landmark on the wrapper, and this branch's controlled `value`/`onChange` on `MapSearch`, which is what stops half-typed text reaching `?q`. - `scripts/check-bundle-size.mjs` — both sides raised the embed budget to 338 from 336, so the figure stands and both history entries stay. Re-measured on the merge: standalone 335.5, embed 336.6, so 337.0 and 337.8 shipped, inside 338 with 0.2 KiB spare on the embed. - The five specs mocking `react-map-gl` now mock `react-map-gl/mapbox`. #445 upgraded the library to 8, which publishes no root entry, so every one of them died at import. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX8sHLcAAW89cXoi6P
`main` gained #435 (the a11y gate and its 44px tap areas) and #451 since 049ff3c. Three text conflicts, both sides kept in each, and two breaks the merge made that no conflict marker showed. CHANGELOG keeps this branch's five entries and #435's five, in the file's own descending order, and both link definitions. `docs/testing.md` keeps #435's third-lane paragraph and this branch's coverage paragraph. The "Three lanes" sentence is #435's and auto-merged. `scripts/check-bundle-size.mjs` keeps both history blocks, and `embed` goes back to 336 from #435's 338. That raise bought 0.4 KiB of generated CSS room on a graph with 0.2 KiB spare; this branch leaves 44.0, so the raise buys nothing and splits a pair the comment beside the constant, `scripts/AGENTS.md` and the PR body all describe as held together at 336. Both budgets pass either way — at 336 `embed` is 13.1% under, inside `SLACK_RATIO`'s 15%. #435 added `actions/cache@v4` to `ci.yml`, and this branch's new `ci-workflows.test.ts` refuses a third-party action named by a tag. Pinned to the commit `v4` points at, with its version beside it, like the other four. #435 also added `pnpm test:a11y` as a step of the `gate` job, which the same spec's "runs the lane once" assertion counted as a second vitest lane — it matched any `pnpm test:*` step. It now keeps only the steps whose `package.json` script runs vitest, so a second real lane still fails it. Lean gate green on the merged tree with the build and `pnpm size` (`check.sh --full`, exit 0). Eager payload, measured/shipped KiB: standalone 289.7/290.9, embed 290.8/292.0, loader 2.8/3.3. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXf4EeQiCL8iF42zak
Summary
Change outline
Files — the gate, and the one mechanism the fixes needed
Flow — what the gate asks of every story
Behaviour — how a control reaches 44px, and why not one way
The tap floor is one default with three named defeaters.
src/components/AGENTS.mdcarries the decision procedure; the gate measures the result by hit test, so none of it can be asserted from a class list.Contract — what a host can observe
Behaviour — closing a dialog
Radix restores focus to a
Dialog.Trigger, and neither of this app's dialogs has one.Preview
The app and the library both deploy previews. Neither address exists until this PR's first CI run and the design Worker's branch build, so there is nothing to link yet — preview pending. Every change here is visible in the component library rather than in the app's data, so the library is the one to open:
Views / Filter,Views / Calendar,Molecules / Share Content— the three surfaces that gained room on a touch screenTest results
.claude/skills/pr-prep/check.sh— lint, typecheck,pnpm test:run(2126 passed)--full—pnpm buildandpnpm sizeboth passpnpm ladle:build && pnpm test:a11y— 52 stories, 655 controls, clean, against a real build (re-run on this revision)Manual verification
Atoms / Modal, Tab to Open modal, press Enter, press Escape — focus must come back to Open modal. Same forAtoms / Drawer. Measured here in Chromium at 390×844; the jsdom specs assert the focus call, not where focus settles, anddocs/testing.mdsays why.Organisms / Mapboxrenders its needs-a-key notice withoutVITE_MAPBOX_ACCESSTOKEN, so the locate and attribution controls were not measured. Open the app with a token and check the focus ring on each against the basemap.Notes for reviewer
gate, not a job. The ruleset requires that job's check by name, so this blocks from the day it lands; a new job would report a check nothing requires until someone edits the ruleset in a browser. Keeping the job'sname:byte-identical matters for the same reason.~/.cache/ms-playwright. It was ~180s before the review passes; the write-up of where that went is in therefactor(a11y)commit.target-sizeand this gate does not enable it, which is deliberate and stated in the script: that rule measuresgetBoundingClientRect, so it cannot see the invisible area the widget's small controls grow, and would fail every one of them while passing a 44px control an overlay covers.regionandlandmark-unique— both because a story page is one component in a bare div, or a catalogue of six of them. Everything axe enables by default stays on.touch-targetfrom the Button base, on the argument that the drawnpointer-coarse:h-11made it redundant. It is redundant for height and not for width — asmbutton reading "sm" draws 43px — and the probe said so.docs/embedding.mdandCHANGELOG.mdname the two that exist, give each measured size against mapbox-gl 3.35.0, and say the gate cannot reach either — the story renders a needs-a-token notice. They stay manual verification step 2.primary-11link on a step-3 tint measures 4.36:1.StorySectionfixed the surface (gray-3 → gray-2);OnwardLinkfixed the link (step 12), because it sits inside a neutralAlertwhose tint is not mine to lighten. One mechanism would be better and I could not find one that did not reach across the Alert recipe.Detail
Why a browser and not the unit lane. jsdom has no layout: a tap area cannot be measured and
color-contrastresolves to nothing. Measured over the same 52 stories with the same axe configuration, counting violation nodes: jsdom 31, the browser 131, and the browser's 80 contrast and 24 label-in-name failures were not among the 31.What the first full run found, and what closed it. 131 axe violation nodes and 206 tap targets under 44px. By rule: 80
color-contrast(agray-10count badge, anopacity-90alert line,text-contrastlink colour at 3.22:1, agray-9solid button carrying its own label at 3.24:1, a white-on-danger-9selected state at 3.91:1), 24label-content-name-mismatch(a copy button named without the URL it shows, weekday pills namedMondaywhile readingMon, a value-showing trigger, atel:link named without its number), 14button-name, 7label, 4aria-required-attr.Rejected, with reasons.
labelWithValuehelper plus a closed-list spec, for the three places that join a label to a value. The evidence offered for it was thatEventActions.tsx:135is a live 2.5.3 defect; it is not — that control's visible label and its accessible name are the same string.Measurements taken here, none of them checked by anything. The gate: ~180s → ~28s over 52 stories. Contrast, at 390×844 in Chromium: white on
danger-93.91:1 both themes, near-black on it 4.82:1;gray-1ongray-93.24:1 light and 3.7:1 dark, ongray-1215.88:1 and 16.28:1;contrast-9on the light background 3.22:1,contrast-116.28:1. jsdom spec stability: three dialogs in one file failed about one run in five, two about one in eight, one is 15 for 15.A tool limitation worth recording. The
--originflag audits a runningpnpm ladleinstead of a build, which is the local fix loop. It is not how CI runs, and the script says so: a dev server compiles a story when it is opened, so a story that failed to build would pass by never having been built.Closes #432