This document defines the current settings model in Zync, the global settings.json workflow, and how local scope is treated today.
| Scope | Status | Source | Notes |
|---|---|---|---|
| Global/User | Active (source of truth) | Native user path Zync/User/settings.json |
Used by frontend + backend as canonical persisted configuration |
| Local/Workspace override | Not active yet | N/A | Planned as optional overlay, not currently applied at runtime |
Zync uses one canonical user settings file:
- Windows:
%APPDATA%/Zync/User/settings.json - Linux:
~/.config/Zync/User/settings.json - macOS:
~/Library/Application Support/Zync/User/settings.json
Backend path ownership and resolution live in src-tauri/src/commands.rs (get_native_settings_path, read_effective_settings, settings_set, settings_read_raw, settings_write_raw).
- Frontend writes patches through
config:set(src/lib/tauri-ipc.ts). - Backend applies merge + validation through
settings_set. - This is the canonical path for regular settings UI controls.
- In-app
settings.jsoneditor writes full JSON content throughsettings_write_raw. - Used for advanced/manual edits where exact JSON control is required.
Zync provides an in-app editor tab (not external VS Code handoff) for global settings:
- full in-app editing surface
- Save (
Ctrl/Cmd+S) to write file contents - Reload to refresh from disk
- Restore from
settings.last-known-good.json - external-file-change awareness and conflict-safe save behavior
- atomic writes (temp + rename) to prevent partial/corrupt saves
- optimistic concurrency checks using file metadata
- validation before promoting backups as last-known-good
- invalid patch inputs blocked before backend invocation
- invalid patch logging is metadata-only (no raw patch payload emission)
- app-wide appearance preferences (theme, global font family/size, accent)
- persisted feature/settings configuration in user
settings.json - update/config toggles and system-level options
- local terminal behavior/settings sections in the Settings UI
- per-connection/per-tab runtime state in store/session flows
These are not implemented as a separate workspace settings.json override layer yet.
Planned direction:
- keep global settings as stable base
- optionally enable local/workspace settings overlay
- apply explicit precedence only when enabled (
global -> local)
No local override file should be assumed active unless explicitly implemented in runtime resolution.
If canonical native settings are missing, backend performs one-time migration from legacy candidates (for example old app-data path or ~/.zync/settings.json).
src/components/settings/SettingsModal.tsxsrc/components/settings/SettingsJsonEditorPanel.tsxsrc/components/settings/tabs/AppearanceTab.tsxsrc/components/settings/hooks/useSettingsUpdateFlow.tssrc/store/settingsSlice.tssrc/lib/tauri-ipc.ts
src-tauri/src/commands.rs