Skip to content

Commit 0aed4d9

Browse files
committed
fix: hide agent chat button outside of project pages
1 parent aa28beb commit 0aed4d9

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

frontend/ui/src/components/layout/app-layout.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export function AppLayout({ children }: { children: React.ReactNode }) {
3030
const [headerContent, setHeaderContent] = useState<ReactNode>(null);
3131
const [aiPanelOpen, setAiPanelOpen] = useState(false);
3232
const pathname = usePathname();
33+
const isProjectPage = pathname?.includes("/projects/");
3334

3435
// Don't show layout on auth pages
3536
if (pathname.startsWith("/auth/")) {
@@ -60,15 +61,17 @@ export function AppLayout({ children }: { children: React.ReactNode }) {
6061
</Button>
6162
{headerContent}
6263
<div className="ml-auto">
63-
<Button
64-
variant="ghost"
65-
size="icon"
66-
className="h-8 w-8 shrink-0"
67-
onClick={() => setAiPanelOpen(!aiPanelOpen)}
68-
title="AI Assistant"
69-
>
70-
<BotMessageSquare className="h-4 w-4" />
71-
</Button>
64+
{isProjectPage && (
65+
<Button
66+
variant="ghost"
67+
size="icon"
68+
className="h-8 w-8 shrink-0"
69+
onClick={() => setAiPanelOpen(!aiPanelOpen)}
70+
title="AI Assistant"
71+
>
72+
<BotMessageSquare className="h-4 w-4" />
73+
</Button>
74+
)}
7275
</div>
7376
</header>
7477
<main className="flex-1 overflow-hidden">{children}</main>

0 commit comments

Comments
 (0)