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
+16 -2
View File
@@ -11,15 +11,21 @@ import XCTest
final class KeychainTests: XCTestCase {
override func setUpWithError() throws {
Keychain.resetTestMemoryStore()
try? Keychain.deleteAPIKey()
try? Keychain.deleteLegacyAPIKey()
try? Keychain.deleteAPIKey(for: "qwen")
try? Keychain.deleteAPIKey(for: "openai")
try? Keychain.deleteAPIKey(for: "deepseek")
}
override func tearDownWithError() throws {
try? Keychain.deleteAPIKey()
try? Keychain.deleteLegacyAPIKey()
try? Keychain.deleteAPIKey(for: "qwen")
try? Keychain.deleteAPIKey(for: "openai")
try? Keychain.deleteAPIKey(for: "deepseek")
Keychain.resetTestMemoryStore()
}
// MARK: - Round-trip
@@ -105,8 +111,16 @@ final class KeychainTests: XCTestCase {
XCTAssertEqual(config.apiKey, "sk-legacy-plaintext",
"Migrated key must surface through ProviderConfig")
XCTAssertEqual(Keychain.apiKey(), "sk-legacy-plaintext",
"Legacy value must land in Keychain after migration")
// Migration follows `settingsICloudSyncEnabled` (default on) into the
// synchronizable Keychain slot read with the same preference.
XCTAssertEqual(
Keychain.apiKey(
for: AppGroupConfiguration.defaultPolishProviderId,
preferICloudSync: true
),
"sk-legacy-plaintext",
"Legacy value must land in Keychain after migration"
)
XCTAssertNil(defaults.string(forKey: "config.apiKey"),
"Legacy UserDefaults entry must be cleared after migration")