TestFlight build 56 (iPhone 16, iOS 27.2.1): in ChatGPT and Capy the strip's
Paste and Code from Messages chips stayed up the whole time, in place of
suggestions, even with nothing to paste.
Cause: the strip treated every .oneTimeCode field as a code field for as
long as it had focus, and a code field's chips always replaced suggestions.
Chat apps can mark their message box .oneTimeCode (inferred from a test
host: ChatGPT and Capy can't run on a simulator). Such a box reports the
same content type, keyboard type and return key as Safari's
autocomplete=one-time-code input; only autocorrection differs (a native box
leaves it at default, WebKit always sets it). Separately, Paste replaced
next-word suggestions after every word for three minutes after a copy.
Change (KeyboardClipboardTracker.offer, now given the field's keyboard type,
autocorrection and whether it is empty):
- Nothing is offered unless the field is empty, as Apple's keyboard offers a
recent copy only in an empty field (iOS 27.2 black box). Removed: Paste in
place of next-word suggestions in a field that has text.
- Code from Messages needs a .oneTimeCode field with a number-style keyboard,
or with autocorrection set either way (Safari's fields), plus Apple's
keyboard as before. A .oneTimeCode box with letters and default
autocorrection gets suggestions and, for a fresh copy, Paste.
- Trade-off: a native .oneTimeCode text field with letters and default
autocorrection no longer gets the chip (Paste for a fresh copy still shows).
Verified on an iPhone 16 simulator, iOS 27.2, with real touches. Before (build
56 and dev f4a45df8), in a .oneTimeCode UITextView, the chips stayed while
empty, typing and after words, with or without a copy. Autocorrect worked
(teh -> the), but its suggestions were hidden. After: a fresh copy gives Paste
only while empty, a copy older than three minutes or an empty clipboard gives
starters, typing gives suggestions. A number-pad code field shows Paste + Code
from Messages and the chip leaves after a digit. Safari
autocomplete=one-time-code input, inputmode=numeric input and textarea keep the
chip, it leaves on typing, and a plain input gets starters. With only Hex +
Emoji there is no chip, and Paste only for a fresh copy. Apple's keyboard in
the same chat box: normal predictions and autocorrect, and "Paste from <app>"
for a recent copy only while empty. xcodebuild test: 675 tests, 1 skipped, 0
failures, with a new KeyboardClipboardTests case.