From 1cabea797207fd18d2032cb8479cbc0bd7bcae57 Mon Sep 17 00:00:00 2001 From: Kamil Krzywda Date: Fri, 2 Oct 2026 20:55:26 +0000 Subject: [PATCH] fix(ui): team builder lead rule mirrors the route busy check (helper-on-PENDING is not a valid lead) (#44) --- components/team-builder.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/team-builder.tsx b/components/team-builder.tsx index 9746fac..db66b72 100644 --- a/components/team-builder.tsx +++ b/components/team-builder.tsx @@ -32,8 +32,10 @@ export function TeamBuilder({ type, hopCount, roster, tasks, onQueue }: { const duration = lead ? computeDuration(type, hopCount ?? 0, lead, helpers) : null // CrewDto ⊇ CrewMember const leadReason = (c: CrewDto) => { - const t = tasks.find((x) => x.leadCrewId === c.id && x.status === 'PENDING') - return t ? `${t.type} ALREADY QUEUED` : null + const leads = tasks.find((x) => x.leadCrewId === c.id && x.status === 'PENDING') + if (leads) return `${leads.type} ALREADY QUEUED` + const helps = tasks.find((x) => x.helperCrewIds.includes(c.id) && x.status === 'PENDING') + return helps ? `COMMITTED: ${helps.type}` : null } const helperReason = (c: CrewDto) => { const t = tasks.find((x) => (x.leadCrewId === c.id || x.helperCrewIds.includes(c.id)) && (x.status === 'ACTIVE' || x.status === 'PENDING'))