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
This commit is contained in:
Mikkel Georgsen 2026-03-31 10:46:56 +02:00 committed by Nexus Dev
parent 84c159a9d4
commit 5a32e2b652

View file

@ -93,6 +93,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();
@ -126,6 +132,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 (
<Dialog
open={newAgentOpen}
@ -176,6 +191,21 @@ export function NewAgentDialog() {
{`Ask the ${VOCAB.ceo} to create a new agent`}
</Button>
{/* [nexus] Template selector — quick-create PM or Engineer agent */}
<div className="space-y-2">
<p className="text-sm text-muted-foreground text-center">Or use a template:</p>
{AGENT_TEMPLATES.map((template) => (
<Button
key={template.id}
variant="outline"
className="w-full justify-start"
onClick={() => handleTemplateSelect(template)}
>
{template.label}
</Button>
))}
</div>
{/* Advanced link */}
<div className="text-center">
<button