feat(keyboard): unify assistant voice and AI workflows

Merge dictation and AI controls into one assistant surface, preserve safe insertion and clipboard actions, and align settings and tests with the new flow.
This commit is contained in:
Rocky
2026-08-16 12:07:06 +08:00
parent 46f6d818b8
commit fb97ec2937
45 changed files with 1969 additions and 2143 deletions
@@ -37,7 +37,7 @@ struct KeyboardSurfaceRoot: View {
Group {
switch state.surface {
case .voice:
KeyboardRootView(
AIKeyboardView(
state: state,
typing: typing,
onInsert: wrappedInsert
@@ -50,6 +50,8 @@ struct KeyboardSurfaceRoot: View {
onDeleteBackward: wrappedDeleteBackward
)
case .ai:
// Legacy persisted surface; controller canonicalizes it to
// `.voice`, but render the unified assistant defensively.
AIKeyboardView(
state: state,
typing: typing,
@@ -174,8 +174,7 @@ final class TypingKeyTouchPadUIView: UIView {
bottomRowMinY: 0
)
/// Same trick as CursorDragPad: non-zero alpha so SwiftUI hosting does
/// not treat the pad as pass-through.
/// Non-zero alpha keeps SwiftUI hosting from treating the pad as pass-through.
private static let padTint = UIColor { traits in
UIColor.systemGray4.resolvedColor(with: traits).withAlphaComponent(0.02)
}