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:
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user