hex/ios/HEXKeyboard
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel 81a36817b4
iOS keyboard: follow the keyboard's live traits for light and dark, not the proxy's appearance (#2050)
TestFlight build 29: in dark mode, switching to another app and back left the
full keyboard's keys in the light palette (white keys, black labels) over the
system's dark platter.

Cause: the palette took textDocumentProxy.keyboardAppearance first, and
updateKeyboardTraits() overrode the controller's interface style from it. The
host resolves a default field's appearance to .light or .dark when it sends
its text traits and doesn't send them again when only its style changes, so
the value goes stale. Reproduced on an iOS 27.2 simulator (iPhone 16 Pro Max,
Contacts' New Contact field): with the keyboard up, go home, the system
switches to light, return (the proxy now says .light), the system switches
back to dark. The keyboard window's traits went dark, and the platter with
them, but the palette stayed on the stale .light ("applyAppearance view=dark
win=dark appearance=light -> light"). In light mode the reverse also
happened: a stale .dark set overrideUserInterfaceStyle = .dark, which kept
both the full keyboard and the dictation bar dark on a light platter. On a
real iPhone the stale value most likely comes from the app switcher's light
and dark snapshots of the host. That device trigger is inferred; the
simulator reproduces the stale-value mechanism.

Change: FullKeyboardPalette.isDark(traits:) follows the trait collection
alone, and the controller no longer sets overrideUserInterfaceStyle.
Removed: the proxy's .light/.dark no longer decides the palette, and the
#904 override is gone. #904's behaviour stays: iOS itself gives the keyboard
window dark traits for a field that asks for a dark keyboard in a light app
(checked with --hosted-field dark-field: full keyboard and dictation bar
both dark).

Verified on the iOS 27.2 simulator with before and after screenshots: dark
mode round trip (dark keys after the fix), light mode round trip (light
keys), the dictation bar both ways, the dark field in a light app, and a
plain home and return. xcodebuild test: 247 tests, 0 failures, 1 skipped.
2026-11-20 15:53:21 +00:00
..
CleanupTagger iOS: clean up what I say with an on-device tagger (experiment) (#2023) 2026-11-20 01:29:41 +00:00
ContainingAppOpener.swift Open Hex from the iPhone keyboard and show live keyboard setup (#599) 2026-10-31 09:56:02 -07:00
HEXKeyboard.entitlements Set up Hex Mobile internal TestFlight releases (#1997) 2026-11-19 11:48:49 -05:00
Info.plist iOS: dictate from the keyboard without opening Hex, plus suggestions, autocorrect, and Paste (#1999) 2026-11-19 12:20:12 -05:00
KeyboardLocalDictation.swift iOS: speech model fallbacks for iPhone 11 and unavailable languages; no raw errors in the keyboard (#2048) 2026-11-20 15:04:43 +00:00
KeyboardViewController.swift iOS keyboard: follow the keyboard's live traits for light and dark, not the proxy's appearance (#2050) 2026-11-20 15:53:21 +00:00