fix: Neuer Chat Button erstellt Session, Ordner drag&drop im KI-Baum

This commit is contained in:
Agent Zero
2026-07-20 02:20:43 +02:00
parent 29202325a6
commit c3974c2ef9
2 changed files with 39 additions and 4 deletions
+11 -2
View File
@@ -3,7 +3,7 @@ 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';
import { fetchAgents, createSession, type AIAgent } from '@/api/ai';
export function AIAssistantPage() {
const [activeSessionId, setActiveSessionId] = useState<string | null>(null);
@@ -39,7 +39,16 @@ export function AIAssistantPage() {
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
</svg>
),
onClick: () => { setActiveSessionId(null); setMobileView('list'); setRefreshKey(k => k + 1); },
onClick: async () => {
try {
const session = await createSession({ is_sidebar: false });
setActiveSessionId(session.id);
setMobileView('chat');
setRefreshKey(k => k + 1);
} catch (e) {
console.error('Failed to create session:', e);
}
},
},
{
id: 'new-folder',