From 2d8cea2e7d830f404f7be52ebe8f094e84f322bd Mon Sep 17 00:00:00 2001 From: bincxz <16399091+binaricat@users.noreply.github.com> Date: Tue, 31 Mar 2026 15:37:59 +0800 Subject: [PATCH] fix: remove stale immersive mode sync/rehydration handlers Address Codex review: remove references to setImmersiveModeState in rehydration, IPC sync, and cross-window storage handlers that would throw after the state setter was removed. Co-Authored-By: Claude Opus 4.6 (1M context) --- application/state/useSettingsState.ts | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/application/state/useSettingsState.ts b/application/state/useSettingsState.ts index 2884e1275..b6313d2fb 100644 --- a/application/state/useSettingsState.ts +++ b/application/state/useSettingsState.ts @@ -33,7 +33,7 @@ import { STORAGE_KEY_GLOBAL_HOTKEY_ENABLED, STORAGE_KEY_AUTO_UPDATE_ENABLED, STORAGE_KEY_WORKSPACE_FOCUS_STYLE, - STORAGE_KEY_IMMERSIVE_MODE, + } from '../../infrastructure/config/storageKeys'; import { DEFAULT_UI_LOCALE, resolveSupportedLocale } from '../../infrastructure/config/i18n'; import { TERMINAL_THEMES } from '../../infrastructure/config/terminalThemes'; @@ -456,14 +456,6 @@ export const useSettingsState = () => { const storedDefaultViewMode = readStoredString(STORAGE_KEY_SFTP_DEFAULT_VIEW_MODE); if (storedDefaultViewMode === 'list' || storedDefaultViewMode === 'tree') setSftpDefaultViewMode(storedDefaultViewMode); - // Immersive mode - const storedImmersive = readStoredString(STORAGE_KEY_IMMERSIVE_MODE); - if (storedImmersive === 'true' || storedImmersive === 'false') { - const val = storedImmersive === 'true'; - setImmersiveModeState(val); - notifySettingsChanged(STORAGE_KEY_IMMERSIVE_MODE, val); - } - // Workspace focus style const storedFocusStyle = readStoredString(STORAGE_KEY_WORKSPACE_FOCUS_STYLE); if (storedFocusStyle === 'dim' || storedFocusStyle === 'border') setWorkspaceFocusStyleState(storedFocusStyle); @@ -616,9 +608,6 @@ export const useSettingsState = () => { setSftpDefaultViewMode((prev) => (prev === value ? prev : value)); } } - if (key === STORAGE_KEY_IMMERSIVE_MODE && typeof value === 'boolean') { - setImmersiveModeState((prev) => (prev === value ? prev : value)); - } if (key === STORAGE_KEY_WORKSPACE_FOCUS_STYLE && (value === 'dim' || value === 'border')) { setWorkspaceFocusStyleState((prev) => (prev === value ? prev : value)); } @@ -840,13 +829,6 @@ export const useSettingsState = () => { setAutoUpdateEnabled(newValue); } } - // Sync immersive mode from other windows - if (e.key === STORAGE_KEY_IMMERSIVE_MODE && e.newValue !== null) { - const newValue = e.newValue === 'true'; - if (newValue !== s.immersiveMode) { - setImmersiveModeState(newValue); - } - } // Sync workspace focus style from other windows if (e.key === STORAGE_KEY_WORKSPACE_FOCUS_STYLE && e.newValue !== null) { if (e.newValue === 'dim' || e.newValue === 'border') {