Files
fusion/packages/dashboard/app/hooks/useMainPanelTaskDetail.ts
gsxdsm a19df338ad FN-7131: add done-task summary tab
Done task details now open to a read-only Summary tab before Chat.

- Add TaskSummaryTab with completion summary markdown, landed-file stats, completed steps, workflow results, and retry context.
- Default done-task detail entrypoints to Summary while preserving explicit tab selections and plugin tab typing.
- Style and localize the Summary tab, document it, and add dashboard coverage for defaulting and tab content.
- Add a minor changeset for the published CLI package.

Files changed:
 .changeset/fn-7131-summary-tab.md                  |   7 +
 docs/dashboard-guide.md                            |   1 +
 packages/dashboard/app/App.tsx                     |   2 +-
 .../dashboard/app/components/TaskDetailModal.css   | 181 +++++++++++++++++
 .../dashboard/app/components/TaskDetailModal.tsx   |  63 ++++--
 .../dashboard/app/components/TaskSummaryTab.tsx    | 160 +++++++++++++++
 .../TaskDetailModal.definition-actions.test.tsx    |  56 +++---
 .../__tests__/TaskDetailModal.summary-tab.test.tsx | 222 +++++++++++++++++++++
 .../dashboard/app/components/dashboard/types.ts    |   2 +-
 .../app/hooks/__tests__/useModalManager.test.ts    |  10 +-
 .../dashboard/app/hooks/useMainPanelTaskDetail.ts  |   9 +-
 packages/dashboard/app/hooks/useModalManager.ts    |  12 +-
 packages/dashboard/app/plugins/types.ts            |   2 +-
 packages/i18n/locales/en/app.json                  |  16 ++
 14 files changed, 687 insertions(+), 56 deletions(-)

Fusion-Task-Id: FN-7131

Fusion-Task-Lineage: e8ca4ade-9904-4705-a151-d9e55f67b398

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 12:15:42 -07:00

26 lines
1.3 KiB
TypeScript

/*
FNXC:TaskDetail 2026-06-24-00:00:
Snapshot of the task whose detail is shown in the main panel (Board card click → full-panel detail), plus its initial tab. Kept as a snapshot so the view survives a tasks revalidation. Exposes the setters so App can compose open/close with view navigation, and so the embedded detail can patch the snapshot on task updates (setTask accepts the updater form). Extracted from AppInner.
FNXC:TaskDetailSummaryTab 2026-06-27-00:00:
An undefined initial tab represents the implicit landing tab. Keep it distinct from explicit Chat so completed tasks can default to Summary while callers can still request Chat.
*/
import { useState, type Dispatch, type SetStateAction } from "react";
import type { Task, TaskDetail } from "@fusion/core";
import type { DetailTaskTab } from "./useModalManager";
export interface UseMainPanelTaskDetailResult {
task: Task | TaskDetail | null;
initialTab: DetailTaskTab | undefined;
setTask: Dispatch<SetStateAction<Task | TaskDetail | null>>;
setInitialTab: (tab: DetailTaskTab | undefined) => void;
}
export function useMainPanelTaskDetail(): UseMainPanelTaskDetailResult {
const [task, setTask] = useState<Task | TaskDetail | null>(null);
const [initialTab, setInitialTab] = useState<DetailTaskTab | undefined>(undefined);
return { task, initialTab, setTask, setInitialTab };
}