M1.9a: engine dirs and settings backend
EngineConfig and Engine::with_config; the desktop resolves Tauri's app config and data dirs. Settings model (appearance.theme, editor.fontSize, ui.language) with typed validation, persistence in settings.json via write_atomic (1 MiB cap, unknown keys kept, corrupt file backed up with a warning notification), settings.list/get/set/reset, settingsChanged and notification events. Property test over random settings.json content, control-channel test for persistence and corrupt-file recovery. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
851d438e2a
commit
f9357ee4b5
17 changed files with 1406 additions and 41 deletions
|
|
@ -49,19 +49,15 @@ pub struct Host {
|
|||
}
|
||||
|
||||
impl Host {
|
||||
/// A host with a fresh engine.
|
||||
///
|
||||
/// # Errors
|
||||
/// The engine's error if the built-in commands cannot be registered.
|
||||
pub fn new() -> Result<Arc<Self>, EngineError> {
|
||||
let engine = Engine::new()?;
|
||||
Ok(Arc::new_cyclic(|me| Self {
|
||||
/// A host around `engine`.
|
||||
pub fn new(engine: Engine) -> Arc<Self> {
|
||||
Arc::new_cyclic(|me| Self {
|
||||
engine: Mutex::new(engine),
|
||||
app: OnceLock::new(),
|
||||
subscribers: Subscribers::default(),
|
||||
me: me.clone(),
|
||||
picking: AtomicBool::new(false),
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
/// Records the app handle once Tauri has started. Later calls are
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue