Files
OSGKeyboard/OSGKeyboardShared/Services/KeyboardOpenSurfacePolicy.swift
T
Rocky 9da32b81e9 feat(keyboard): harden clipboard command and add What's New sheet
Stabilize clipboard long-press prepare/resume across paste alerts and cold start, add an in-app release-notes sheet with remote bilingual HTML, localize typing input settings, and bump build to 55.
2026-08-08 00:20:42 +08:00

23 lines
701 B
Swift

// KeyboardOpenSurfacePolicy.swift
// OSGKeyboard · Shared
//
// Pure open-surface decision used by the keyboard extension. Extracted so
// paste-alert sticky resume can be unit-tested without UIKit.
import Foundation
public enum KeyboardOpenSurfacePolicy: Sendable {
/// Surface to show on the first frame of a keyboard presentation.
public static func resolve(
locksTypingSurface: Bool,
clipboardCommandActive: Bool,
stickyPreferVoice: Bool,
preferred: KeyboardState.Surface
) -> KeyboardState.Surface {
if locksTypingSurface || clipboardCommandActive || stickyPreferVoice {
return .voice
}
return preferred
}
}