diff --git a/.changeset/detail-modal-canonical-flags.md b/.changeset/detail-modal-canonical-flags.md new file mode 100644 index 0000000000..6d904ff253 --- /dev/null +++ b/.changeset/detail-modal-canonical-flags.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": patch +--- + +summary: The duplicate-warning banner in Task Detail now judges the canonical by its own lane, not the legacy ids. +category: fix +dev: `isNearDuplicateCanonicalInactive` in TaskDetailModal now receives `columnFlagsByTaskId.get(canonical.id)`; the allow-list entry claiming this needed a fetch is removed. diff --git a/packages/dashboard/app/components/TaskDetailModal.tsx b/packages/dashboard/app/components/TaskDetailModal.tsx index bb466151c3..d953c94c4c 100644 --- a/packages/dashboard/app/components/TaskDetailModal.tsx +++ b/packages/dashboard/app/components/TaskDetailModal.tsx @@ -944,15 +944,31 @@ export function TaskDetailContent({ vs union confusion that `column-role-degraded-flags.test.ts` exists to catch, and it would type-check and read as a conversion. - Supplying it correctly needs the canonical's own resolved flags, which means fetching them: a data - change, out of scope here. So the omission is deliberate and is exempted BY CALL SITE rather than by - function name, so core's sibling site stays guarded. + FNXC:WorkflowResolvedColumns 2026-07-31-03:10 (the "needs a fetch" blocker was never tested): + The paragraph above rejected passing `detailColumnFlags` — correctly, that would answer about the + wrong task — and then concluded the seam needs a data change. It does not. `columnFlagsByTaskId` is + already a prop of this component (declared :367, destructured :727, used for the fan-out map), and + it is keyed by task id. The canonical is `tasks.find(c => c.id === nearDuplicateOf)`, so it is + drawn from the same loaded set the map covers — a `.get(canonical.id)` is the canonical's OWN + flags, with no fetch. + + `Column.tsx:307` already does exactly this, with a comment making the same point about not reusing + the row's flags. The blocker was asserted from the shape of the problem (two different tasks) rather + than tested against what was in scope. + + A canonical the map does not cover yields `undefined`, which is the documented legacy fallback — + strictly better than always-legacy, never a fabricated answer. */ const showNearDuplicateWarning = Boolean(nearDuplicateOf) && workingTask.sourceMetadata?.nearDuplicateDismissed !== true && task.column !== "archived" && task.column !== "done" - && !isNearDuplicateCanonicalInactive(nearDuplicateCanonical); + && !isNearDuplicateCanonicalInactive( + nearDuplicateCanonical, + /* The CANONICAL's own flags, keyed by its id — never `detailColumnFlags`, which describes this + modal's task. Same shape as Column.tsx:307, the sibling site that already does this. */ + nearDuplicateCanonical ? columnFlagsByTaskId?.get(nearDuplicateCanonical.id) : undefined, + ); const [sourceAgent, setSourceAgent] = useState(null); const [selectedSourceAgentId, setSelectedSourceAgentId] = useState(null); const provenanceDisplay = getProvenanceLabel(workingTask, { diff --git a/scripts/check-inert-flag-seams.mjs b/scripts/check-inert-flag-seams.mjs index bbd458d1bd..67a68e007c 100644 --- a/scripts/check-inert-flag-seams.mjs +++ b/scripts/check-inert-flag-seams.mjs @@ -150,12 +150,6 @@ const ALLOWED_OMISSIONS = new Map([ + "change, not local wiring, which is the same 'needs a data change' category as the entry below. " + "Filed for the plugin-API owner rather than bodged here." }, ], - [ - "packages/dashboard/app/components/TaskDetailModal.tsx::isNearDuplicateCanonicalInactive", - { count: 1, reason: "The flags in scope describe the MODAL'S task; the canonical is a different task on a column this " - + "component never resolves. Passing them would type-check, read as a conversion, and answer " - + "about the wrong task. Correct supply needs a fetch — a data change. See the note at the site." }, - ], ]); /* diff --git a/scripts/lib/lane-wiring-baseline.json b/scripts/lib/lane-wiring-baseline.json index 16187a1ec9..1e631f0633 100644 --- a/scripts/lib/lane-wiring-baseline.json +++ b/scripts/lib/lane-wiring-baseline.json @@ -10,7 +10,6 @@ "packages/dashboard/src/routes/register-task-workflow-routes.ts": 1, "packages/dashboard/app/components/Lane.tsx": 1, "packages/dashboard/app/components/ListView.tsx": 1, - "packages/dashboard/app/components/TaskDetailModal.tsx": 1, "packages/dashboard/app/hooks/useBlockerFanout.ts": 1, "packages/cli/src/commands/dashboard-tui/app.tsx": 1, "packages/cli/src/commands/dashboard-tui/bucket-mapping.ts": 1,