feat(settings): implement Settings view with config.toml persistence
Merged
MP
7mo ago+2587+2587+0123456789012345678901234567890123456789-152-152-012345678901234567890123456789
Summary
- Expand
AppConfigdomain model from 9 to 32 fields covering 6 settings categories (General, Downloads, Network, Remote Access, Browser Integration, Appearance) - Create
TomlConfigStoreadapter for reading/writing~/.config/vortex/config.tomlwith atomic writes, auto-defaults, and forward-compatible deserialization - Implement
UpdateConfigCommandhandler with input validation (proxy_type, theme, port bounds, concurrent/segment limits, timeout range) - Add
settings_get/settings_updateTauri IPC commands with camelCase DTO serialization - Build SettingsView with 6-tab sidebar layout and shared
SettingToggle/SettingNumberInputcomponents - Implement all 6 section components: GeneralSection, DownloadsSection, NetworkSection, RemoteAccessSection (with API key display), BrowserSection, AppearanceSection (with accent color presets)
- Add event-based cache invalidation via
settings-updatedTauri event listener
Test plan
- 368 Rust tests pass (including 8 TOML adapter tests + 4 validation tests)
- 280 TypeScript tests pass (including 35 settings tests)
-
cargo clippy -- -D warningsclean -
tsc --noEmitclean -
oxlint0 errors - Lefthook pre-commit hooks pass (secrets, fmt, lint, clippy)
- Manual: Open Settings, switch tabs, change values, verify persistence after reload
- Manual: Change theme/accent color, verify UI updates
- Manual: Enable REST API, verify API key display/copy/regenerate
Summary by cubic
Implements the full Settings experience with persistent config.toml, a 6‑tab UI, strict post‑merge validation, and concurrency‑safe config access, completing Task 23. Also adds tauri-plugin-pilot on Unix and isolates its dev-pilot capability to Linux/macOS to keep Windows CI green.
-
New Features
- Expanded
AppConfigto 32 fields across General, Downloads, Network, Remote Access, Browser, and Appearance. TomlConfigStorepersistence to~/.config/vortex/config.tomlwith atomic writes and sensible defaults.- Validated
UpdateConfigCommandand IPC:settings_get/settings_update(camelCase DTOs,{ patch: ... }) plusSettingsUpdatedevent; cross‑field checks (e.g., requireproxyUrlwhenproxyType≠none). SettingsViewwith 6 tabs and shared inputs; API key show/copy/regenerate, accent color presets, and cache invalidation onsettings-updated. Addstauri-plugin-pilot(Unix‑only) withdev-pilotcapability restricted to Linux/macOS.
- Expanded
-
Bug Fixes
- Concurrency: guarded reads and writes with a
Mutexfor safe config access. - Persistence/security: temp
config.tomlcreated with 0o600 permissions andsync_allused for crash‑safe atomic writes. - IPC/UX: fixed
{ patch: ... }IPC shape; buffered inputs commit on blur and sync after clamping; controlled Browser inputs; disabled Browse until picker is wired. - Accessibility/clarity: added
aria-pressed,htmlFor/id,aria-labelon Theme/Language selects; clarified speed limit to MiB/s; numeric fields respect step when committing. - CI: moved
pilot:defaultpermissions into a platform‑scopeddev-pilotcapability file to avoid Windows build validation errors.
- Concurrency: guarded reads and writes with a
Summary by CodeRabbit
-
New Features
- Full Settings UI with tabs: General, Downloads, Network, Remote Access, Browser, Appearance.
- Configure proxy, download limits, timeouts, web interface port, REST/WebSocket/API key (show/copy/regenerate), theme, accent color, compact mode, and many other preferences.
- Settings persist safely on disk and update immediately across the app; external changes auto-refresh the UI.
-
Tests
- Added comprehensive frontend tests covering the Settings view and all sections.