Repository navigation
fix(mobile): show dictation mic starting, hold-mode and screen-reader state - #35441
Conversation
…and screen-reader status The chat mic only got isRecording/isProcessing, so it looked idle while starting; it now shows the live look the terminal mic does. The terminal status row says 'Release mic to stop' in hold mode, both mics expose role and busy state, and one live region announces Starting mic / Listening / Processing. Fixes #35422
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
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. Comment |
[Medium impact] The PR appears safe to merge; no actionable defects were found. SummaryThe PR makes mobile dictation startup visible and adds shared screen-reader announcements.
No actionable issues were found. Tests and device checks were not run during this review. Reviews (1) · Last reviewed commit: "fix(mobile): show the dictation mic's st..." · Reviewed by Greptile |
ELI5
When you tap the mic in a phone chat, there's a short moment while the mic opens. The chat mic looked untouched during that moment, so it seemed like nothing happened. In hold-to-talk mode the terminal said "Tap mic to stop" while you were holding it, and screen readers weren't told when the mic started, was listening or was transcribing.
What Changed
MobileSessionActiveContentonly passedisRecording/isProcessingto the chat mic. It now passesmicActive = isStarting || isRecording(the terminal mic'sdictationActive) plusmicStarting, carried down the same way asmicProcessing, queued-edit composer included.accessibilityRole="button"andaria-busywhile starting or transcribing. One hidden polite live region inMobileSessionContentRow(the parent of both the chat overlay and the terminal dock) announces "Starting mic", "Listening" and "Processing", the titles the terminal status row already uses, which now share one function. That matches desktop'sDictationIndicator, which announces its lifecycle label througharia-live.Why
The session screen ships as react-native-web inside a WebView. There
accessibilityLiveRegionbecomesaria-liveandaria-busypasses through, so this works with VoiceOver and TalkBack on the shipped page. RN Pressable readsaria-busynatively too. One region at the shared parent, instead of one per mic, means a state change is announced once, whichever mic started it. The starting look reuses the existing recording look, with no new visuals, as the terminal mic already does. ReplacingmicActive/micProcessingwith a single status prop was considered and left out to keep this diff small: it would rename props across every layer and test double.Linked Issue
Fixes #35422
Visual Proof
N/A for a capture: no new visuals. While starting, the chat mic shows the stop look it already shows while recording, and the starting window is usually a fraction of a second. The other changes are a copy change ("Release mic to stop" in hold mode) and screen-reader attributes and announcements, which don't show on screen.
Testing
Focused:
mobile/src/session(302 files, 2702 tests) passes, including the dependents of every changed module.New test in
MobileNativeChatComposerMic.test.ts: a starting mic is labelled "Starting dictation" and reports busy. It fails on main's mic.check:code-quality:changedandcheck:react-doctor:changedare clean. The review round's Codex run also ran the mobile typecheck, which passed.Not run on a device. The change was traced through the code paths for iOS and Android (react-native-web page) and for tap and hold modes.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
One review-loop round, clean from both Codex and a Claude reviewer. In the simplify pass, a duplicated status struct now reuses
UseMobileDictationResult. I skipped the single status prop (see Why) and a shared label helper (it would reword the terminal mic's existing labels). The suggestion that the live region needsAccessibilityInfo.announceForAccessibilityon iOS doesn't apply: the screen renders through react-native-web, where the region isaria-live.Agent skill upstream boundary
Notes
Mobile only. There are no wire or host changes, so mixed client and host versions behave as before. Hold-mode copy keys off the dictation mode the host already reports. Unknown modes fall back to the tap wording.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)