feat(keyboard): improve typing, voice flow, and polish reliability

Reduce extension memory pressure and delivery races while adding richer candidates, tactile feedback, and safer two-level creative polishing.
This commit is contained in:
Rocky
2026-08-05 21:39:31 +08:00
parent 38e5ad570d
commit 31f5937a7f
177 changed files with 8343 additions and 3904 deletions
@@ -0,0 +1,33 @@
// KeyboardHapticIntensity.swift
// OSGKeyboard · Shared
//
// Typing-key haptic strength: Off / Light (default, system-like) / Strong
// (more mechanical). Persisted in App Group so the keyboard extension
// mirrors the host Settings General picker.
import Foundation
public enum KeyboardHapticIntensity: String, CaseIterable, Identifiable, Sendable, Codable {
case off
case light
case strong
public var id: String { rawValue }
public static let `default`: KeyboardHapticIntensity = .light
public var labelKey: String {
switch self {
case .off: return "settings.keyboardHaptic.off"
case .light: return "settings.keyboardHaptic.light"
case .strong: return "settings.keyboardHaptic.strong"
}
}
public static func fromStored(_ raw: String?) -> KeyboardHapticIntensity {
guard let raw, let value = KeyboardHapticIntensity(rawValue: raw) else {
return .default
}
return value
}
}