fix(a11y): WCAG touch-target floor + ARIA pairing across W4–W9 surfaces

Extends the W8.3 44px touch-target rule and the W8e accordion ARIA
contract to surfaces that shipped without them:

- Insights tab-strip pills: pills are primary navigation; promote to
  `min-h-11` so a thumb tap on "Stimmung" cannot bleed into the
  neighbour two pixels below.
- Injection-site picker: raise the invisible hit-target radius from
  11 to 12 SVG units so the rendered diameter (\~25.6 CSS px)
  clears the WCAG 2.5.8 Level AA 24×24 floor. The abdomen left/right
  pair at \Δx=24 caps the upper bound — larger circles would
  collide.
- Source-priority reorder arrows (per-metric + device-type axes):
  promote four `h-7 w-7` icon buttons to `h-11 w-11`.
- Sub-page heading: replace the bare `focus-visible:outline-none`
  with the same ring vocabulary used by insights pills + the Coach
  drawer so sighted-keyboard users get a visible indicator on
  programmatic focus.
- Source-priority per-metric + device-type accordions: pair
  `aria-expanded` with `aria-controls` + matching `id` on the
  panel, mirroring the W8e Provenance contract.
- Maintainership banner dismiss button: 22×22 hit zone replaced by a
  44×44 inline-flex button that keeps the same icon size.
- Injection-site picker group: `aria-label` was leaking the
  cadence-preset string; introduce
  `medications.injectionSitePickerAriaLabel` and translate it
  across all six locales.
- Body-outline SVG: hardcoded English "Body outline" replaced by
  `medications.injectionSiteBodyOutlineAriaLabel` with native
  translations in DE/FR/IT/ES/PL.
This commit is contained in:
Marc-André Bombeck committed 2026-05-14 16:55:10 +02:00
1 parent 04dd972358
commit 72fcdc656f
11 files changed
+54 -19

No files matched your search

@@ -130,7 +130,10 @@ export function InsightsTabStrip({
data-slot="insights-tab-strip-pill"
data-active={isActive ? "true" : undefined}
className={cn(
"shrink-0 rounded-full border px-3 py-1 text-xs font-medium transition-colors",
// 44px touch-target floor (W8.3) — pills are primary
// navigation; the regenerate icon-button to the right
// already meets the same minimum.
"inline-flex min-h-11 shrink-0 items-center rounded-full border px-3 py-1 text-xs font-medium transition-colors",
"focus-visible:ring-ring/50 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
isActive
? "border-primary bg-primary/10 text-primary"
@@ -151,11 +154,10 @@ export function InsightsTabStrip({
title={regenerateLabel}
data-slot="insights-tab-strip-regenerate"
className={cn(
// 44×44 touch target — Marc directive 2026-05-14. The
// pill row above sits 28px tall; the button breaks the
// band height intentionally so the touch target meets
// the WCAG 2.5.5 minimum without forcing the pills to
// grow.
// 44×44 touch target — same WCAG 2.5.5 floor the pill row
// now honours via `min-h-11`. The button stays circular so
// its visual weight matches the existing top-bar icon
// buttons.
"inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-full",
"text-muted-foreground hover:text-foreground hover:bg-accent",
"transition-colors",
+5 -1
View File
@@ -68,7 +68,11 @@ export function SubPageShell({
tabIndex={-1}
className={cn(
"text-xl font-semibold sm:text-2xl",
"focus-visible:outline-none",
// a11y: sighted-keyboard users (e.g. "Skip to content")
// need a visible focus indicator on the programmatic
// `headingRef.focus()` call below. Match the focus ring
// vocabulary used on insights pills + Coach affordances.
"rounded-sm focus-visible:ring-ring/50 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
)}
>
{title}