Skip to content

iOS: hold the bar to dictate, Learn how I type on, a plain centred Paste, and typing logs off - #2210

Merged
R44VC0RP merged 4 commits into
devfrom
ios-strip-hold-paste-logging
Nov 21, 2026
Merged

R44VC0RP merged 4 commits into
devfrom
ios-strip-hold-paste-logging

Conversation

@R44VC0RP

Copy link
Copy Markdown
Collaborator

Four keyboard changes Ryan asked for, one commit each:

  1. Hold the bar to dictate. A 0.4 s still hold anywhere on the top bar with no word under it (empty slots, beside the Hex key, a bar with no suggestions) dictates exactly like holding the Hex key, through its own path (HexKeyGesture, hexKeyHeld / hexKeyReleased): hold to talk, release to finish, the Full Access hint without Full Access. Words keep their tap and hold (Add to vocabulary); taps on empty space do nothing; no hold while the hint or a notice shows or a dictation runs.
  2. Learn how I type is on by default. An unset switch reads on; the toggle saves an explicit false, so anyone who turned it off stays off (no migration needed). Typing and dictation (DictationEditInference, DictationPipeline fixes) both read TypingJournalSettings.isEnabled. New copy with zh-Hans.
  3. Paste is plain text, centred. No chip: SF 17 pt regular in the bar words' ink, glyph kept at the text's size, on the word line (textCenterY). Paste and Next keyboard centre on the keyboard's middle, not the strip's.
  4. Typing logs off. TypingLogSettings.turnOffOnce (migrations.typingLogsOff.v1) turns Record typing logs off once, in the app and the keyboard; recorded logs and the switch stay. No build or TestFlight default turned it on.

Verified in the iOS 27.2 simulator (iPhone 17 Pro, third-party host app, Full Access): an empty-slot hold showed the recording panel and release finished it; a hold on a suggestion and a tap on empty space did nothing; Paste moved from centre 173 pt to 201 pt of 402; the migration flipped a live experiments.typingLogs = true to false. xcodebuild test: 621 tests, 0 failures.

A tester found the Hex key (44 pt, in the strip) too small to hit quickly.
A still hold of 0.4 s (Apple's long press) anywhere on the bar with no word
under it now dictates exactly as holding the Hex key does: hold to talk,
release to finish. It reuses the Hex key's own path: a HexKeyGesture fed by
FullKeyboardView's touches, then the key's press (in-keyboard dictation arms)
and hexKeyHeld / hexKeyReleased, so without Full Access it shows the Full
Access hint, and a hold that can only open Hex opens Hex, as the key does.

The empty space is every touch nothing else takes in the bar: empty slots
(their buttons take no touches), the strip around Paste, Undo or a status,
the gaps beside the Hex key, and a bar with no suggestions. A word's slot
keeps its tap and its hold (Add to vocabulary, #2205). A tap on empty space
does nothing, and a slide past 10 pt cancels the hold. No hold while the bar
shows the Full Access hint or a notice, while a dictation records or
transcribes, or with the emoji panel or style menu up. Typing logs name the
source (bar_hold / bar_release).

Verified in the iOS 27.2 simulator (iPhone 17 Pro, a UIKit host app, Hex
keyboard with Full Access): holding an empty slot showed the recording panel
and releasing finished it; holding a suggestion ("The") and tapping empty
space did nothing; holds in the 2 pt gap left of the Hex key and past its
right edge took the Hex key's path (opened Hex, as the key does once
in-keyboard dictation is unavailable). On origin/dev the same hold did
nothing.
Settings › Privacy › Learn how I type now reads on when the switch was never
set (no key in the App Group: true). The toggle saves an explicit false when
turned off (UserDefaults.set on change), so "off" and "never set" are
distinct and nobody who turned it off is switched back on; no migration is
needed. Without an App Group (no Full Access) it stays off, as there is
nowhere to learn.

Every reader goes through TypingJournalSettings.isEnabled, so both sides
follow it: typing (TypingJournal.sharedIfEnabled in the full keyboard) and
dictation (the keyboard's DictationEditInference tracking in
learnsFromDictation, its learned fixes for in-keyboard dictation, and the
app's DictationPipeline fixes and raw-transcript sharing in
DictationController).

The switch's line now says what it does: "Learns on this iPhone from your
taps and the words you fix with Hex, never from what you write elsewhere"
(zh-Hans added; the old line is removed from the catalog).

Verified: TypingJournalLearningTests.testLearnHowITypeIsOnUntilTurnedOff
(an unset switch learns, one turned off stays off and stores nothing) in the
full xcodebuild test run.
The clipboard offer drew Paste as a chip (a filled background with a 15 pt
corner radius, 12.5 pt medium type) and centred it in the strip's bounds,
which leave out the Hex key, so it sat visibly left of the middle. Ryan
wanted no chip: plain text in the bar like a suggestion word.

- Paste (and Paste dictation) is now SF 17 pt regular in the bar words' ink
  (palette.stripText), with no background. The clipboard glyph stays, sized
  to the text's font (small scale), since it sits on the line beside the word.
- Paste and the Next keyboard chip (or the pair in a code field) centre on
  the keyboard's middle, where the middle slot's word centres
  (KeyboardStripView.barMidX = stripBarFrame.midX in the strip's
  coordinates), clamped inside the strip.
- Their line stays the bar's word line (textCenterY,
  KeyboardMetrics.stripTextCenter from #2207); the chip and line geometry
  of #2207 is unchanged.

Verified in the iOS 27.2 simulator (iPhone 17 Pro, a copied string through
simctl pbcopy): before, the chip spanned x 126-219 pt of a 402 pt keyboard
(centre 172); after, glyph and word span 169-232 (centre 201, the keyboard's
middle), on the same line as "The" in the middle slot.
The bar's "● Logging" mark shows while Settings › Privacy › Advanced ›
Record typing logs is on, and Ryan wants it gone. A one-time migration,
TypingLogSettings.turnOffOnce, switches the setting off for anyone who has it
on and records migrations.typingLogsOff.v1 in the App Group so it never runs
again: turning it back on afterwards keeps it on. It runs where either
process starts, the app's launch (before the simulator scenes' launch
argument) and the keyboard's viewDidLoad (before any typing log session), so
a keyboard updated before Hex is opened drops the mark too. The logs already
recorded stay, and so does the switch in Settings.

Nothing in a build turns it on: the key is set to true only by the switch's
consent dialog, the simulator-only --experiment-typing-logs launch argument,
and the Settings snapshot fixtures (settings-*-on scenes); no scheme,
ci_scripts or Xcode Cloud step passes either, so there was no build or
TestFlight default to remove.

Verified: TypingLogTests.testTypingLogsTurnOffOnceAndKeepWhatTheyRecorded
in the full xcodebuild test run, and in the iOS 27.2 simulator: with
experiments.typingLogs set to true and the flag removed from the keyboard's
defaults, showing the keyboard left it false and the flag true.
@R44VC0RP
R44VC0RP merged commit 0e7a103 into dev Nov 21, 2026
1 check 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