From 11866fe8074fec781a72870aad8cf419793c209f Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Mon, 29 Dec 2025 16:42:51 +0000 Subject: [PATCH] feat: Remember web search toggle state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implements localStorage persistence for the web search toggle following the same pattern as other user preferences (fullscreen mode, selected model). The web search toggle state is now: - Initialized from localStorage on component mount - Persisted to localStorage whenever the state changes - Uses the key "webSearchEnabled" for storage This ensures users don't have to re-enable web search every time they start a new chat session. Fixes #349 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Anthony --- frontend/src/components/UnifiedChat.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/UnifiedChat.tsx b/frontend/src/components/UnifiedChat.tsx index 7ee2c5ba3..b08413b5e 100644 --- a/frontend/src/components/UnifiedChat.tsx +++ b/frontend/src/components/UnifiedChat.tsx @@ -817,8 +817,10 @@ export function UnifiedChat() { const [isProcessingSend, setIsProcessingSend] = useState(false); const [audioError, setAudioError] = useState(null); - // Web search toggle state - const [isWebSearchEnabled, setIsWebSearchEnabled] = useState(false); + // Web search toggle state - persisted in localStorage + const [isWebSearchEnabled, setIsWebSearchEnabled] = useState(() => { + return localStorage.getItem("webSearchEnabled") === "true"; + }); // Fullscreen mode for power users - persisted in localStorage const [isFullscreen, setIsFullscreen] = useState(() => { @@ -831,6 +833,11 @@ export function UnifiedChat() { localStorage.setItem("chatFullscreen", isFullscreen.toString()); }, [isFullscreen]); + // Save web search preference to localStorage when it changes + useEffect(() => { + localStorage.setItem("webSearchEnabled", isWebSearchEnabled.toString()); + }, [isWebSearchEnabled]); + // Toggle fullscreen with animation const toggleFullscreen = useCallback(() => { setIsFullscreenAnimating(true);