feat: AI sidebar full height with collapsed icon strip and drag resize
- 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
This commit is contained in:
@@ -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<string | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
@@ -27,6 +27,28 @@ export function AISidebar() {
|
||||
})();
|
||||
}, []);
|
||||
|
||||
// Collapsed: narrow icon strip
|
||||
if (aiSidebarCollapsed) {
|
||||
return (
|
||||
<div
|
||||
className="flex-shrink-0 w-12 flex flex-col items-center border-l border-secondary-200 bg-white py-3"
|
||||
data-testid="ai-sidebar-collapsed"
|
||||
>
|
||||
<button
|
||||
onClick={toggleAISidebar}
|
||||
className="p-2 rounded-md hover:bg-secondary-100 min-h-touch min-w-touch flex items-center justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
|
||||
aria-label="KI Assistent öffnen"
|
||||
title="KI Assistent"
|
||||
>
|
||||
<svg className="w-5 h-5 text-secondary-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Expanded: full chat panel with resize handle
|
||||
return (
|
||||
<ResizablePanel
|
||||
initialWidth={320}
|
||||
@@ -39,11 +61,14 @@ export function AISidebar() {
|
||||
<div className="h-12 flex items-center justify-between px-3 border-b border-secondary-200">
|
||||
<span className="text-sm font-medium text-secondary-700">KI Assistent</span>
|
||||
<button
|
||||
onClick={() => setAISidebarOpen(false)}
|
||||
className="text-secondary-400 hover:text-secondary-600"
|
||||
title="Schließen"
|
||||
onClick={toggleAISidebar}
|
||||
className="p-1 rounded text-secondary-400 hover:text-secondary-600 hover:bg-secondary-100"
|
||||
title="Einklappen"
|
||||
aria-label="KI Assistent einklappen"
|
||||
>
|
||||
✕
|
||||
<svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div className="flex-1 overflow-hidden">
|
||||
|
||||
Reference in New Issue
Block a user