hex/ios/HEXShared/FullKeyboard/View
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel c7c6dc7f1f iOS keyboard: keep a dictation the screen lock cut short
When the iPhone locks mid-dictation, the keyboard's viewWillDisappear stops
the in-keyboard recording at once and transcribes what was said. On the
iOS 27.2 simulator, iOS then gives the keyboard about 11 s before it
freezes it until the keyboard is shown again. If the keyboard is ended while
frozen (here its process was killed 20 s after the lock), the next keyboard
offered nothing: the text was lost, and the recording sat unheard in the
keyboard's tmp folder.

Now the recording of a dictation the keyboard closed during stays on disk,
recorded in the App Group (KeyboardInterruptedRecording,
keyboard.interruptedRecording, one at a time), until its text is held. Any
keyboard that finds a recording no process of its own is transcribing
transcribes it and holds the text as the first keyboard would have. A
recording older than 24 hours is deleted unheard. A transcription given up
on while the keyboard was away keeps its recording for the next keyboard
instead of deleting it.

A dictation cut short this way also says where it stopped, for 8 s beside
its Paste dictation. In the full keyboard's strip that is a notice:
"Stopped at 0:44" over "The screen locked or you left the app", with Paste.
In the dictation bar it is one line. A keyboard extension can't tell the
screen locking from another app coming forward, so the note names both.
KeyboardHeldDictation gains stoppedAfter. It is optional, so text held by an
earlier build still decodes.

Unchanged: what is said after the lock is not recorded (a keyboard
extension can't record in the background), and the held text is still
offered as Paste dictation, not inserted by itself.

Verified:
- iOS 27.2 simulator on the Mac Studio, probe build with a stand-in final
  pass and the capture-debug.js ramp voice, locked with the simulator's lock
  button.
- Before: lock at 20 s, keyboard process killed 20 s later, unlock at 80 s:
  nothing offered, and the 19.1 s recording orphaned in tmp.
- After, same run: the new keyboard process transcribed the 19.7 s left
  recording and offered it with "Stopped at 0:19".
- After, lock at 45 s, no kill: the note "Stopped at 0:44" showed, and its
  Paste inserted the 44.8 s text into the field.
- KeyboardBridgeTests.testARecordingTheKeyboardClosedDuringWaitsForTheNextKeyboard
  covers the record, its clear and expiry, the note, held-dictation
  decoding and the view model's note. Full HEXMobileTests suite on a fresh
  iOS 27.2 iPhone 17 Pro simulator: 976 tests, 4 skipped, 0 failures.
- scripts/code-shape.py --check passes. KeyboardViewController.swift is at
  1,494 non-test lines.
2026-11-23 17:25:47 -05:00
..
FullKeyboardView+Debug.swift iOS: group shared sources and split the full keyboard tests (#2448) 2026-11-22 18:18:35 -08:00
FullKeyboardView+Emoji.swift iOS: offer the emoji of the word being typed ("smile" → 😊) (#2461) 2026-11-22 22:05:22 -05:00
FullKeyboardView+FullAccess.swift fix(ios): show recording only once audio starts flowing (#2478) 2026-11-22 21:59:22 -08:00
FullKeyboardView+Recording.swift iOS keyboard: the recording transition moves to FullKeyboardView+Recording.swift (#2464) 2026-11-22 22:33:36 -05:00
FullKeyboardView+Selection.swift refactor(ios): unify dictation routing, engine identity, and Parakeet plan (#2491) 2026-11-22 22:59:41 -08:00
FullKeyboardView+Settings.swift iOS: group shared sources and split the full keyboard tests (#2448) 2026-11-22 18:18:35 -08:00
FullKeyboardView+Vocabulary.swift iOS: group shared sources and split the full keyboard tests (#2448) 2026-11-22 18:18:35 -08:00
FullKeyboardView.swift iOS keyboard: keep a dictation the screen lock cut short 2026-11-23 17:25:47 -05:00