mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
* feat(ios): match iOS 26 Liquid Glass keyboard geometry, palette, and Hex key controls
* feat(ios): add 3-slot suggestion strip, cautious autocorrect, and typing gestures
* test(ios): cover iOS 26 keyboard metrics, autocorrect, gestures, and hosted stage
* iOS: move Hex for iPhone to Anomaly's Apple team
(cherry picked from commit 09061502ff)
* Cut Hex Mobile TestFlight betas with a dedicated release tag
Connect the Anomaly app record and pin the mobile package graph. Cut ios-beta prereleases from dev at the scheduled windows or on dispatch, skipping unchanged mobile inputs instead of creating desktop releases or allocating build numbers locally. Prepare the generated project for the Cloud archive after clone.
Verified actionlint, duplicate and desktop-only skips, strict SwiftPM resolution, and an unsigned Release device archive containing the app, keyboard, and widgets. First Xcode Cloud onboarding and signed distribution are still pending.
* Dictate inside the iOS keyboard without opening Hex (probe)
When no warm session is running, the keyboard now records and transcribes on its own instead of opening Hex. iOS refuses to record from a keyboard extension directly (audiomxd: extension lacks the record-audio entitlement), so capture runs through getUserMedia in a hidden WKWebView, whose media process records under Hex's microphone permission. PCM is streamed to Swift, written to a WAV file, and transcribed with on-device Apple Speech (SpeechTranscriber), downloading its assets from the keyboard on first use. Steps and memory are logged to the App Group.
Replaces the cold-start handoff that opened Hex and returned to the host app. Not gated yet: needs an Experiments toggle before it ships. Verified on an iPhone 17 Pro (iOS 27.2) with Hex quit: dictation in Mail/Notes inserted text; the keyboard's footprint was about 58 MB with 118 MB headroom. Unsigned simulator tests were not run.
* Regenerate the keyboard Info.plist with its microphone and speech descriptions
XcodeGen writes these from project.yml; the previous commit changed project.yml without the generated plist. Verified by building for the device.
* Start in-keyboard dictation from the full keyboard's Hex key
Holding the Hex key without a warm session opened Hex through the cold-start handoff; it now records and transcribes inside the keyboard when that path is available, and only falls back to opening Hex otherwise. Verified it builds and installs on the iPhone 17 Pro.
* Dictate with a tap on the Hex key and the bar's Hex mark
The full keyboard's Hex key ignored taps and needed a 0.35 s hold; a tap now dictates too (sliding still opens the style menu). The dictation bar's Hex mark opened Hex through the cold-start handoff; with no warm session it now starts in-keyboard dictation instead. Removes the stray-tap-does-nothing guard because Ryan wants the key to act like a dictation button.
Verified HexKeyGestureTests (5 passed) in the iPhone 18 Pro simulator and installed on the iPhone 17 Pro.
* Offer Paste and one-time-code help in the full keyboard's strip
When something was copied in the last 3 minutes and not yet pasted from the keyboard, the empty strip shows the system Paste button (UIPasteControl), which hands the clipboard over only on tap, so iOS never shows its paste prompt; nothing reads the clipboard before then. In one-time-code fields the strip also offers switching keyboards, because iOS gives codes from Messages and Mail only to its own keyboard. Copies seen and pasted are tracked by changeCount in the App Group. UIPasteControl's configuration is immutable, so a palette change replaces the control (setting colors on it raised NSInternalInconsistencyException in FullKeyboardEngineTests).
Verified the full HEXMobileTests suite passes on the iPhone 18 Pro simulator and the build installs on the iPhone 17 Pro; the Paste button itself is not yet tried on the device.
* Describe in-keyboard dictation in the iOS README
The status paragraph said the keyboard never touches the microphone; it now records through WebKit and transcribes with Apple Speech when no warm session runs. The cold-start handoff remains only before iOS 26.
---------
Co-authored-by: Kit Langton <kit.langton@gmail.com>
136 lines
5.8 KiB
Swift
136 lines
5.8 KiB
Swift
import SwiftUI
|
|
|
|
/// Unfinished features, off until turned on here. They live in the App Group so the
|
|
/// keyboard reads them too.
|
|
struct ExperimentsCard: View {
|
|
@State private var fullKeyboard = FullKeyboardSettings().isEnabled
|
|
@State private var appleIntelligenceCleanup = AppleIntelligenceCleanupSettings().isEnabled
|
|
@State private var customVocabulary = CustomVocabularySettings().isEnabled
|
|
@State private var cleanupAvailability = AppleIntelligenceCleanupAvailability.current
|
|
@State private var autocorrect = FullKeyboardSettings().autocorrect
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
Text("Experiments")
|
|
.font(.system(size: 13, weight: .medium))
|
|
.foregroundStyle(HexTheme.textMuted)
|
|
.padding(.leading, 16)
|
|
|
|
VStack(spacing: 0) {
|
|
Toggle(isOn: $fullKeyboard) {
|
|
VStack(alignment: .leading, spacing: 2) {
|
|
Text("Full keyboard")
|
|
.font(.system(size: 15, weight: .regular))
|
|
.foregroundStyle(HexTheme.textBase)
|
|
Text("Type with Hex, with a Hex key to dictate")
|
|
.font(.system(size: 12))
|
|
.foregroundStyle(HexTheme.textMuted)
|
|
}
|
|
}
|
|
.tint(HexTheme.success)
|
|
.padding(.horizontal, 16)
|
|
.padding(.vertical, 10)
|
|
.onChange(of: fullKeyboard) { _, enabled in
|
|
FullKeyboardSettings().isEnabled = enabled
|
|
}
|
|
|
|
if fullKeyboard {
|
|
Divider()
|
|
.overlay(HexTheme.borderWeak)
|
|
.padding(.leading, 16)
|
|
|
|
Toggle(isOn: $autocorrect) {
|
|
VStack(alignment: .leading, spacing: 2) {
|
|
Text("Autocorrect")
|
|
.font(.system(size: 15, weight: .regular))
|
|
.foregroundStyle(HexTheme.textBase)
|
|
Text("Fix contractions, shortcuts, and one-edit typos on space")
|
|
.font(.system(size: 12))
|
|
.foregroundStyle(HexTheme.textMuted)
|
|
}
|
|
}
|
|
.tint(HexTheme.success)
|
|
.padding(.horizontal, 16)
|
|
.padding(.vertical, 10)
|
|
.onChange(of: autocorrect) { _, enabled in
|
|
FullKeyboardSettings().autocorrect = enabled
|
|
}
|
|
}
|
|
}
|
|
.background(
|
|
HexTheme.bgBase,
|
|
in: RoundedRectangle(cornerRadius: HexTheme.cardRadius, style: .continuous)
|
|
)
|
|
.onChange(of: fullKeyboard) { _, enabled in
|
|
FullKeyboardSettings().isEnabled = enabled
|
|
}
|
|
|
|
Toggle(isOn: $appleIntelligenceCleanup) {
|
|
VStack(alignment: .leading, spacing: 2) {
|
|
Text("Clean up with Apple Intelligence")
|
|
.font(.system(size: 15, weight: .regular))
|
|
.foregroundStyle(HexTheme.textBase)
|
|
Text("Fix misheard words and spoken corrections on device")
|
|
.font(.system(size: 12))
|
|
.foregroundStyle(HexTheme.textMuted)
|
|
if let reason = cleanupAvailability.reason {
|
|
Text(reason)
|
|
.font(.system(size: 12))
|
|
.foregroundStyle(HexTheme.textMuted)
|
|
}
|
|
}
|
|
}
|
|
.tint(HexTheme.success)
|
|
.disabled(!cleanupAvailability.isAvailable)
|
|
.padding(.horizontal, 16)
|
|
.padding(.vertical, 10)
|
|
.background(
|
|
HexTheme.bgBase,
|
|
in: RoundedRectangle(cornerRadius: HexTheme.cardRadius, style: .continuous)
|
|
)
|
|
.onChange(of: appleIntelligenceCleanup) { _, enabled in
|
|
AppleIntelligenceCleanupSettings().isEnabled = enabled
|
|
}
|
|
|
|
Toggle(isOn: $customVocabulary) {
|
|
VStack(alignment: .leading, spacing: 2) {
|
|
Text("Custom vocabulary")
|
|
.font(.system(size: 15, weight: .regular))
|
|
.foregroundStyle(HexTheme.textBase)
|
|
Text("Spell names and terms your way")
|
|
.font(.system(size: 12))
|
|
.foregroundStyle(HexTheme.textMuted)
|
|
}
|
|
}
|
|
.tint(HexTheme.success)
|
|
.padding(.horizontal, 16)
|
|
.padding(.vertical, 10)
|
|
.background(
|
|
HexTheme.bgBase,
|
|
in: RoundedRectangle(cornerRadius: HexTheme.cardRadius, style: .continuous)
|
|
)
|
|
.onChange(of: customVocabulary) { _, enabled in
|
|
CustomVocabularySettings().isEnabled = enabled
|
|
}
|
|
|
|
if customVocabulary {
|
|
CustomVocabularyEditor()
|
|
.padding(12)
|
|
.background(
|
|
HexTheme.bgBase,
|
|
in: RoundedRectangle(
|
|
cornerRadius: HexTheme.cardRadius,
|
|
style: .continuous
|
|
)
|
|
)
|
|
}
|
|
}
|
|
.onAppear {
|
|
fullKeyboard = FullKeyboardSettings().isEnabled
|
|
appleIntelligenceCleanup = AppleIntelligenceCleanupSettings().isEnabled
|
|
customVocabulary = CustomVocabularySettings().isEnabled
|
|
cleanupAvailability = AppleIntelligenceCleanupAvailability.current
|
|
autocorrect = FullKeyboardSettings().autocorrect
|
|
}
|
|
}
|
|
}
|