feat(keyboard): add clipboard history and undo pastes

Ship optional keyboard clipboard history with settings, suggestion strip, and paste-permission guidance; let undo roll back clipboard inserts; bump build to 64.
This commit is contained in:
Rocky
2026-08-11 02:49:54 +08:00
parent 3de665d254
commit fd6e0d3e7e
30 changed files with 1478 additions and 118 deletions
@@ -0,0 +1,34 @@
// SettingsDeepLink.swift
// OSGKeyboard · Shared
//
// One-shot deep-link target for the host Settings stack (keyboard app).
import Foundation
public enum SettingsDeepLink: String, Sendable {
case clipboard
private static let pendingKey = "settings.pendingDeepLink"
public static func setPending(_ link: SettingsDeepLink?) {
guard let defaults = AppGroup.defaultsIfAvailable else { return }
if let link {
defaults.set(link.rawValue, forKey: pendingKey)
} else {
defaults.removeObject(forKey: pendingKey)
}
defaults.synchronize()
}
public static func consumePending() -> SettingsDeepLink? {
guard let defaults = AppGroup.defaultsIfAvailable else { return nil }
guard let raw = defaults.string(forKey: pendingKey) else { return nil }
defaults.removeObject(forKey: pendingKey)
defaults.synchronize()
return SettingsDeepLink(rawValue: raw)
}
}
public extension Notification.Name {
static let osgOpenSettingsDeepLink = Notification.Name("osg.OpenSettingsDeepLink")
}