Files
fusion/packages/dashboard/app/components/AgentTaskBadge.tsx
gsxdsm 9e7c57da08 FN-7139: show task columns on agent badges
Enrich dashboard agent task indicators with linked task column context.

- Add API-side transient taskColumn enrichment for active agent task links, including an unresolved sentinel for missing tasks.
- Render shared agent task badges across agent panels, detail views, lists, and mobile surfaces.
- Extend dashboard/API coverage and document the task-column badge behavior with a published changeset.

Files changed:
 .changeset/fn-7139-agent-task-column-context.md    |  7 ++
 docs/dashboard-guide.md                            |  2 +
 packages/core/src/types.ts                         |  5 ++
 .../dashboard/app/components/ActiveAgentsPanel.tsx |  3 +-
 .../dashboard/app/components/AgentDetailView.tsx   |  5 +-
 .../dashboard/app/components/AgentListModal.tsx    |  3 +-
 .../dashboard/app/components/AgentTaskBadge.tsx    | 28 +++++++
 packages/dashboard/app/components/AgentsView.tsx   |  3 +-
 .../__tests__/ActiveAgentsPanel.test.tsx           | 55 ++++++++++---
 .../__tests__/AgentDetailView.core.test.tsx        | 65 +++++++++++++++
 .../AgentDetailView.mobile-scroll.test.tsx         | 16 +++-
 .../components/__tests__/AgentListModal.test.tsx   | 16 +++-
 .../app/components/__tests__/AgentsView.test.tsx   | 23 +++++-
 .../dashboard/src/__tests__/routes-agents.test.ts  | 92 +++++++++++++++++++++-
 packages/dashboard/src/routes.ts                   | 13 ++-
 15 files changed, 306 insertions(+), 30 deletions(-)

Fusion-Task-Id: FN-7139
Fusion-Task-Lineage: 3f6d9470-b98f-4bd3-a91e-7e69ab624d48
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 17:11:13 -07:00

29 lines
1008 B
TypeScript

import type { ColumnId } from "@fusion/core";
import { useTranslation } from "react-i18next";
import { useColumnLabel } from "../i18n/labels";
const UNRESOLVED_AGENT_TASK_COLUMN = "unresolved";
interface AgentTaskBadgeProps {
taskId: string;
taskColumn?: string;
}
/*
* FNXC:AgentTaskStateDrift 2026-06-27-16:20:
* Agent task badges include the linked task column to disambiguate legitimate triage/queued linkage from execution drift.
*
* FNXC:AgentTaskStateDrift 2026-06-27-17:08:
* Unresolved linked tasks need an explicit badge suffix so missing/deleted tasks do not look like a merely un-enriched response.
*/
export function AgentTaskBadge({ taskId, taskColumn }: AgentTaskBadgeProps) {
const columnLabel = useColumnLabel();
const { t } = useTranslation("app");
if (!taskColumn || taskColumn === UNRESOLVED_AGENT_TASK_COLUMN) {
return <>{taskId} · {t("agents.taskColumnUnresolved", "Unresolved task")}</>;
}
return <>{taskId} · {columnLabel(taskColumn as ColumnId)}</>;
}