hex/ios/HEXKeyboard
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel 2d7dff5feb
iOS keyboard: a notification no longer ends an in-keyboard dictation (#2472)
A tester on build 147 (iPhone19,7, iOS 27.2.1): "Dictation stops whenever I
get any notification... Calls stopping it are fine." In-keyboard dictation
records through WebKit in a hidden web view. When iOS gives the audio
session to another sound, WebKit interrupts the page's AudioContext (no
more audio) and mutes the microphone track. It unmutes the track when
WebKit hears the interruption end, but resumes the context only when iOS
says it may (ShouldResume). Some captures fail and end the track. The
page's only defence was a 250 ms ctx.resume(). So:
- a context that didn't come back within 6 s hit the keyboard's watchdog
  ("capture silent"), which finished the dictation with the words so far;
- a track left muted or ended under a running context sent silence for
  good: the dictation went on, but nothing after the sound was heard.

- The capture page reports each track mute/unmute/ended and each context
  statechange (and any change its 250 ms check sees) to the keyboard, with
  the page's time. The keyboard writes every one to the probe log.
- Every 250 ms the page still resumes a context that isn't running. Once
  it runs, it opens the microphone again for a track that ended or stayed
  muted for 3 s (backing off 1, 2, 4, then 8 s), into the same context and
  ScriptProcessor. The same job, file, live words and Type as I speak
  carry on; the gap is missing audio.
- KeyboardCaptureWatch (HEXShared) keeps the recording's clock. While the
  page says it's interrupted, the 6 s quiet rule doesn't count, and quiet
  counts again from when it's back. Interrupted past
  KeyboardJobWatchdog.captureInterruption (15 s: a call, an alarm), it
  finishes with what was said, as before.
- Simulator only (#if targetEnvironment(simulator)): capture-debug.js in
  the App Group runs once in the capture page, and each recording is kept
  as capture-debug.wav, so interruptions can be driven by hand where there
  is no microphone or interruption.
- KeyboardSpeech and KeyboardProbeLog move unchanged to their own files to
  make room: KeyboardLocalDictation.swift 1,398 -> 1,389 lines.
- The app's own recorder (AudioBackend, finishing on interruptionBegan) is
  unchanged.
- ios/docs/dictation.md describes the behaviour.

Verified:
- HEXMobile suite on an iPhone 17 Pro iOS 27.2 simulator (Mac Studio): 952
  tests, 0 failures, including the new KeyboardBridgeTests case (interrupted
  time isn't quiet, quiet restarts at the end, the 15 s limit, a muted
  track's silence counts as interrupted).
- Release simulator build of Hex in a text field. A recorded voice (two
  sentences, 9 s apart) stood in for the microphone, and each interruption
  was driven 5 s in. The kept recordings were transcribed:
  - context suspended 2 s, track muted then unmuted 2 s, both together,
    track muted for good (reopened at +3 s), track stopped (reopened at
    once): each kept both sentences in one dictation;
  - context held suspended: finished at 15 s with the first sentence only.
- Nothing was run on an iPhone. Which of these a notification causes there
  is unverified.
2026-11-23 00:04:17 -05:00
..
CleanupTagger iOS: clean up what I say with an on-device tagger (experiment) (#2023) 2026-11-20 01:29:41 +00:00
TypingModel iOS keyboard: Polish autocorrects with Hex's own model, word list and capitals (#2423) 2026-11-22 14:45:55 -05:00
AppleLiveTranscriber.swift iOS keyboard: Show what I say and Type as I speak (words while you dictate) (#2410) 2026-11-22 13:37:37 -05:00
ContainingAppOpener.swift
HEXKeyboard.entitlements Set up Hex Mobile internal TestFlight releases (#1997) 2026-11-19 11:48:49 -05:00
Info.plist iOS keyboard: Hex's input mode says mul, not en-US, so a French iPhone never takes it for English (#2441) 2026-11-22 18:55:02 -05:00
KeyboardInputView.swift iOS keyboard: stop leaking views, capture web views, and emoji indices across shows (#2352) 2026-11-22 06:45:38 -05:00
KeyboardLiveDictation.swift iOS Settings: Home refreshes again while it shows, Into field falls back to the words over the keys, the speech model card lands on its row, docs match (#2471) 2026-11-22 23:00:12 -05:00
KeyboardLiveTyping.swift iOS Settings: Home refreshes again while it shows, Into field falls back to the words over the keys, the speech model card lands on its row, docs match (#2471) 2026-11-22 23:00:12 -05:00
KeyboardLocalDictation.swift iOS keyboard: a notification no longer ends an in-keyboard dictation (#2472) 2026-11-23 00:04:17 -05:00
KeyboardParakeet.swift iOS: Home card for Hex's own speech model, and Speech model in keyboard moves to Settings › Dictation (#2437) 2026-11-22 18:03:28 -05:00
KeyboardProbeLog.swift iOS keyboard: a notification no longer ends an in-keyboard dictation (#2472) 2026-11-23 00:04:17 -05:00
KeyboardSpeech.swift iOS keyboard: a notification no longer ends an in-keyboard dictation (#2472) 2026-11-23 00:04:17 -05:00
KeyboardViewController.swift iOS Settings: Home refreshes again while it shows, Into field falls back to the words over the keys, the speech model card lands on its row, docs match (#2471) 2026-11-22 23:00:12 -05:00
ParakeetLiveTranscriber.swift iOS keyboard: Show what I say and Type as I speak (words while you dictate) (#2410) 2026-11-22 13:37:37 -05:00
PrivacyInfo.xcprivacy iOS: version 1.0, iPhone only, privacy manifests (#2052) 2026-11-20 15:54:01 +00:00