# Midra Layout application settings, version 1 Implementation: `crates/midra-layout/src/settings.rs`. This per-user JSON file is independent of the [project JSON and SVG contracts](midra-layout.md). [Complete default example](midra-layout-settings-v1.example.json). The `directories` 6 crate resolves `ProjectDirs::from("org", "beffroi", "midra-layout")`. The filename is `settings.json` beneath `config_dir()`: | Platform | Location | | --- | --- | | Linux | `$XDG_CONFIG_HOME/midra-layout/settings.json`, otherwise `~/.config/midra-layout/settings.json` | | Windows | `%APPDATA%\beffroi\midra-layout\config\settings.json` (Roaming AppData) | | macOS | `~/Library/Application Support/org.beffroi.midra-layout/settings.json` | UTF-8, pretty-printed JSON with a trailing newline; maximum input size 64 KiB. Every field is required, unknown fields are rejected, and unknown versions or unknown theme names are rejected. There are no numeric coordinates or units. | Field | Values / default | | --- | --- | | `version` | Integer `1` | | `theme` | `"midra"` (default), `"foxified_dark"`, `"corporate_light"` | | `show_toolbar_icon_names` | Boolean; default false | | `keep_aspect_ratio` | Boolean; default true | | `show_source_pattern` | Boolean; default false | Loaded once at startup before the editor appears. Explicit Options changes save all four current preferences immediately. The directory is created lazily; missing files do not trigger a write until the user changes an option. Writes use a temporary file in the same directory, file sync and atomic replacement. Multiple application instances use last-successful-write wins; no merging or live reloading is performed. Project JSON v1/v2 remains unchanged. Opening a project can restore its embedded caption, aspect-ratio and source-preview preferences for that document; it never writes application settings. Theme remains global. Editing an option afterward saves all currently active preferences as the next startup defaults. Invalid/unreadable settings fall back to defaults, report the failure in Options, and disable writes for that run to preserve the original file. Repair/move the file and restart to recover. A write failure retains in-memory preferences and the previous destination where atomic publication failed; Options offers a retry. Failure to locate a configuration directory also disables persistence with an Options error. Tests use temporary directories and never touch user settings. No layer geometry, source crops, camera state, project paths, image bytes, device addresses or clipboard contents are stored. No settings are exported to SVG. Breaking or additive schema changes under this strict contract require a version bump, updated documentation/examples/tests, and either an explicit migration or an actionable unsupported-version error.