feat: add standalone AI assistant window button
- Add ExternalLink button to AI assistant toolbar - New route /ai-assistant-standalone renders AIAssistantPage without sidebar - Opens in new browser window via window.open
This commit is contained in:
@@ -4,7 +4,7 @@ import { ChatWindow } from '@/components/ai/ChatWindow';
|
||||
import { ResizablePanel } from '@/components/ui/ResizablePanel';
|
||||
import { usePluginToolbarStore } from '@/store/pluginToolbarStore';
|
||||
import { fetchAgents, createSession, type AIAgent } from '@/api/ai';
|
||||
import { ChevronLeft, Folder, Plus } from 'lucide-react';
|
||||
import { ChevronLeft, ExternalLink, Folder, Plus } from 'lucide-react';
|
||||
|
||||
export function AIAssistantPage() {
|
||||
const [activeSessionId, setActiveSessionId] = useState<string | null>(null);
|
||||
@@ -67,6 +67,19 @@ export function AIAssistantPage() {
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'open-standalone',
|
||||
plugin: 'ai_assistant',
|
||||
label: 'In neuem Fenster',
|
||||
type: 'button',
|
||||
group: 'actions',
|
||||
icon: (
|
||||
<ExternalLink className="w-3.5 h-3.5" strokeWidth={2} />
|
||||
),
|
||||
onClick: () => {
|
||||
window.open('/ai-assistant-standalone', '_blank', 'width=800,height=600');
|
||||
},
|
||||
},
|
||||
]);
|
||||
return () => unregisterPlugin('ai_assistant');
|
||||
}, [agents, selectedAgentId, registerItems, unregisterPlugin]);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
import { AIAssistantPage } from './AIAssistant';
|
||||
|
||||
export function AIAssistantStandalonePage() {
|
||||
return (
|
||||
<div className="h-screen w-screen overflow-hidden bg-white">
|
||||
<AIAssistantPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user