From 784fe6e88f0756fd0b8cb8c17733e94d9d58cc9a Mon Sep 17 00:00:00 2001 From: zenchantlive Date: Thu, 26 Feb 2026 10:23:00 -0800 Subject: [PATCH] fix: add templateId default to issue creation paths - parser.ts: Add templateId: null to default BeadIssue - read-issues.ts: Add templateId: null when reading issues - swarm-workspace.tsx: Update mock data with templateId --- src/components/swarm/swarm-workspace.tsx | 25 ++++++++++++++++-------- src/lib/parser.ts | 1 + src/lib/read-issues.ts | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/components/swarm/swarm-workspace.tsx b/src/components/swarm/swarm-workspace.tsx index bd62f39..7d50f93 100644 --- a/src/components/swarm/swarm-workspace.tsx +++ b/src/components/swarm/swarm-workspace.tsx @@ -4,7 +4,7 @@ import React, { useState } from 'react'; import { TelemetryGrid } from './telemetry-grid'; import { ConvoyStepper, type Phase } from './convoy-stepper'; import { Network, Blocks, FileCode2, Info } from 'lucide-react'; -import { cn } from '../../lib/utils'; +import { cn, getArchetypeDisplayChar, getTemplateDisplayChar, getTemplateColor } from '../../lib/utils'; import type { BeadIssue } from '../../lib/types'; import { useArchetypes } from '../../hooks/use-archetypes'; import { useTemplates } from '../../hooks/use-templates'; @@ -42,6 +42,7 @@ export function SwarmWorkspace({ selectedMissionId, issues = [], projectRoot }: title: 'Analyze DB Schema', status: 'closed', assignee: 'Alice (Architect)', + templateId: null, owner: null, description: null, issue_type: 'task', @@ -57,6 +58,7 @@ export function SwarmWorkspace({ selectedMissionId, issues = [], projectRoot }: title: 'Implement API Routes', status: 'in_progress', assignee: 'Bob (Backend)', + templateId: null, owner: null, description: null, issue_type: 'task', @@ -75,6 +77,7 @@ export function SwarmWorkspace({ selectedMissionId, issues = [], projectRoot }: title: 'Build UI Components', status: 'blocked', assignee: 'Charlie (Frontend)', + templateId: null, owner: null, description: null, issue_type: 'task', @@ -184,7 +187,7 @@ export function SwarmWorkspace({ selectedMissionId, issues = [], projectRoot }: >
- {arc.name.charAt(0)} + {getArchetypeDisplayChar(arc)}
{arc.name}
@@ -241,16 +244,21 @@ export function SwarmWorkspace({ selectedMissionId, issues = [], projectRoot }: No templates found. Create one in the `.beads/templates/` directory.
) : ( - templates.map(tpl => ( + templates.map(tpl => { + const tplColor = getTemplateColor(tpl); + return ( - )) + ); + }) )}
diff --git a/src/lib/parser.ts b/src/lib/parser.ts index 6cd7c11..46ef8fa 100644 --- a/src/lib/parser.ts +++ b/src/lib/parser.ts @@ -45,6 +45,7 @@ function normalizeIssue(raw: ParseableBeadIssue): BeadIssue { priority: typeof raw.priority === 'number' ? raw.priority : 2, issue_type: (raw.issue_type ?? 'task') as BeadIssue['issue_type'], assignee: typeof raw.assignee === 'string' ? raw.assignee : null, + templateId: null, owner: typeof raw.owner === 'string' ? raw.owner : null, labels: Array.isArray(raw.labels) ? raw.labels.filter((x): x is string => typeof x === 'string') : [], dependencies: normalizeDependencies(raw.dependencies), diff --git a/src/lib/read-issues.ts b/src/lib/read-issues.ts index 3d39736..e74ffd6 100644 --- a/src/lib/read-issues.ts +++ b/src/lib/read-issues.ts @@ -70,6 +70,7 @@ function normalizeBdIssue(raw: unknown): BeadIssue | null { priority: typeof data.priority === 'number' ? data.priority : 2, issue_type: typeof data.issue_type === 'string' ? data.issue_type : 'task', assignee: typeof data.assignee === 'string' ? data.assignee : null, + templateId: null, owner: typeof data.owner === 'string' ? data.owner : null, labels: Array.isArray(data.labels) ? data.labels.filter((x): x is string => typeof x === 'string') : [], dependencies: normalizeDependencies(data.dependencies),