fix: PersonalDictionaryView preview and AppGroupStore dictionary writes

Use ThemedRoot in preview instead of inaccessible ThemePalette().
Add setPersonalDictionary(_:) for let AppGroupStore bindings; use
it from PersonalDictionaryView and DictionaryLearner.

Co-authored-by: Rocky <hkgood@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-07-03 08:19:28 +00:00
parent 982c164e02
commit a115d90da7
3 changed files with 19 additions and 12 deletions
+12 -8
View File
@@ -341,14 +341,18 @@ public struct AppGroupStore: @unchecked Sendable {
}
}
set {
do {
let data = try JSONEncoder().encode(newValue)
defaults.set(data, forKey: Key.personalDictionary)
} catch {
#if DEBUG
print("⚠️ [AppGroupStore] personalDictionary encode failed: \(error)")
#endif
}
setPersonalDictionary(newValue)
}
}
public func setPersonalDictionary(_ dictionary: PersonalDictionary) {
do {
let data = try JSONEncoder().encode(dictionary)
defaults.set(data, forKey: Key.personalDictionary)
} catch {
#if DEBUG
print("⚠️ [AppGroupStore] personalDictionary encode failed: \(error)")
#endif
}
}