mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
* feat(mobile): announce dictation to VoiceOver through the shell * feat(mobile): speak dictation from the host, so leaving the session and the pill's toasts are announced too * fix(mobile): say dictation outcomes where they are known, and re-read a repeated live message * fix(mobile): leave a setup refusal to its setup sheet instead of reading the raw code * fix(mobile): say cancelled when a kept recording is discarded
13 lines
633 B
TypeScript
13 lines
633 B
TypeScript
import { AccessibilityInfo, Platform } from 'react-native'
|
|
import { a11yAnnounceParamsSchema } from '../mobile-web-shell/bridge/bridge-native-verbs'
|
|
|
|
// VoiceOver ignores the page's live regions inside the shell's WebView, so the shell announces for it; TalkBack reads them, so Android leaves it to the page.
|
|
export function serveNativeAnnounceVerb(params: unknown): { announced: boolean } {
|
|
const { message } = a11yAnnounceParamsSchema.parse(params)
|
|
if (Platform.OS !== 'ios') {
|
|
return { announced: false }
|
|
}
|
|
AccessibilityInfo.announceForAccessibilityWithOptions(message, { queue: true })
|
|
return { announced: true }
|
|
}
|