Skip to content

feat(ui-react): integrated voice accessibility — announcements, focus and keyboard flows (#3701) - #3971

Merged
schlessera merged 6 commits into
mainfrom
feat/3701-voice-a11y
Nov 11, 2026
Merged

schlessera merged 6 commits into
mainfrom
feat/3701-voice-a11y

Conversation

@schlessera

@schlessera schlessera commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Closes #3701

What changed

This is the integrated accessibility pass for voice (epic #3690). The app now uses the kit's live props, which #3692 left to the app.

Announcements

  • The dictation (Dc, D3–D5) and live (S5, L1–L8) state labels are polite live regions. The live label is one node across L1–L8, so screen readers hear every change of state.
  • These failures are announced assertively:
    • D7: the microphone is blocked.
    • D8: dictation stopped.
    • L9: the live conversation stopped (role=alert).
  • An L6 approval request is assertive too: a persistent assertive region says what to tap (the field's own refusal line). The label still says "Needs your tap" politely.
  • D0 and D2 are polite.
  • A change to the Start card's notice is announced politely, and focus stays where it is.

Focus

  • Ending a live conversation by End, L9's Close, or the Start card's Cancel or Escape returns focus to the composer's mic. Before, it went to the text field.
  • If a live control is disabled or removed while it has focus, focus moves to Mute, or to the first control that still works (End, or L9's Close), instead of dropping to the page. This covers:
    • Interrupt once the reply stops;
    • Mute while voice gets ready;
    • Interrupt when a draft takes its place;
    • the field when L9 replaces it.

No kit component changed.

Why this shape

  • The Start card focuses its Start button. The issue asks that focus "moves to the card". I kept ui-react: wire the Start card (S1–S5) — service, persona and recovery #3698's behaviour (ConversationStartCard, packages/ui-react/src/components/voice/start-card.tsx): Start is the card's primary control, and focusing it puts focus inside the card's labelled group ("Start a live conversation"). A screen reader announces the group's name and then Start, which aria-describedby ties to the card's notice. Making the card itself focusable would add a tab stop that does nothing. The test asserts that focus lands inside the card on Start, and that Escape cancels.
  • App-side only. The kit already has live on VoiceStateLabel and VoiceNotice, documented as "the integrated app decides (ui-react: integrated accessibility for voice — announcements, focus and keyboard flows #3701)". The Start card's notice has no live prop, so the app adds a polite sr-only mirror instead of changing the kit.
  • L6 adds an assertive region instead of switching the label to assertive. Changing aria-live at the same moment as the text is announced unreliably. The approval prompt says what to tap, which is what the user needs straight away.
  • The focus guard only acts on focus the user still owns. It acts when a field control had focus and is now disabled or gone, and the page has no other focus. If the user moved focus elsewhere, the guard does nothing. Blur is checked a task later because a control that is being removed can blur while it is still attached.
  • No existing issue tracked the Interrupt focus drop. I searched for "Interrupt" plus focus, disabled and keyboard. ui-react: audit live conversation visuals, controls and capability-aware permission copy #3044's audit doesn't name it. The fix and its test are here.

Proof

bun run check:pr --base origin/main
{"version":1,"kind":"brain-check-pr-receipt","head":"25be3f799284c7872c1d6e9674bacdd371a742e8","base":"origin/main","mode":"focused","startedAt":"2026-11-11T12:28:32.739Z","finishedAt":"2026-11-11T12:29:10.301Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":12144.874247},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":103.81221899999946},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":66.19958100000076},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":16.508856000000378},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":25215.071773999996}]}

New app browser test: packages/ui-react/tests/browser/voice-accessibility.offline.tsx. It runs in the ui-react-layout project, which emulates reducedMotion: "reduce". It uses the real ChatPage in the shell, at 1280×720. The live states are inert client state, set as conversation-controls.offline.tsx does: no microphone or provider is opened, and the test asserts that no conversation_audio frame is sent. Dictation uses a scripted recognizer. All fixtures are Odysseus. 3 cases pass.

The test records every change to [aria-live], role=status and role=alert with its politeness. At every state it runs axe.run on the integrated screen, and it checks that document.getAnimations() has nothing running that moves. The kit's breathe keeps running under reduced motion with a single-frame keyframe by design (tokens.css, "Reduced motion"), so the check counts only animations whose keyframes differ.

  • Live path (keyboard only):
    • Tab to Talk live… and press Enter. Focus lands on the Start card's Start. The card passes axe.
    • A notice change is announced politely, and focus stays on Start.
    • Escape cancels, and focus returns to the mic.
    • Open the card again, then S5 → L1. Mute takes focus.
    • Then L2, L3 and L4, each announced politely on the same label node.
    • Interrupt by Tab and Enter. Interrupt becomes disabled, and focus moves to Mute.
    • Then L5 and L1.
    • L6: the label is polite, and the assertive region says "Tap Allow or Deny on the card." Deny is pressed with Enter.
    • Then L7 and L8.
    • L9 is role=alert. Focus moves from the removed End to Close, and Tab reaches Start again.
    • Close returns focus to the mic.
  • End path: End by keyboard returns focus to the mic.
  • Dictation path (keyboard only, no long-press):
    • Tab to the mic and press Enter. D0 is polite, with Start dictation focused.
    • Enter starts D3, announced politely as "Listening", with Finish dictation focused.
    • D5 is announced as "Finishing".
    • Finish puts the words in the draft, and focus moves to the draft.
    • D7 is role=alert, and its OK is reachable by Shift+Tab. OK returns focus to the mic.
    • D8 is role=alert. Dismiss and Try again are both in the tab order. Dismiss returns focus to the mic.
    • Nothing is sent.

Mutation receipts. Each guard was broken, the new file was run, and the named assertion failed. Every mutation was restored with git checkout; kit mutations were rebuilt before and after. The restored file passes 3/3.

# Mutation Failing test Assertion
M1 The live label has no live: "polite" live expected null to be 'polite' (label's aria-live)
M2 L6's assertive text is "" live L6 is assertive
M3 L9's notice has no live="assertive" live expected undefined to be 'Live conversation stopped…' (last assertive)
M4 The focus guard never acts live a disabled Interrupt hands focus to Mute: expected <body>…
M5 onLeave focuses the text field, as before live, End Escape returns focus to the mic: expected <textarea …>, and End's mic assertion
M6 The Start card's announcement region is empty live expected undefined to be 'The Ithaca relay is slow…'
M7 D7 is polite dictation D7 is assertive
M8 D8 is polite dictation D8 is assertive
M9 The dictation label has no live dictation expected null to be 'polite'
M10 The kit's reduced-motion rule for .bk-voice-spin is removed (rebuilt) live S5: reduced motion runs no animation
M11 The kit's End control loses its aria-label (rebuilt) live, End the live field in L1: axe (button-name), and reachable in tab order

Load: the new file passed 3/3 three times in a row with a yes process on every core.

Existing files touched or affected, all passing on this head (local pinned Chromium):

  • These 12 ui-react-layout files pass, 342 cases:
    • voice-accessibility
    • conversation
    • conversation-controls
    • conversation-consent
    • conversation-continuous
    • conversation-discard
    • conversation-endpoint
    • conversation-contextual
    • dictation-gemini
    • dictation-provider-end
    • spoken-turn-marks
    • dialogue-qualifiers
  • dictation-notice.pointer.tsx and composer-mic.pointer.tsx pass in rail-fine (37), rail-coarse (37) and rail-mixed (45). dictation-notice now expects D8's single announcement to come from a role=alert.
  • tsc --noEmit and bun run build are clean.

Refresh: merged main 40dbae0a2 (#3726, ui-server relay binding), then 0f6296a79 (#3980, the tracker announcer fix for red-main incident #3973, which cancelled this PR's first candidate proof), then 3c44ac6fc (#3977, safety client). Neither touches a file in this PR. The browser receipts above were taken at 00071f451 on base 4a8c43f38; the receipt is from the merged head.

Collisions (bun scripts/collisions.ts --paths on the changed sources): 29 closure reports against long-lived drafts and other open PRs. There are no path collisions. bun scripts/collisions.ts --json --pr 3971 at head 00071f451: 29 closure reports and no path collisions.

Checklist

  • Focused local preflight/behavioral receipts and complete selected hosted proof passed; actual head/base/job checkout evidence is in Proof.
  • Acceptance criteria from the issue are all met, or the gap is named below.
  • The PR and completed/advanced issues have verified release milestones under docs/process/github.md.
  • A changeset is included, or this changes nothing a consumer can see.
  • No personal data anywhere in the diff — the leakage gate covers the whole tree.
  • The integration contract index or relevant component is updated in this same commit, or nothing in the machine surface moved.
  • Docs under docs/ reflect the change, or nothing documented moved.
  • A fail-closed guard added or changed answers the proportionate-containment checklist in this body, or no guard changed.
  • Provider history stays append-only: nothing on a turn's path changed.

Anything left open

  • Nothing in scope. No runtime test hook was added, so scripts/runtime-test-builds.ts is unchanged.
  • Real screen-reader speech (NVDA, VoiceOver) isn't automated. The tests assert the live-region roles, politeness and text a screen reader reads.

🤖 Generated with Claude Code

schlessera and others added 3 commits November 11, 2026 07:53
… focus through voice flows

The live and dictation state labels are polite live regions; D7, D8 and L9
are assertive, and an L6 approval request says what to tap assertively. A
Start card notice change is announced politely. Ending a live conversation
returns focus to the mic, and a live-field control that is disabled or
removed while focused (Interrupt once the reply stops) hands focus to Mute
or the first usable control.

Refs #3701

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…duced motion and axe in the app

Refs #3701

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schlessera schlessera added type: feat A new capability or a change in user-visible behaviour. area: ui-react React chat/files/voice components, stores, WebSocket transport. labels Nov 11, 2026
@uploads-sh

uploads-sh Bot commented Nov 11, 2026

Copy link
Copy Markdown

No uploads on this PR yet

This PR changes UI files (packages/ui-react/src/components/chat/composer.tsx, packages/ui-react/src/components/voice/conversation-field.tsx, packages/ui-react/src/components/voice/dictation-field.tsx and 3 more). Screenshots help reviewers see what changed.

  • From the CLI: uploads put before.png after.png --pr 3971
  • From an agent: ask it to attach screenshots with uploads.sh
  • By hand: drag images into the PR description and they're imported automatically
Tips for agents

Label each shot so reviewers know what they're seeing. Labels apply to every file in a call, so run one put per shot:

uploads put after.png --pr 3971 --meta path=/settings --state after --caption "Saved settings toast"
uploads put chat.png --pr 3971 --app ios --screen "Chat" --state after

No CLI? With the Uploads MCP, call sign_upload_url for files on disk (or put) with repo, pr: 3971 and the same screen, state and caption fields.

This comment updates with each upload, so you don't need to post the images yourself. A shot or two in the PR description is still welcome. Check what's attached with uploads list --pr 3971. More in the github-screenshots skill or the agent docs.

Workspace admins can turn this comment off in Settings → GitHub · docs

@schlessera
schlessera marked this pull request as draft November 11, 2026 09:32
@schlessera
schlessera marked this pull request as ready for review November 11, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui-react React chat/files/voice components, stores, WebSocket transport. type: feat A new capability or a change in user-visible behaviour.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui-react: integrated accessibility for voice — announcements, focus and keyboard flows

1 participant