From 64c6d690048ab6b5fb2084071b22ea7bcc1b68ac Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 12 Nov 2025 11:09:04 -0600 Subject: [PATCH] Fix web search toggle first-time behavior - Globe icon now enables web search immediately on first click - First-time popup shows after enabling, with flag set to prevent future popups - Closing popup (any method) only dismisses dialog without additional actions - Subsequent globe clicks toggle web search on/off normally Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- frontend/src/components/UnifiedChat.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/UnifiedChat.tsx b/frontend/src/components/UnifiedChat.tsx index a1a61266..05f4776b 100644 --- a/frontend/src/components/UnifiedChat.tsx +++ b/frontend/src/components/UnifiedChat.tsx @@ -2507,10 +2507,12 @@ export function UnifiedChat() { return; } - // Step 2: Check if this is their first time (show info dialog) + // Step 2: Check if this is their first time (enable web search, set flag, show popup) const hasSeenWebSearchInfo = localStorage.getItem("hasSeenWebSearchInfo") === "true"; if (!hasSeenWebSearchInfo) { + localStorage.setItem("hasSeenWebSearchInfo", "true"); + setIsWebSearchEnabled(true); setWebSearchInfoDialogOpen(true); return; } @@ -2764,10 +2766,12 @@ export function UnifiedChat() { return; } - // Step 2: Check if this is their first time (show info dialog) + // Step 2: Check if this is their first time (enable web search, set flag, show popup) const hasSeenWebSearchInfo = localStorage.getItem("hasSeenWebSearchInfo") === "true"; if (!hasSeenWebSearchInfo) { + localStorage.setItem("hasSeenWebSearchInfo", "true"); + setIsWebSearchEnabled(true); setWebSearchInfoDialogOpen(true); return; } @@ -2927,15 +2931,11 @@ export function UnifiedChat() { { - // When dialog is closed (any way), mark as seen and enable web search - if (!open) { - localStorage.setItem("hasSeenWebSearchInfo", "true"); - setIsWebSearchEnabled(true); - } + // When dialog is closed via X or backdrop, just dismiss - web search already enabled on click setWebSearchInfoDialogOpen(open); }} onConfirm={() => { - // Just close the dialog (onOpenChange handles the rest) + // "Got it" button - just close (web search already enabled on click) setWebSearchInfoDialogOpen(false); }} />