hex/ios/HEXMobileTests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel e0e8b2258b
iOS: your text replacements beat chat shorthand, and no spelling guesses with Autocorrect off (#2148)
* iOS: your text replacements win over chat shorthand

Hex leaves chat shorthand alone (brb, omg, idk, btw, … in shorthandAllowlist) so
autocorrect never turns it into a dictionary word, but that guard ran before the
text replacement lookup, so a user's own replacement with such a shortcut
("brb" -> "be right back") never applied, with Autocorrect on or off. Apple's
keyboard applies every text replacement (black box, iOS 27.2 sim: "Brb" offers and
becomes "Be right back").

Now the user's UILexicon shortcut is checked before the shorthand guard, on space
and punctuation and in the strip; only lexicon entries get past it, never Hex's own
corrections, so shorthand without a replacement ("idk") still stays as typed.
Words you kept (a tapped literal, an undone fix, Learn how I type's rejections)
still block the replacement, as before.

Verified: new AutocorrectEngineTests case (brb with Autocorrect on, omg with it off,
idk untouched, one backspace restores the shortcut); full HEXMobileTests suite
(465 tests) passes on the branch; live in Messages on an iOS 27.2 sim with a "brb"
text replacement added in Settings: Hex offers and applies it with Autocorrect on
and off.

* iOS: with Autocorrect off, the strip offers completions but no fixes

With Settings > Keyboard > Autocorrect off, Hex's strip still offered every fix it
would have applied, just without applying it: spelling guesses ("One" for "omw"),
contractions ("don't" for "dont"), learned typo fixes and Spatial autocorrect's
readings.

Apple's keyboard with Auto-Correction off (black box, iOS 27.2 sim, Predictive Text
on) offers what you typed, your text replacements and completions, and no fix:
"teh" and "dont" get nothing (with Auto-Correction on: "The", "Don't"), "im" gets
"Imagine" but no "I'm", "th" gets "The", "This", "omw" only "On my way!". Its
completions tolerate a slip ("wierd": Weird, Weirdly), which UITextChecker's
completions can't; Hex keeps its prefix completions only.

So with Autocorrect off the strip now holds the typed word, a text replacement and
completions (UITextChecker's and the typing model's short-prefix completion); learned
fixes, suggest-only contractions, Spatial readings and spelling guesses need
Autocorrect on, in either language of bilingual autocorrect. With Autocorrect on
nothing changes.

The old testTurningAutocorrectSettingOffKeepsSuggestionsWithoutAutoReplacing
expected a "dont" suggestion with Autocorrect off; it is replaced by
testTurningAutocorrectSettingOffKeepsCompletionsWithoutFixes, which checks the new
behaviour (no "don't", no "the" for "teh", "the" for "th", fixes back once on).

Verified: AutocorrectEngineTests and the full HEXMobileTests suite (465 tests) pass;
live in Messages on an iOS 27.2 sim with Hex's Autocorrect off: "Teh" and "Dont"
show only themselves, "Th" offers The and That, "Im" Important and Image, "Omw" only
"On my way!".
2026-11-21 06:43:31 +00:00
..
Fixtures iOS: emoji panel with on-device suggestions (Experiments › Emoji) (#2051) 2026-11-20 15:53:24 +00:00
AutocorrectEngineTests.swift iOS: your text replacements beat chat shorthand, and no spelling guesses with Autocorrect off (#2148) 2026-11-21 06:43:31 +00:00
CleanupTaggerTests.swift iOS: Clean up what I say keeps names, and is on by default (#2132) 2026-11-21 03:12:53 +00:00
CustomVocabularyTests.swift ios: custom vocabulary experiment (#1547) 2026-11-08 12:15:00 -05:00
DictationControllerTests.swift iOS: Polish keyboard, diacritic autocorrect, and a bilingual partner fix (#2143) 2026-11-21 04:43:47 +00:00
DictationLearningTests.swift ios: learn dictation and typing fixes from edits (Learn how I type) (#2022) 2026-11-20 01:04:58 +00:00
DotScopeTests.swift fix(ios): eliminate handoff frame stalls and add overlapping ballistic swipe throw (t1153) (#757) 2026-10-31 22:14:22 -07:00
EmojiSuggesterTests.swift iOS: emoji panel memory, category taps, an eight-column Frequently used, and the system's look (#2142) 2026-11-21 04:31:34 +00:00
FullKeyboardEngineTests.swift iOS: Adaptive touch, personal key centres learned on device (Experiment, off by default) (#2146) 2026-11-21 06:13:04 +00:00
HexKeyGestureTests.swift iOS: fewer paste prompts, and a translate switch in the keyboard (#2134) 2026-11-21 03:24:58 +00:00
KeyboardBridgeTests.swift iOS: onboarding follows the desktop flow (#2136) 2026-11-21 03:27:38 +00:00
KeyboardLayoutTests.swift iOS: Polish keyboard, diacritic autocorrect, and a bilingual partner fix (#2143) 2026-11-21 04:43:47 +00:00
ShiftStateMachineTests.swift iOS: full keyboard experiment flag, key layout and shift model (#910) 2026-11-01 12:43:35 -08:00
SwipeDecoderTests.swift iOS: swipe typing for English and Spanish (Experiment, off by default) (#2106) 2026-11-20 22:30:53 +00:00
TranscriptCleanupTests.swift iOS: text replacements without autocorrect, End with a period, and emoji and symbols on the Dictation bar (#2147) 2026-11-21 06:24:16 +00:00
TypingLogTests.swift iOS: opaque keyboard panel so stale system layers can't show through, and a nil-safe field ID (#2139) 2026-11-21 03:45:47 +00:00