diff --git a/src/components/SasquatchGuide.tsx b/src/components/SasquatchGuide.tsx index 3028d08..7725b41 100644 --- a/src/components/SasquatchGuide.tsx +++ b/src/components/SasquatchGuide.tsx @@ -114,6 +114,9 @@ export interface GuideMessage { onClick: () => void; }; enableChat?: boolean; + /** When true, the panel auto-opens on navigation. When false/undefined, the + * message only populates content once the user taps the bubble. */ + autoShow?: boolean; } interface SasquatchGuideProps { @@ -371,14 +374,16 @@ export function SasquatchGuide({ message, onDismiss }: SasquatchGuideProps) { return undefined; }, [dragPos]); + // Only auto-open the panel when the context message explicitly opts in via + // `autoShow`. On the map (`/`) and The Lab (`/lab`) the guide stays minimized + // until the user taps the bubble — the message content is still used to + // populate the panel when they do. useEffect(() => { - if (message) { + if (message?.autoShow) { const timer = setTimeout(() => setIsVisible(true), 500); return () => clearTimeout(timer); - } else { - setIsVisible(false); } - }, [message]); + }, [message?.autoShow, message?.id]); // Auto-scroll chat to bottom useEffect(() => { @@ -579,8 +584,9 @@ Instructions: }, [handleSendMessage, setIsMinimized]); // The minimized bubble is ALWAYS visible so the user can reopen Sasquatch on any page. - // The full panel shows only when there's a message or when opened externally/by user tap. - const shouldShowPanel = !!message || isVisible; + // The full panel shows only when opened externally, by user tap, or by an + // opt-in auto-show message (e.g. onboarding) — never automatically on / or /lab. + const shouldShowPanel = isVisible; // Notify the rest of the app (e.g. MapPage FAB) when the panel opens or closes useEffect(() => { diff --git a/src/hooks/useSasquatchGuide.ts b/src/hooks/useSasquatchGuide.ts index cc59e17..151a70b 100644 --- a/src/hooks/useSasquatchGuide.ts +++ b/src/hooks/useSasquatchGuide.ts @@ -74,6 +74,9 @@ export function useSasquatchGuide() { }, }, enableChat: true, + // Map homepage: don't auto-open the panel — the bubble stays minimized + // until the user taps it. + autoShow: false, }; } @@ -116,6 +119,8 @@ export function useSasquatchGuide() { }, }, enableChat: true, + // Dedicated onboarding page — auto-open is helpful here. + autoShow: true, }; } @@ -144,6 +149,8 @@ export function useSasquatchGuide() { }, }, enableChat: true, + // The Lab: don't auto-open — the bubble stays minimized until tapped. + autoShow: false, }; } diff --git a/src/pages/MapPage.tsx b/src/pages/MapPage.tsx index e45b9d1..358ebf7 100644 --- a/src/pages/MapPage.tsx +++ b/src/pages/MapPage.tsx @@ -1426,12 +1426,15 @@ export default function MapPage() { - {/* Map attribution — bottom-left corner, minimal */} -