Skip to content

feat(mobile): read dictation progress to VoiceOver and TalkBack - #40504

Merged
AmoabaKelvin merged 5 commits into
mainfrom
mobile-dictation-announce
Nov 9, 2026
Merged

AmoabaKelvin merged 5 commits into
mainfrom
mobile-dictation-announce

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

With VoiceOver or TalkBack on, the phone now tells you what dictation is doing: "Listening. Transcribing on Kelvin's MacBook Pro.", "Still listening." when you leave the chat or terminal, "Finishing." when the computer is slow, then where the words went ("Inserted.", "Typed into ") or "Dictation cancelled." A failure is read out too, including "Your recording is kept" when Retry can bring it back.

Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8
Prod 28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​435 $\color{#cf222e}{\Huge{\mathbf{−}}}$​46 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​389

What Changed

The last part of the approved mobile dictation design (W4.7), after #40185, #40276 and #40421.

  • Before: the session page runs in a WebView, where react-native-web's announceForAccessibility does nothing. A screen reader heard only labels. Starting, the move to the computer, a slow finish, a cancel, a failure or the words landing were silent. The page's toasts aren't read either.
  • After:
    • New optional bridge verb native.a11y.announce. On iOS the shell queues the message with AccessibilityInfo.announceForAccessibilityWithOptions. On Android it answers announced: false, because TalkBack reads the WebView's live regions directly. The session route lists it as an optional grant, and the page feature-detects it, so older shells still work.
    • What gets said, and who says it:
      • The dictation host (MobileDictationHostProvider, above every screen of the host document) says the dictation's own moments through useMobileDictationAnnouncements:
        • "Listening", naming the engine;
        • "This phone stopped transcribing. Continuing on ." when Automatic moves to the computer;
        • "Still listening." when you leave the session while recording;
        • "Finishing." after 1 s of finishing;
        • "Dictation cancelled." after any ✕;
        • "Dictation stopped. . Your recording is kept." for a kept failure;
        • the pill's toasts ("Typed into …", "Inserted in …", failures while away).
      • The session screen says where the words went, because only it knows: "Inserted." for chat, and "Dictation inserted" or the clipboard fallback for the terminal.
      • The host's failure report says a failure while the session is in front, since its toast isn't read. A setup refusal opens the setup sheet instead, which is read on its own.
    • Where the shell can't speak (Android, older shells), the text goes into a hidden polite live region in the pill layer. Each message gets a fresh node, so the same words twice are read twice.
    • Every ✕ goes through the host's cancel. That covers in place, the pill and the terminal's long press, so a cancel is never read as a landing.
  • Strings: all in 11 locales.

Why

  • A bridge verb, not a page-only fix: VoiceOver doesn't read a WebView's ARIA live regions reliably, and react-native-web's announce is a no-op, so only the native shell can speak on iOS.
  • Feature detection: keeps mixed versions working without a store-release gate.
  • The announcer lives in the dictation host, not the session screen: since feat(mobile): keep dictating after leaving the session, with a floating pill #40421 the dictation outlives its screen. A screen-level announcer would read leaving the screen as a cancel and would miss everything said while away.
  • Outcomes come from whoever knows them: a status change can't tell whether the insert worked, so the screen and the host's failure report say those themselves.

Linked Issue

Part of the W4.7 mobile dictation work (no GitHub issue).

Visual Proof

Android emulator, dev client, against a headless serve from this branch with Parakeet TDT v2. The words come from a speech clip fed through a scratch page patch, which is not in this PR. What TalkBack reads was taken from the page's live region over CDP; the transcripts are under Testing.

Recording in place (phone engine) Left the terminal: "Still listening." Stop from the pill: "Typed into …"
android-in-place-phone.png android-pill-away.png android-typed-toast.png

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

Android emulator, final code. The live region's text was read over CDP after each step:

  • Start in place on the phone engine: "Listening. Transcribing on this phone." Labels: "Cancel dictation", "Recording, 6 seconds, on this phone", "Stop and insert".
  • Leave while recording: "Still listening."
  • ✕ on the pill: "Dictation cancelled."
  • Start again, then ✕ in place: "Dictation cancelled." again (the repeat is a new node).
  • Stop with nothing said: "No speech detected." once.
  • Start on the computer engine: "Listening. Transcribing on Kelvin's MacBook Pro."
  • Silence stop in place: "Stopped after a minute of silence", then "Dictation inserted".
  • Start, leave, Stop from the pill: "Still listening.", "Finishing.", "Typed into ..tmp/omdp-repo".
  • Model not ready: the setup sheet opens and nothing raw is read. The first build read "voice_model_not_ready:unavailable" here; that is fixed in the last commit.

iOS simulator, earlier commit. The shell's native.a11y.announce was checked on an earlier commit of this branch, with the announcer still on the session screen: the shell logged each queued announcement. The shell side hasn't changed since.

Automated: no new tests. What is said is copy, and when it is said is effect timing; both are on the repo's don't-test list, and the device runs above cover them. Two existing tests only gained mocks for the new imports (AccessibilityInfo, the host profile), and mobile-dictation-session-outcomes.test.tsx passes unchanged with the announcer in the host.

Suites and checks:

  • 1046 tests across 209 files (session, dictation, hooks, platform, mobile-web-shell, terminal session), plus 445 across components.
  • Mobile tsc (app and tests), anti-slop oxlint, check:code-quality:changed, check:react-doctor:changed and verify:mobile-localization.

Not run: a real device with VoiceOver or TalkBack speaking aloud.

Risk

  • Bridge verb: optional, so older shells drop the grant and the page falls back to the live region.
  • Cancel path: cancel is now the host's wrapper (it notes the cancel, then cancels), so every ✕ path runs through one more function.
  • Failures: failure toasts in place are now also announced.
  • Worst case: something is read twice or not at all; nothing changes for sighted users.
  • Back out: plain revert.

Level: Low

AI Disclosure

Review

Two review rounds (Claude only; Codex is at its usage limit). Fixed:

  • A refused start was read as "Dictation cancelled." Now only a ✕ says cancelled, and the refusal's reason is spoken where it's reported.
  • A failure while away was read twice (the announcer and the host's toast). Now the failure report and the toast own it.
  • "Inserted." was said even when the insert failed and the words went to the clipboard. The screen now says what really happened.
  • On Android, a repeated message wasn't re-read by the live region. Each message is now a new node.
  • Discard on a kept recording said nothing. It now says "Dictation cancelled."
  • Found on the emulator: a setup refusal read the raw code voice_model_not_ready:unavailable. The setup sheet now speaks for it.

Left as is:

  • The generic kept-failure line repeats "Dictation stopped" (P3, under For Kelvin).

The simplify pass was done by hand on the final diff; nothing to change.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

For Kelvin

New strings (all 11 locales), heard only with a screen reader:

  • dictation.announce.listeningOnPhone "Listening. Transcribing on this phone." / .listeningOn "Listening. Transcribing on {{computer}}." / .listeningOnComputer "Listening. Transcribing on the computer."
  • .stillListening "Still listening."
  • .finishing "Finishing." (only after 1 s)
  • .inserted "Inserted." and .cancelled "Dictation cancelled."
  • .movedTo "This phone stopped transcribing. Continuing on {{computer}}." / .movedToComputer "…on the computer."
  • .stoppedKept "Dictation stopped. {{reason}}. Your recording is kept."

Behaviour to try with VoiceOver on (needs a shell build with this PR; the verb is native):

  • Dictate into a chat and Stop: "Listening…", then "Inserted."
  • Dictate, press Back, then Stop on the pill: "Still listening.", then "Inserted in Claude Chat".
  • Dictate and tap ✕: "Dictation cancelled."

Known: when the kept failure has no specific reason, it reads "Dictation stopped. Dictation stopped. Your recording is kept." Fixing that needs one more string; say if you want it.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The mobile dictation flow adds translated announcements for status changes, host messages, and session insertion outcomes. The app can send announcements through native accessibility support or display undelivered messages in the dictation pill’s live region. The session route grants the optional announcement capability, and the announcement copy is added in 11 locales.

Merge Risk: Low · up to fabf4

Repeated identical insertion failures may not be read aloud the second time. This is a bounded accessibility gap that can be fixed before merge or accepted with owner awareness.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly summarizes the main change: adding dictation progress announcements for VoiceOver and TalkBack.
Description check Passed The description covers the required sections with detailed user-facing changes, rationale, visual proof, testing, and risk. It states that there is no linked GitHub issue; the template requires one fo…
Docstring Coverage Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description covers the required sections with detailed user-facing changes, rationale, visual proof, testing, and risk. It states that there is no linked GitHub issue; the template requires one for outside contributors but advises maintainers to avoid creating needless issues.

Full details: Docstring Coverage

Explanation

Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 17 files. (12 skipped: 12 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Nitpick comments: 1

mobile/src/session/mobile-dictation-session-outcomes.test.tsx: 1

29-33: Trivial · Maintainability & Code Quality · Quick win

Test announcement delivery for insertion outcomes.

The outcome tests do not detect missing announcements. Extend them to check delivery after successful chat and terminal insertion and clipboard fallback. Assert delivery alongside the insertion or clipboard result, without pinning translated copy.

Additional comments: 1

mobile/src/platform/accessibility-announcer.ts: 1

5-10: Trivial · Maintainability & Code Quality · Low value

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Native announcer always resolves true, even when nothing is spoken.

announceForAccessibility is fire-and-forget. This hook returns true unconditionally, so the liveText fallback in useMobileDictationSpeech never runs on native builds. This is acceptable only if the pill's live region is not needed outside the web shell. If native iOS or Android builds render the pill, the unconditional true is the intended design. Add a short comment that states this, so a later change does not assume the fallback is reachable here.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b7ffa562-800b-48ac-beec-0a33080f4a57
Commits

Reviewing files that changed from the base of the PR and between 62adb57 and fabf436.

Files selected for processing: 30

  • config/scripts/build/mobile-web-app/mobile-web-page-routes.mjs
  • mobile/src/dictation/MobileDictationPill.tsx
  • mobile/src/dictation/MobileDictationStatusAnnouncement.tsx
  • mobile/src/dictation/mobile-dictation-announce-copy.ts
  • mobile/src/dictation/mobile-dictation-host-context.ts
  • mobile/src/dictation/mobile-dictation-host.tsx
  • mobile/src/dictation/use-mobile-dictation-announcements.ts
  • mobile/src/dictation/use-mobile-dictation-live.ts
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/mobile-web-shell/bridge/bridge-native-verbs.ts
  • mobile/src/mobile-web-shell/bridge/use-native-verbs.ts
  • mobile/src/platform/accessibility-announcer.ts
  • mobile/src/platform/accessibility-announcer.web.ts
  • mobile/src/platform/native-accessibility-announce.ts
  • mobile/src/platform/use-native-device-verbs.test.tsx
  • mobile/src/platform/use-native-device-verbs.ts
  • mobile/src/session/MobileSessionContentRow.tsx
  • mobile/src/session/mobile-dictation-session-outcomes.test.tsx
  • mobile/src/session/use-mobile-session-dictation.ts
  • mobile/web-entry/web-overrides.json
Files with no reviewable changes: 1

  • mobile/src/session/MobileSessionContentRow.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

Comment on lines +75 to +79
useEffect(() => {
if (toast) {
say(toast)
}
}, [say, toast])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Supported by static analysis

Script executed:

sed -n '45,210p' mobile/src/dictation/mobile-dictation-host.tsx
sed -n '1,135p' mobile/src/dictation/use-mobile-dictation-announcements.ts

Repository: stablyai/orca

Length of output: 9999


Script executed:

rg -n -F -e 'setToast' -e 'clearToast' -e 'toast?.message' -e 'toast.message' -- mobile/src/dictation/mobile-dictation-host.tsx
nl -ba mobile/src/dictation/mobile-dictation-host.tsx | sed -n '1,360p'
rg -n -F -e 'MobileDictationHostToast' -e 'clearToast' -- mobile/src/dictation mobile/src

Repository: stablyai/orca

Length of output: 15740


Script executed:

nl -ba mobile/src/dictation/MobileDictationPill.tsx | sed -n '1,240p'
rg -n -F -e 'onTranscript' -e 'onError' -e 'start:' -e 'async function start' -e 'const start' -- mobile/src/hooks/use-mobile-dictation.ts mobile/src/hooks/mobile-dictation*
nl -ba mobile/src/hooks/use-mobile-dictation.ts | sed -n '1,280p'
rg -n -F -e 'host.start(' -e '.start(owner' -e 'dictationHost.start' -- mobile/src mobile/app

Repository: stablyai/orca

Length of output: 31167


Script executed:

nl -ba mobile/src/hooks/mobile-dictation-engine-run.ts | sed -n '65,110p;215,305p'
nl -ba mobile/src/hooks/mobile-dictation-finish.ts | sed -n '1,240p'
nl -ba mobile/src/dictation/mobile-dictation-away-insert.ts | sed -n '1,220p'
nl -ba mobile/src/dictation/MobileDictationStatusAnnouncement.tsx | sed -n '1,180p'
rg -n -F -e 'host.start' -e 'dictationHost.start' -e 'startDictation(' -- mobile/src/dictation mobile/src/session mobile/src/terminal mobile/app || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 11787


Script executed:

nl -ba mobile/src/session/use-mobile-session-dictation.ts | sed -n '1,320p'
nl -ba mobile/src/terminal/terminal-send-request.ts | sed -n '1,180p'
rg -n -F -e 'terminalInputSend' -- mobile/src/terminal/mobile-terminal-operations.ts
nl -ba mobile/src/dictation/mobile-session-native-chat-dictation-copy.ts | sed -n '1,150p'

Repository: stablyai/orca

Length of output: 15636


Announce each host toast event.

If two pending away insertions fail and produce the same toast before dismissal, the second toast is not announced. The effect receives only the message, so it does not run when the host replaces the toast with an identical message. Pass the toast object to the effect so each replacement triggers an announcement.

Suggested fix

In mobile/src/dictation/mobile-dictation-host.tsx:

-    { computerName: owner?.computerName ?? null, away, toast: toast?.message ?? null },
+    { computerName: owner?.computerName ?? null, away, toast },

In mobile/src/dictation/use-mobile-dictation-announcements.ts:

-  }: { computerName: string | null; away: boolean; toast: string | null },
+  }: { computerName: string | null; away: boolean; toast: { message: string } | null },
     if (toast) {
-      say(toast)
+      say(toast.message)
     }

@AmoabaKelvin
AmoabaKelvin merged commit a5dbd1c into main Nov 9, 2026
43 of 44 checks passed
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