feat: drag&drop treeview, flat chat UI, activity indicator, fixed toolbar registration
This commit is contained in:
@@ -15,8 +15,30 @@ export function AIAssistantPage() {
|
||||
|
||||
useEffect(() => {
|
||||
registerItems('ai_assistant', [
|
||||
{ id: 'agent-select', label: 'Agent', type: 'select', options: agents.map((a) => ({ value: a.id, label: a.name })), value: selectedAgentId || '', onChange: (val: string) => setSelectedAgentId(val || null) },
|
||||
{ id: 'new-chat', label: 'Neuer Chat', type: 'button', onClick: () => { setActiveSessionId(null); setMobileView('list'); } },
|
||||
{
|
||||
id: 'agent-select',
|
||||
plugin: 'ai_assistant',
|
||||
label: 'Agent',
|
||||
type: 'select',
|
||||
group: 'agent',
|
||||
selectOptions: agents.map((a) => ({ value: a.id, label: a.name })),
|
||||
selectValue: selectedAgentId || '',
|
||||
onSelect: (val: string) => setSelectedAgentId(val || null),
|
||||
onClick: () => {},
|
||||
},
|
||||
{
|
||||
id: 'new-chat',
|
||||
plugin: 'ai_assistant',
|
||||
label: 'Neuer Chat',
|
||||
type: 'button',
|
||||
group: 'actions',
|
||||
icon: (
|
||||
<svg className="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
|
||||
</svg>
|
||||
),
|
||||
onClick: () => { setActiveSessionId(null); setMobileView('list'); },
|
||||
},
|
||||
]);
|
||||
return () => unregisterPlugin('ai_assistant');
|
||||
}, [agents, selectedAgentId, registerItems, unregisterPlugin]);
|
||||
|
||||
Reference in New Issue
Block a user