diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 0d67858d9a..d942f0280f 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -704,6 +704,11 @@ } } + // Persist controls panel state for desktop only + if (!$mobile) { + localStorage.setItem('showControls', JSON.stringify(value)); + } + if (!value) { showCallOverlay.set(false); showOverview.set(false); @@ -712,6 +717,18 @@ } }); + // Restore controls panel state on desktop + if (!$mobile) { + try { + const savedShowControls = localStorage.getItem('showControls'); + if (savedShowControls !== null && JSON.parse(savedShowControls)) { + showControls.set(true); + } + } catch (e) { + // ignore + } + } + selectedFolderSubscribe = selectedFolder.subscribe(async (folder) => { if ( folder?.data?.model_ids && @@ -1089,7 +1106,9 @@ } } - await showControls.set(false); + if ($mobile) { + await showControls.set(false); + } await showCallOverlay.set(false); await showOverview.set(false); await showArtifacts.set(false); diff --git a/src/lib/components/chat/ChatControls.svelte b/src/lib/components/chat/ChatControls.svelte index 774b6fe867..ef42958340 100644 --- a/src/lib/components/chat/ChatControls.svelte +++ b/src/lib/components/chat/ChatControls.svelte @@ -169,7 +169,9 @@ }); onDestroy(() => { - showControls.set(false); + if (!largeScreen) { + showControls.set(false); + } mediaQuery.removeEventListener('change', handleMediaQuery); document.removeEventListener('mousedown', onMouseDown); document.removeEventListener('mouseup', onMouseUp);