From 6ca2a484eddaaaa62dcfaa7519b5d10a2aff524e Mon Sep 17 00:00:00 2001 From: stroblme Date: Wed, 14 Oct 2026 23:41:30 +0200 Subject: [PATCH] Phone header: assistant button in the corner, gated on an available provider as the sidebar entry is; header triggers on the right at 44px --- frontend/src/routes/_layout.tsx | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/frontend/src/routes/_layout.tsx b/frontend/src/routes/_layout.tsx index f208679..fa27657 100644 --- a/frontend/src/routes/_layout.tsx +++ b/frontend/src/routes/_layout.tsx @@ -1,16 +1,23 @@ +import { useQuery } from "@tanstack/react-query" import { createFileRoute, Outlet, redirect, useRouterState, } from "@tanstack/react-router" +import { Bot } from "lucide-react" -import { ControlTrigger } from "@/components/Chat/ChatPanel" +import { + aiStatusQueryOptions, + ControlTrigger, +} from "@/components/Chat/ChatPanel" +import { chatStore } from "@/components/Chat/chatStore" import { ConnectionNotice } from "@/components/Common/ConnectionNotice" import ErrorComponent from "@/components/Common/ErrorComponent" import { Footer } from "@/components/Common/Footer" import { useFlowSocket } from "@/components/Flow/useFlowSocket" import AppSidebar from "@/components/Sidebar/AppSidebar" +import { Button } from "@/components/ui/button" import { SidebarInset, SidebarProvider, @@ -38,6 +45,8 @@ function Layout() { // here rather than only inside the editor. useFlowSocket() const home = useRouterState({ select: (s) => s.location.pathname === "/" }) + // Gated as the sidebar's entry is: with no provider there is nothing to open. + const assistant = useQuery(aiStatusQueryOptions()) return ( @@ -48,10 +57,25 @@ function Layout() { {/* The sidebar carries its own collapse control; a phone has no sidebar on screen to carry it. Home's chat sits opposite, where - the brain view has it on a wider screen. */} + the brain view has it on a wider screen, and the assistant in the + corner, one tap away rather than behind the sidebar sheet. */}
- {home ? : null} +
+ {home ? : null} + {assistant.data?.available ? ( + + ) : null} +