M19: Move sidebarCollapsed from localStorage to electron-store

Sidebar collapsed state was an orphan in localStorage -- not backed up,
lost on portable installs, and inconsistent with every other preference.

Added sidebarCollapsed: boolean to the Settings type and DEFAULT_SETTINGS,
wired it through applySettings' boolean branch, and updated the renderer
store / main.tsx mock defaults. App.tsx now drives the toggle via
updateSettings({ sidebarCollapsed }) instead of localStorage.

typecheck + 242 tests + eslint green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 14:04:30 -04:00
parent 63a327a31c
commit 4e3b141d6d
6 changed files with 9 additions and 10 deletions
+2
View File
@@ -64,6 +64,7 @@ const DEFAULTS: Settings = {
hasCompletedOnboarding: false,
minimizeToTray: false,
launchAtStartup: false,
sidebarCollapsed: false,
updateToken: ''
}
@@ -335,6 +336,7 @@ function applySettings(s: Store<Settings>, partial: Partial<Settings>): void {
case 'autoDownloadNew':
case 'hasCompletedOnboarding':
case 'minimizeToTray':
case 'sidebarCollapsed':
if (typeof value === 'boolean') s.set(key, value)
break
case 'launchAtStartup':