From 0aed4d92fc7bd7a7ae07e1c84c42d5c2419496b8 Mon Sep 17 00:00:00 2001 From: arav Date: Wed, 25 Mar 2026 18:55:42 -0400 Subject: [PATCH 1/2] fix: hide agent chat button outside of project pages --- .../ui/src/components/layout/app-layout.tsx | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/frontend/ui/src/components/layout/app-layout.tsx b/frontend/ui/src/components/layout/app-layout.tsx index 69d4e22a..67a3e1d0 100644 --- a/frontend/ui/src/components/layout/app-layout.tsx +++ b/frontend/ui/src/components/layout/app-layout.tsx @@ -30,6 +30,7 @@ export function AppLayout({ children }: { children: React.ReactNode }) { const [headerContent, setHeaderContent] = useState(null); const [aiPanelOpen, setAiPanelOpen] = useState(false); const pathname = usePathname(); + const isProjectPage = pathname?.includes("/projects/"); // Don't show layout on auth pages if (pathname.startsWith("/auth/")) { @@ -60,15 +61,17 @@ export function AppLayout({ children }: { children: React.ReactNode }) { {headerContent}
- + {isProjectPage && ( + + )}
{children}
From 50ef076452dbc46805362a7bae0e0f1bf262b7ed Mon Sep 17 00:00:00 2001 From: arav Date: Wed, 25 Mar 2026 18:57:13 -0400 Subject: [PATCH 2/2] fix: close AI panel when navigating away from project pages --- frontend/ui/src/components/layout/app-layout.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/ui/src/components/layout/app-layout.tsx b/frontend/ui/src/components/layout/app-layout.tsx index 67a3e1d0..d6e7e4df 100644 --- a/frontend/ui/src/components/layout/app-layout.tsx +++ b/frontend/ui/src/components/layout/app-layout.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState, createContext, useContext, ReactNode } from "react"; +import { useState, useEffect, createContext, useContext, ReactNode } from "react"; import { usePathname } from "next/navigation"; import { Sidebar } from "./sidebar"; import { Button } from "@/components/ui/button"; @@ -32,6 +32,12 @@ export function AppLayout({ children }: { children: React.ReactNode }) { const pathname = usePathname(); const isProjectPage = pathname?.includes("/projects/"); + useEffect(() => { + if (!isProjectPage) { + setAiPanelOpen(false); + } + }, [isProjectPage]); + // Don't show layout on auth pages if (pathname.startsWith("/auth/")) { return <>{children};