feat: remember layout choices; Windows 11 toggles in Tweaks

- The navigation pane, window size/position/maximized state, and the
  process list filters, sort and columns now survive a restart. They live
  in ui-state.json, apart from settings.json, so they never mark the
  Settings page as unsaved or travel in exported configurations. A corrupt
  file falls back to defaults; tests write to a temp file.
- Fixes the pane re-opening on every start (it was hard-coded open).
- Tweaks use a native-looking Windows 11 switch (40x20 track, sliding
  thumb) with On/Off written beside it.
- New test: every on/off setting survives save and reload.
This commit is contained in:
PrimeBuild-pc
2026-10-14 19:01:47 +02:00
parent 20abf7006c
commit 1544587a10
19 changed files with 347 additions and 76 deletions
+7
View File
@@ -229,6 +229,13 @@ namespace ThreadPilot.ViewModels
this.persistentRuleStore = persistentRuleStore;
this.persistentRuleMatcher = persistentRuleMatcher;
this.SelectedCpuAssignmentMode = settingsService?.Settings.DefaultCpuAssignmentMode ?? CpuAssignmentMode.Automatic;
// Fields, not properties: the change handlers would reload and re-save the list during construction.
var uiState = UiStateStore.Current;
this.showActiveApplicationsOnly = uiState.ShowActiveApplicationsOnly;
this.hideSystemProcesses = uiState.HideSystemProcesses;
this.hideIdleProcesses = uiState.HideIdleProcesses;
this.sortMode = string.IsNullOrWhiteSpace(uiState.SortMode) ? this.sortMode : uiState.SortMode;
this.IsAutomationMonitoringEnabled = settingsService?.Settings.EnableAutomationMonitoring ?? true;
if (settingsService != null)
{