a11y: ARIA, focus trap, keyboard nav, WCAG 2.1 AA (#10)#31
Merged
PAMulligan merged 14 commits intoApr 16, 2026
Merged
Conversation
added 14 commits
April 16, 2026 11:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the Claudius chat widget to WCAG 2.1 AA compliance. Closes #10.
ChatWindowis nowrole="dialog"witharia-labelledbypointing at the header<h2>.aria-modal="true"is set only on mobile, where the scrim actually blocks the background (honest ARIA claim).useFocusTraphook. Input autofocuses on open; focus returns to the toggle button on close (pre-existing).role="log" aria-live="polite"container with a dedicated sr-onlyaria-live="polite" aria-atomic="true"region that announces only the latest assistant message. Markdown markers and long URLs are stripped for SR clarity via a newstripAnnouncementFormattinghelper.text-white/90(4.49:1, fails) totext-white(5.17:1).eslint-plugin-jsx-a11ywith recommended rules plus 5 escalated to error.aria-roleis configured withignoreNonDOM: trueto handle theChatMessagecomponent's domainroleprop without line-level disables.Test count: 135 → 154. Lint: 0 errors. Lighthouse accessibility: 97/100 (the sole flag is
landmark-one-mainon the Vite dev harnessindex.html, not on the widget component itself).Test plan
cd widget && pnpm install && pnpm test— all 154 tests passcd widget && pnpm lint— 0 errorscd widget && pnpm devthen at http://localhost:5173:🤖 Generated with Claude Code