{ "$comment": "Settings contract: keys, types, defaults, labels, descriptions, and CSS-var bindings. Read by Rust (apps/desktop/src-tauri/src/config.rs) via include_str! and by the frontend via a static import (lib/settings-schema.ts). Theme preset *values* are not part of the contract — they live in shared/themes/*.json, one file per preset. Per docs/consolidation.md: do not declare defaults, labels, or types anywhere else.", "settings": [ { "key": "editor.font-size", "label": "Font Size", "description": "Font size in pixels for the editor", "category": "Editor", "type": "number", "default": 16, "cssVar": "--writer-editor-font-size", "cssFormat": "px" }, { "key": "editor.line-height", "label": "Line Height", "description": "Line height multiplier for the editor", "category": "Editor", "type": "number", "default": 1.8, "cssVar": "--writer-editor-line-height" }, { "key": "editor.tab-size", "label": "Tab Size", "description": "Number of spaces per tab", "category": "Editor", "type": "number", "default": 2 }, { "key": "appearance.theme", "label": "Schema", "description": "Light or dark color schema", "category": "Appearance", "type": "enum", "options": ["system", "light", "dark"], "default": "system" }, { "key": "appearance.sidebar-width", "label": "Sidebar Width", "description": "Default sidebar width in pixels", "category": "Appearance", "type": "number", "default": 240 }, { "key": "appearance.sidebar-visible", "label": "Sidebar Visible", "description": "Show the sidebar by default", "category": "Appearance", "type": "boolean", "default": true }, { "key": "appearance.sidebar-file-label", "label": "Sidebar File Label", "description": "Show the document title or the filename for files in the sidebar", "category": "Appearance", "type": "enum", "options": ["title", "filename"], "default": "title" }, { "key": "appearance.editor-width", "label": "Editor Width", "description": "Editor content width mode", "category": "Appearance", "type": "enum", "options": ["full", "narrow"], "default": "full" }, { "key": "theme.light.preset", "label": "Preset", "description": "Light theme preset", "category": "Theme", "$comment": "Valid values are populated at runtime from shared/themes/*.json plus the special \"custom\" sentinel; we intentionally don't enum-constrain the contract so adding a preset doesn't require a schema edit.", "type": "string", "default": "Writer" }, { "key": "theme.light.accent", "label": "Accent", "description": "Light theme accent color", "category": "Theme", "type": "color", "cssVar": "--accent", "default": "#FF6A00" }, { "key": "theme.light.background", "label": "Background", "description": "Light theme background color", "category": "Theme", "type": "color", "cssVar": "--bg-base", "default": "#FFFFFF" }, { "key": "theme.light.foreground", "label": "Foreground", "description": "Light theme foreground color", "category": "Theme", "type": "color", "cssVar": "--fg-base", "default": "#0D0D0D" }, { "key": "theme.light.ui-font", "label": "UI font", "description": "Light theme UI font stack", "category": "Theme", "type": "string", "cssVar": "--ui-font", "default": "-apple-system-body, ui-sans-serif, -apple-system, system-ui, \"Segoe UI\", Helvetica, \"Apple Color Emoji\", Arial, sans-serif, \"Segoe UI Emoji\", \"Segoe UI Symbol\"" }, { "key": "theme.light.editor-font", "label": "Editor font", "description": "Light theme editor body font stack", "category": "Theme", "type": "string", "cssVar": "--editor-font", "default": "-apple-system-body, ui-sans-serif, -apple-system, system-ui, \"Segoe UI\", Helvetica, \"Apple Color Emoji\", Arial, sans-serif, \"Segoe UI Emoji\", \"Segoe UI Symbol\"" }, { "key": "theme.light.translucent", "label": "Translucent", "description": "Light theme translucency (0 = solid, 100 = max).", "category": "Theme", "type": "range", "min": 0, "max": 100, "step": 1, "default": 10 }, { "key": "theme.light.contrast", "label": "Contrast", "description": "alpha multiplier on borders, cards, hover bgs.", "category": "Theme", "type": "range", "min": 0, "max": 100, "step": 1, "default": 20 }, { "key": "theme.dark.preset", "label": "Preset", "description": "Dark theme preset", "category": "Theme", "$comment": "Valid values are populated at runtime from shared/themes/*.json plus the special \"custom\" sentinel; we intentionally don't enum-constrain the contract so adding a preset doesn't require a schema edit.", "type": "string", "default": "Writer" }, { "key": "theme.dark.accent", "label": "Accent", "description": "Dark theme accent color", "category": "Theme", "type": "color", "cssVar": "--accent", "default": "#FF6A00" }, { "key": "theme.dark.background", "label": "Background", "description": "Dark theme background color", "category": "Theme", "type": "color", "cssVar": "--bg-base", "default": "#111111" }, { "key": "theme.dark.foreground", "label": "Foreground", "description": "Dark theme foreground color", "category": "Theme", "type": "color", "cssVar": "--fg-base", "default": "#FCFCFC" }, { "key": "theme.dark.ui-font", "label": "UI font", "description": "Dark theme UI font stack", "category": "Theme", "type": "string", "cssVar": "--ui-font", "default": "-apple-system-body, ui-sans-serif, -apple-system, system-ui, \"Segoe UI\", Helvetica, \"Apple Color Emoji\", Arial, sans-serif, \"Segoe UI Emoji\", \"Segoe UI Symbol\"" }, { "key": "theme.dark.editor-font", "label": "Editor font", "description": "Dark theme editor body font stack", "category": "Theme", "type": "string", "cssVar": "--editor-font", "default": "-apple-system-body, ui-sans-serif, -apple-system, system-ui, \"Segoe UI\", Helvetica, \"Apple Color Emoji\", Arial, sans-serif, \"Segoe UI Emoji\", \"Segoe UI Symbol\"" }, { "key": "theme.dark.translucent", "label": "Translucent", "description": "Dark theme translucency (0 = solid, 100 = max).", "category": "Theme", "type": "range", "min": 0, "max": 100, "step": 1, "default": 20 }, { "key": "theme.dark.contrast", "label": "Contrast", "description": "alpha multiplier on borders, cards, hover bgs.", "category": "Theme", "type": "range", "min": 0, "max": 100, "step": 1, "default": 16 }, { "key": "files.associations", "label": "File Associations", "description": "File patterns to include in the workspace", "category": "Files", "type": "list", "default": ["*.md", "*.mdx", "*.markdown"] }, { "key": "files.default-encoding", "label": "Default Encoding", "description": "Default text encoding for files", "category": "Files", "type": "string", "default": "utf-8" }, { "key": "files.insert-final-newline", "label": "Insert Final Newline", "description": "Ensure files end with a newline when saving", "category": "Files", "type": "boolean", "default": true }, { "key": "files.trim-trailing-whitespace", "label": "Trim Trailing Whitespace", "description": "Remove trailing whitespace from lines when saving", "category": "Files", "type": "boolean", "default": false }, { "key": "workspace.restore-open-files", "label": "Restore Open Files", "description": "Reopen previously open files when opening a workspace", "category": "Workspace", "type": "boolean", "default": true }, { "key": "workspace.max-recent-workspaces", "label": "Max Recent Workspaces", "description": "Maximum number of recent workspaces to remember", "category": "Workspace", "type": "number", "default": 10 }, { "key": "window.restore-workspace", "label": "Restore Workspace", "description": "Automatically reopen the last workspace when the app starts", "category": "Window", "type": "boolean", "default": true }, { "key": "search.debounce-ms", "label": "Search Debounce", "description": "Delay in milliseconds before performing search", "category": "Search", "type": "number", "default": 150 }, { "key": "search.max-results", "label": "Max Search Results", "description": "Maximum number of search results to return", "category": "Search", "type": "number", "default": 50 } ] }