From 88be33879ca517821c9c680a38eec5db7a77bb55 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Sat, 18 Jul 2026 00:53:00 +0200 Subject: [PATCH] feat: AI sidebar full height with collapsed icon strip and drag resize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AISidebar: full height, right of TopBar and Toolbar (all pages except AI Assistant) - AISidebar: collapsed mode shows narrow 48px icon strip with KI button - AISidebar: expanded mode uses ResizablePanel with drag-to-resize (240-600px) - AppShell: moved AISidebar outside inner content container to full-height flex - uiStore: renamed aiSidebarOpen→aiSidebarCollapsed (default: true=collapsed) - TopBar: AI button highlights when sidebar is expanded --- frontend/src/components/layout/AISidebar.tsx | 35 +++++++++++++++++--- frontend/src/components/layout/AppShell.tsx | 6 ++-- frontend/src/components/layout/TopBar.tsx | 7 ++-- frontend/src/store/uiStore.ts | 10 +++--- 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/layout/AISidebar.tsx b/frontend/src/components/layout/AISidebar.tsx index 5da8b7e..b48415d 100644 --- a/frontend/src/components/layout/AISidebar.tsx +++ b/frontend/src/components/layout/AISidebar.tsx @@ -5,7 +5,7 @@ import { createSession, fetchSessions } from '@/api/ai'; import { useUIStore } from '@/store/uiStore'; export function AISidebar() { - const { setAISidebarOpen } = useUIStore(); + const { aiSidebarCollapsed, toggleAISidebar } = useUIStore(); const [sessionId, setSessionId] = useState(null); const [loading, setLoading] = useState(true); @@ -27,6 +27,28 @@ export function AISidebar() { })(); }, []); + // Collapsed: narrow icon strip + if (aiSidebarCollapsed) { + return ( +
+ +
+ ); + } + + // Expanded: full chat panel with resize handle return ( KI Assistent
diff --git a/frontend/src/components/layout/AppShell.tsx b/frontend/src/components/layout/AppShell.tsx index 70a2085..c46a995 100644 --- a/frontend/src/components/layout/AppShell.tsx +++ b/frontend/src/components/layout/AppShell.tsx @@ -8,11 +8,10 @@ import { ToastContainer } from '@/components/ui/Toast'; import { useUIStore } from '@/store/uiStore'; export function AppShell() { - const { aiSidebarOpen } = useUIStore(); const location = useLocation(); // Hide AI sidebar on the AI Assistant page itself - const showAISidebar = aiSidebarOpen && !location.pathname.startsWith('/ai-assistant'); + const showAISidebar = !location.pathname.startsWith('/ai-assistant'); return (
@@ -30,9 +29,10 @@ export function AppShell() { > - {showAISidebar && }
+ {/* AI Sidebar — full height, right of TopBar and Toolbar */} + {showAISidebar && } ); diff --git a/frontend/src/components/layout/TopBar.tsx b/frontend/src/components/layout/TopBar.tsx index f4868ad..a971579 100644 --- a/frontend/src/components/layout/TopBar.tsx +++ b/frontend/src/components/layout/TopBar.tsx @@ -14,7 +14,7 @@ export function TopBar() { const { t } = useTranslation(); const navigate = useNavigate(); const { user } = useAuthStore(); - const { toggleSidebar, toggleAISidebar } = useUIStore(); + const { toggleSidebar, toggleAISidebar, aiSidebarCollapsed } = useUIStore(); const { currentTenant, availableTenants, switchTenant, isSwitching } = useTenant(); const logoutMutation = useLogout(); @@ -72,7 +72,10 @@ export function TopBar() { {/* AI Assistant toggle */}