From 4f23c60fd45df22f27948a4bcd1fdffd1b741264 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Fri, 17 Jul 2026 22:24:26 +0200 Subject: [PATCH] feat: hover rename/delete icons in treeview, resizable tree and sidebar panels --- frontend/src/components/ai/SessionList.tsx | 15 ++++++ frontend/src/components/layout/AISidebar.tsx | 54 +++++++++++--------- frontend/src/pages/AIAssistant.tsx | 13 ++++- 3 files changed, 57 insertions(+), 25 deletions(-) diff --git a/frontend/src/components/ai/SessionList.tsx b/frontend/src/components/ai/SessionList.tsx index 63aa25b..344ed7f 100644 --- a/frontend/src/components/ai/SessionList.tsx +++ b/frontend/src/components/ai/SessionList.tsx @@ -52,6 +52,7 @@ function TreeItem({ onContextMenu: (e: React.MouseEvent, type: 'session' | 'folder' | 'root', id: string | null) => void; onDragSession: (sessionId: string) => void; onDropToFolder: (folderId: string | null) => void; + onDelete: (id: string, type: 'session' | 'folder') => void; }) { const [expanded, setExpanded] = useState(true); const [isDragOver, setIsDragOver] = useState(false); @@ -94,6 +95,12 @@ function TreeItem({ {node.folder!.name} + + )} @@ -124,6 +131,12 @@ function TreeItem({ {session.title} + + ))} @@ -154,6 +167,7 @@ function TreeItem({ onContextMenu={onContextMenu} onDragSession={onDragSession} onDropToFolder={onDropToFolder} + onDelete={onDelete} /> ))} @@ -313,6 +327,7 @@ export function SessionList({ activeSessionId, onSelectSession, isSidebar, class onContextMenu={handleContextMenu} onDragSession={setDragSessionId} onDropToFolder={handleDropToFolder} + onDelete={handleDelete} /> ))} diff --git a/frontend/src/components/layout/AISidebar.tsx b/frontend/src/components/layout/AISidebar.tsx index 0e9447f..5da8b7e 100644 --- a/frontend/src/components/layout/AISidebar.tsx +++ b/frontend/src/components/layout/AISidebar.tsx @@ -1,5 +1,6 @@ import React, { useState, useEffect } from 'react'; import { ChatWindow } from '@/components/ai/ChatWindow'; +import { ResizablePanel } from '@/components/ui/ResizablePanel'; import { createSession, fetchSessions } from '@/api/ai'; import { useUIStore } from '@/store/uiStore'; @@ -9,7 +10,6 @@ export function AISidebar() { const [loading, setLoading] = useState(true); useEffect(() => { - // Find or create a sidebar session (async () => { try { const sessions = await fetchSessions(true); @@ -28,28 +28,36 @@ export function AISidebar() { }, []); return ( -
-
- KI Assistent - + +
+
+ KI Assistent + +
+
+ {loading ? ( +
Laden...
+ ) : sessionId ? ( + + ) : ( +
+ Session konnte nicht erstellt werden +
+ )} +
-
- {loading ? ( -
Laden...
- ) : sessionId ? ( - - ) : ( -
- Session konnte nicht erstellt werden -
- )} -
-
+ ); } diff --git a/frontend/src/pages/AIAssistant.tsx b/frontend/src/pages/AIAssistant.tsx index 2293156..8e5f797 100644 --- a/frontend/src/pages/AIAssistant.tsx +++ b/frontend/src/pages/AIAssistant.tsx @@ -1,6 +1,7 @@ import React, { useState, useEffect } from 'react'; import { SessionList } from '@/components/ai/SessionList'; import { ChatWindow } from '@/components/ai/ChatWindow'; +import { ResizablePanel } from '@/components/ui/ResizablePanel'; import { usePluginToolbarStore } from '@/store/pluginToolbarStore'; import { fetchAgents, type AIAgent } from '@/api/ai'; @@ -69,8 +70,16 @@ export function AIAssistantPage() { return (
{/* Desktop: two-pane layout */} -
- +
+ + +
{activeSessionId ? : (