Skip to content

feat(ui): add keyboard accessibility and error-copy pass - #21

Merged
prateekchaplot merged 1 commit into
mainfrom
arch/tts/t4.2
Nov 23, 2026
Merged

prateekchaplot merged 1 commit into
mainfrom
arch/tts/t4.2

Conversation

@prateekchaplot

Copy link
Copy Markdown
Owner

Task T4.2 from docs/ARCHITECTURE.md §14.

What changed

  • New frontend/src/strings.ts: every user-visible string, interpolating helpers, and errorGuidance(code) covering all 15 §9.1 codes (plus an unknown-code fallback). Copy was moved verbatim, so the frozen T2.2/T3.3/AC13 aria-label contracts are unchanged.
  • ErrorBanner: exported ErrorBannerContent renders the problem, the server message, and a plain-language "What you can do" line; ErrorBanner focuses the heading when an error appears and Dismiss returns focus to the control that had it.
  • Skip link as the first tab stop and <main id="main"> landmark; aria-busy on the generate section; named <progress> with aria-valuetext; active-word scrolling pinned to behavior: "auto" (reduced-motion CSS already ships).
  • History delete is an inline two-step confirm (Confirm delete / Keep) with a "cannot be undone" prompt; focus moves to Confirm and Keep returns it to Delete. No window.confirm, no new dependency.
  • docs/ARCHITECTURE.md §6 gains the strings.ts line.

Decisions

  • Word spans stay mouse-only seek targets: T3.2's decision is final; sentence cue buttons are the keyboard word-seek path and AC15 exercises them.
  • App.tsx and styles.css are not owned by T4.2 but received additive edits (copy import, skip-link/confirm styling); recorded in docs/TASKS.md.
  • Errors cleared by other reducer actions do not move focus; only an explicit Dismiss restores it.

Verification

  • 111 Vitest (18 new), ESLint, tsc --noEmit, Prettier (CRLF), live Vite build, 196 pytest unit, git diff --check.
  • AC15 recorded: 23/23 keyboard-only checks in live mode against the built bundle with the real en_US-lessac-medium voice (isolated TTS_DATA_DIR, port 8322) — skip link → main, typing, voice select, generate → Audio ready, Enter to play, Space to pause, cue focus, WAV/SRT/VTT downloads, delete confirm + Keep focus return, error banner focus + guidance + Dismiss focus return. The temporary Playwright script was removed and is not committed.

Suggested merge: squash merge with branch deletion.

Move every user-visible string into strings.ts (section 11) and give each API error code a plain-language corrective action in ErrorBanner. Add a skip link and main landmark, focus management for errors, a named progress bar, aria-busy on the generate section, and an inline delete confirmation in History.

Task T4.2 from docs/ARCHITECTURE.md section 14.
@prateekchaplot
prateekchaplot merged commit cae5006 into main Nov 23, 2026
5 checks passed
@prateekchaplot
prateekchaplot deleted the arch/tts/t4.2 branch November 23, 2026 13:01
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.

1 participant