From c683d4971610e7aa04772ce13aa0e5f6d4fc10fb Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sat, 26 Sep 2026 12:49:31 +0000 Subject: [PATCH] The dashboard now says out loud what a filter just did MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cross-filtering is the one interaction whose whole point is that acting on ONE control changes a number somewhere ELSE. Pick "Islam" in the left rail and 2,107 becomes 693 across the KPI strip, the map, the table and the charts. A sighted user watches that happen. A screen-reader user heard nothing at all: this element carried exactly one role="status" (the table's selection pill) and zero aria-live regions. The filter worked; the feedback did not exist. ONE polite live region in the shell, not one per panel. Six surfaces change on every brush, and polite announcements QUEUE — six regions would make the user wait through five repeats before reaching the next control. It is always rendered and starts empty, because a live region inserted already holding its text is routinely not announced; it is visually hidden rather than display:none, which would take it out of the accessibility tree along with the pixels. It is debounced at 700ms for the same reason the selection camera is debounced: typing re-derives the row set per keystroke, and an un-debounced region would queue one announcement per character. It stays silent on arrival and only ever reports a change. It names the count, the total, the active facets and the search term, formatted by the shell's own formatter so it can never read as a different number from the KPI strip beside it. ONE RESIZE HANDLE ANNOUNCED ITSELF IN ENGLISH in all 11 locales. Four of the five read their title and aria-label through T(); the map/table one held raw string literals. It survived review because each half looks correct on its own — the ternary is right, the strings are right, only the missing T( is wrong. Both now resolve through the catalogue. (The keys themselves are on sr/dashboard-a11y-strings: aria.json held eleven keys and not one was a resize key, so ALL five handles have been falling back to English. The T() call sites were right the whole time.) THE CHIP ✕ IS NOW BIG ENOUGH TO HIT. The live strip's remove button was a ~13x16px glyph — the smallest control in the product, and the only way out of a narrowed board, where a miss costs the reader the whole view. The row height cannot grow: three comment blocks above it record a measured layout-shift bug and the Driver's "a lot more subtle" instruction that pinned it to 16px. So the HIT AREA grows and the BOX does not, via an absolutely-positioned 24x24 ::after that contributes nothing to the flex row's intrinsic size. Nothing moves by a pixel. 2.5.8 is a TARGET SIZE criterion, not a touch one, so it is unconditional. A focus-visible ring too, since the chips live in an overflow-x strip where being scrolled into view is not the same as being visible. The kit's own DashboardFilterChips were spans with click delegation — not focusable, no click from Enter or Space. They are buttons now, with an aria-label naming the ACTION rather than the filter ("Religion: Islam" is a good name and a useless action), type="button" so a partner's form is not submitted by a chip, a focus ring and a 24px floor. The reset-all chip deliberately gets NO aria-label: its visible words already are the action, and overriding them breaks voice control. Recording what this does NOT fix, because the measurement that prompted it named the wrong file. DashboardFilterChips is exported from the kit and mounted by NOBODY — round 1 of BUG-DUPLICATE-FILTER-BADGES removed it, and the strip on screen belongs to SearchFilterHeader, whose remove button was already a real diff --git a/plugin-designs/research-dashboard/scripts/check-dashboard-filter-a11y.mjs b/plugin-designs/research-dashboard/scripts/check-dashboard-filter-a11y.mjs new file mode 100644 index 000000000..c08030226 --- /dev/null +++ b/plugin-designs/research-dashboard/scripts/check-dashboard-filter-a11y.mjs @@ -0,0 +1,285 @@ +#!/usr/bin/env node +/** + * check-dashboard-filter-a11y.mjs — the dashboard's cross-filter must be OPERABLE and AUDIBLE. + * + * THE TWO DEFECTS THIS EXISTS TO PREVENT (both measured on main, 2026-09-26, both shipped). + * + * 1. A FILTER YOU CAN SET BUT CANNOT CLEAR WITHOUT A MOUSE. The filter chips were + * `` with click delegation on the bar. A span is not focusable, carries no + * role, and the browser fires no click for it on Enter or Space. Every control that SETS a + * filter is keyboard-operable (the tree rail's rows, the dropdowns, the geocoder), so a + * keyboard user could walk into a narrowed board with no way out but reloading the page. + * That asymmetry — reachable in, unreachable out — is the defect, not the missing role. + * + * 2. A CROSS-FILTER THAT ANNOUNCES NOTHING. The whole point of brushing-and-linking is that + * acting on ONE control changes a number somewhere ELSE. The element contained exactly one + * role="status" (the table's selection pill) and ZERO aria-live regions, so a sighted user + * watched 2,107 become 693 across six surfaces while a screen-reader user was told nothing + * at all. The filter worked; the feedback did not exist. + * + * PLUS the localization half of the same class: a `role="separator"` resize handle whose + * aria-label is a RAW ENGLISH LITERAL announces itself in English in all 11 locales. Four of the + * five handles read theirs through T(); the map/table one did not, and it survived review because + * each half looks correct on its own — the ternary is right, the strings are right, and only the + * missing T( is wrong. + * + * ★ WHY THIS IS AN AST WALK AND NOT A GREP. grep cannot tell `:aria-label="T(...)"` (a bound + * expression) from `aria-label="T(...)"` (a literal that happens to contain the characters), cannot + * tell a chip that is a