Skip to content

fix(web): calibrate WCAG AA contrast tokens, tablist/submenu a11y, touch targets, and reduced motion - #752

Open
oldwinter53 wants to merge 1 commit into
mainfrom
fix/ux-a11y-contrast-tabs-motion
Open

oldwinter53 wants to merge 1 commit into
mainfrom
fix/ux-a11y-contrast-tabs-motion

Conversation

@oldwinter53

Copy link
Copy Markdown

Summary

Foundational Design System and Accessibility fixes across @linger/web covering WCAG 2.1 AA contrast, WAI-ARIA keyboard navigation, coarse-pointer touch ergonomics, reduced-motion safety, icon consistency, and user-facing brand copy.

1. WCAG 2.1 AA Contrast Calibration & Regression Guard

  • Calibrated light-mode Town tokens in apps/web/src/app/visual-theme.css so every core text/surface pair meets WCAG 2.1 AA (>= 4.5:1) and interactive borders meet WCAG 1.4.11 (>= 3.0:1):
    • --town-muted-foreground (55 6% 38%): >= 4.96:1 across white, canvas, muted, sidebar, and sidebar-muted surfaces
    • --town-warning (35 100% 30%) and --town-success (98 48% 30%): >= 4.74:1 on their 10%-tinted status surfaces over white and canvas
    • --town-info (207 92% 35%) and --town-highlight (207 95% 32%): >= 4.57:1 across info cards, mentions, and mention hover surfaces
    • --app-placeholder (hsl(var(--town-foreground) / 0.62)): >= 4.73:1 across white, canvas, and muted surfaces
    • --town-input (68 8% 54%), --town-input-hover (68 8% 44%), and --app-border-interactive (hsl(var(--town-foreground) / 0.48)): >= 3.08:1
    • Updated all 7 --composer-attachment-*-text tokens to the Town 700 nature shades (>= 6.16:1 on their 15%-tinted attachment chips)
  • Removed /80 opacity attenuation on SettingsGroup meta text (apps/web/src/components/ui/settings-group.tsx).
  • Refined the active .another-me-card[data-active="true"] styling in apps/web/src/app/globals.css from an opaque mid-tone fill to a luminous 10% brand-tinted paper surface with a tinted border and crisp Town ink typography, guaranteeing >= 7:1 title contrast and >= 4.5:1 subtitle contrast across all avatar brand colors.
  • Added automated WCAG 2.1 contrast regression test apps/web/src/app/visual-theme-contrast.test.ts.

2. WAI-ARIA Tablist & ActionSubmenu Keyboard Navigation

  • Extracted reusable useTablistKeyboard (apps/web/src/components/ui/tablist-keyboard.ts) implementing WAI-ARIA APG roving tabindex (tabIndex={selected ? 0 : -1}), ArrowLeft/ArrowRight wrapping across enabled tabs, and Home/End navigation.
  • Wired useTablistKeyboard into UnderlineTabs and all 4 custom tablists: VoiceFocusSurface, RoomInfoPanel, UpdateDriverDialog (Linux distributions), and MeetingReader.
  • Fixed ActionSubmenu in apps/web/src/components/ui/action-menu.tsx to manage its own submenuItemRefs and handle ArrowDown/ArrowUp/Home/End with preventDefault() and stopPropagation() so focus never escapes back to the parent menu.

3. Coarse-Pointer Touch Targets, Drag touch-action, & prefers-reduced-motion

  • Expanded @media (pointer: coarse) hit areas to >= 44x44px via ::after overlays for .ui-button-compact, .ui-button-icon-compact, and .app-dialog-close in apps/web/src/app/globals.css without inflating desktop visual density.
  • Added touch-none and pointer-cancel / lostpointercapture cleanup to ColorPalette, MermaidSvgPreview, and WikiGraphTimeline (preventing cancelled pointer gestures on the timeline ruler from triggering date selection).
  • Added targeted @media (prefers-reduced-motion: reduce) rules with static state indicators in apps/web/src/app/globals.css (.meeting-today static ring, .meeting-heatmap-cell:hover static outline), meeting-page.css, message-markdown.css, mermaid-svg-preview.css, and wiki-profile-page.css.

4. Brand Polish & Icon Unification

  • Replaced user-facing "TeamHub" strings with "Linger" in apps/web/src/i18n/common.messages.ts, apps/web/src/app/route-pages.messages.ts, and apps/web/src/i18n/locales/zh-CN.json.
  • Migrated the final 2 lucide-react source files (runtime-history-view.tsx and runtime-tool-presentation.ts) to @hugeicons/core-free-icons via <Icon>, and replaced bg-white with bg-card in runtime-history-view.tsx. (Left package.json/pnpm-lock.yaml untouched to avoid unrelated lockfile churn outside apps/web.)

Verification

  • make check-web-static (tsc --noEmit, eslint --max-warnings=0, react-doctor --scope changed): 0 errors, 0 warnings
  • pnpm --filter @linger/web test (all 424 test files / 3,928 tests, including new visual-theme-contrast.test.ts, underline-tabs.test.tsx, action-menu.test.tsx, local-model-driver-dialog.test.tsx, voice-focus-surface.test.tsx, runtime-history-view.test.tsx, teamhub-router.test.tsx, catalog.test.ts): all passed
  • pnpm --filter @linger/web run build:assets: passed initial JS bundle budgets (590.83 kB minified, 202.73 kB gzip, 176.17 kB Brotli)
  • Playwright Chromium visual verification at Desktop (1440x900) and Mobile (375x812) against live Vite dev server: verified Before/After token contrast, Another Me active card legibility, Tablist & ActionSubmenu keyboard focus transitions, zero layout overflow, and zero console/page errors

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.

2 participants