feat(agents): add sorting by sort_order and include category & display fields in agent actions

- Implemented sorting of agent types by `sort_order` in Agents page.
- Added support for category, icon, color, sort_order, typical_tasks, and collaboration_hints fields in agent creation and update actions.
This commit is contained in:
2026-01-06 18:20:04 +01:00
parent 3cb6c8d13b
commit 8623eb56f5
2 changed files with 16 additions and 2 deletions

View File

@@ -73,6 +73,13 @@ export default function AgentTypeDetailPage() {
mcp_servers: data.mcp_servers,
tool_permissions: data.tool_permissions,
is_active: data.is_active,
// Category and display fields
category: data.category,
icon: data.icon,
color: data.color,
sort_order: data.sort_order,
typical_tasks: data.typical_tasks,
collaboration_hints: data.collaboration_hints,
});
toast.success('Agent type created', {
description: `${result.name} has been created successfully`,
@@ -94,6 +101,13 @@ export default function AgentTypeDetailPage() {
mcp_servers: data.mcp_servers,
tool_permissions: data.tool_permissions,
is_active: data.is_active,
// Category and display fields
category: data.category,
icon: data.icon,
color: data.color,
sort_order: data.sort_order,
typical_tasks: data.typical_tasks,
collaboration_hints: data.collaboration_hints,
},
});
toast.success('Agent type updated', {

View File

@@ -49,10 +49,10 @@ export default function AgentTypesPage() {
limit: 50,
});
// Get filtered agent types
// Get filtered and sorted agent types (sort by sort_order ascending - smaller first)
const filteredAgentTypes = useMemo(() => {
if (!data?.data) return [];
return data.data;
return [...data.data].sort((a, b) => a.sort_order - b.sort_order);
}, [data?.data]);
// Handle navigation to agent type detail