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
@@ -101,10 +101,7 @@ public actor RimeResourceInstaller {
for resource in ["osg_pinyin.dict", "manifest"] {
let ext = resource == "manifest" ? "json" : "yaml"
guard let source = Bundle(for: RimeResourceBundleToken.self).url(
forResource: resource,
withExtension: ext
) else {
guard let source = Self.bundledURL(forResource: resource, withExtension: ext) else {
throw RimeResourceError.bundledResourceMissing("\(resource).\(ext)")
}
try fileManager.copyItem(
@@ -140,7 +137,9 @@ public actor RimeResourceInstaller {
distributionVersion: Self.resourceVersion
)
do {
try bridge.deploy(withFullCheck: true)
// Version bumps already rebuild SharedSupport from scratch; skip the
// heavier full integrity pass unless the caller forced a redeploy.
try bridge.deploy(withFullCheck: force)
} catch {
bridge.finalizeRuntime()
throw error
@@ -166,4 +165,18 @@ public actor RimeResourceInstaller {
}
}
extension RimeResourceInstaller {
/// Host app owns the dictionary YAML; prefer `Bundle.main`, fall back to
/// the Shared token bundle for unit tests that inject fixtures.
fileprivate static func bundledURL(forResource name: String, withExtension ext: String) -> URL? {
if let url = Bundle.main.url(forResource: name, withExtension: ext) {
return url
}
return Bundle(for: RimeResourceBundleToken.self).url(
forResource: name,
withExtension: ext
)
}
}
private final class RimeResourceBundleToken: NSObject {}