diff --git a/vibn-frontend/components/vibn-chat/chat-panel.tsx b/vibn-frontend/components/vibn-chat/chat-panel.tsx index 3634f6b..6f7c8a2 100644 --- a/vibn-frontend/components/vibn-chat/chat-panel.tsx +++ b/vibn-frontend/components/vibn-chat/chat-panel.tsx @@ -1026,6 +1026,18 @@ export function ChatPanel({ ); const [showThreads, setShowThreads] = useState(false); const [mcpToken, setMcpToken] = useState(null); + const [isChatMinimized, setIsChatMinimized] = useState(() => { + if (typeof window === "undefined") return false; + return !window.location.pathname.includes("/preview"); + }); + + // Auto-minimize when navigating to dashboard, auto-open when navigating to preview + useEffect(() => { + if (typeof window !== "undefined") { + setIsChatMinimized(!window.location.pathname.includes("/preview")); + } + }, [pathname]); + const messagesEndRef = useRef(null); const inputRef = useRef(null); // AbortController for the in-flight /api/chat fetch. Lives in a ref @@ -2497,7 +2509,7 @@ export function ChatPanel({ >