From 930fa8112450ee8b53fca9e7caa7db28b2324d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Wed, 8 Jul 2026 23:51:22 +0200 Subject: [PATCH] fix(a11y): switch names, contrast floors, and chart-toggle pressed state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Admin SettingsToggle: name the Radix switch via aria-label so it no longer announces as a bare 'switch, on/off' (one shared component, six call sites). - Replace the phantom text-destructive-foreground / text-warning-foreground utilities with the vetted destructive pattern (bg-destructive text-white dark:bg-destructive/60) and a readable foreground on the warning wash — no more dead classes riding on cascade order. - Drop the sub-AA opacity tiers: lab sparkline + titration marker off muted/70, state icons (query-error, chart empty/error, med sort) off muted/60 to the full token so they clear the light-theme floor. - Chart range toggles expose aria-pressed (lab, custom-metric, health, mood, compliance) so the active window is conveyed to assistive tech. --- src/components/admin/_shared.tsx | 5 +++++ src/components/charts/chart-empty-state.tsx | 2 +- src/components/charts/chart-error-state.tsx | 2 +- src/components/charts/compliance-line-chart.tsx | 1 + src/components/charts/health-chart.tsx | 1 + src/components/charts/mood-chart.tsx | 1 + src/components/custom-metrics/custom-metric-chart.tsx | 1 + src/components/labs/lab-biomarker-chart.tsx | 1 + src/components/labs/lab-trend-sparkline.tsx | 2 +- src/components/medications/dose-history-ledger.tsx | 2 +- src/components/medications/intake-history-editable.tsx | 4 ++-- src/components/medications/medication-table.tsx | 2 +- src/components/medications/titration-timeline.tsx | 2 +- src/components/settings/integrations/withings-card.tsx | 2 +- src/components/settings/sharing-section.tsx | 2 +- src/components/ui/query-error-card.tsx | 2 +- 16 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/components/admin/_shared.tsx b/src/components/admin/_shared.tsx index b9c8ff1aa..38d907201 100644 --- a/src/components/admin/_shared.tsx +++ b/src/components/admin/_shared.tsx @@ -192,6 +192,11 @@ export function SettingsToggle({ ` with no association to the + // Radix switch button, so a screen reader would announce a bare + // "switch, on/off". Name it explicitly — one fix covers every admin + // toggle that mounts this shared component. + aria-label={label} checked={checked} onCheckedChange={onCheckedChange} disabled={disabled} diff --git a/src/components/charts/chart-empty-state.tsx b/src/components/charts/chart-empty-state.tsx index fe71164ad..790521df9 100644 --- a/src/components/charts/chart-empty-state.tsx +++ b/src/components/charts/chart-empty-state.tsx @@ -56,7 +56,7 @@ export function ChartEmptyState({ style={height === undefined ? undefined : { height }} >