From 6d396a82de8c0f6a6ea0be81d68d9051f56dd2b5 Mon Sep 17 00:00:00 2001 From: Mikkel Georgsen Date: Tue, 31 Mar 2026 10:46:56 +0200 Subject: [PATCH] feat(04-03): add PM and Engineer template selector to NewAgentDialog - Add AGENT_TEMPLATES const with Project Manager (role:pm) and Engineer options - Add template selector section between Ask PM button and advanced config link - handleTemplateSelect navigates to /agents/new pre-filled with template values - No hire language present in dialog - [nexus] marked all new/changed lines --- ui/src/components/NewAgentDialog.tsx | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/ui/src/components/NewAgentDialog.tsx b/ui/src/components/NewAgentDialog.tsx index b819e602..ba358bf4 100644 --- a/ui/src/components/NewAgentDialog.tsx +++ b/ui/src/components/NewAgentDialog.tsx @@ -85,6 +85,12 @@ const ADVANCED_ADAPTER_OPTIONS: Array<{ }, ]; +// [nexus] Predefined agent templates for quick agent creation +const AGENT_TEMPLATES = [ + { id: "pm", label: "Project Manager", role: "pm" as const, adapterType: "claude_local" as const }, + { id: "engineer", label: "Engineer", role: "engineer" as const, adapterType: "claude_local" as const }, +]; + export function NewAgentDialog() { const { newAgentOpen, closeNewAgent, openNewIssue } = useDialog(); const { selectedCompanyId } = useCompany(); @@ -118,6 +124,15 @@ export function NewAgentDialog() { navigate(`/agents/new?adapterType=${encodeURIComponent(adapterType)}`); } + // [nexus] Handle template selection — navigates to creation form pre-filled with template values + function handleTemplateSelect(template: typeof AGENT_TEMPLATES[number]) { + closeNewAgent(); + setShowAdvancedCards(false); + navigate( + `/agents/new?adapterType=${encodeURIComponent(template.adapterType)}&role=${encodeURIComponent(template.role)}&name=${encodeURIComponent(template.label)}`, + ); + } + return ( + {/* [nexus] Template selector — quick-create PM or Engineer agent */} +
+

Or use a template:

+ {AGENT_TEMPLATES.map((template) => ( + + ))} +
+ {/* Advanced link */}