From 7fd14eb88c70d0e8c032064251f255b2d0ba0233 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Sun, 21 Jun 2026 23:07:55 -0700 Subject: [PATCH] FN-6907: rename task documents to artifacts Rename the task-modal Documents tab to Artifacts and include task-scoped media outputs alongside task documents. - Add shared artifact media rendering for global and task-local artifact cards. - Surface image, video, audio, document, and generic artifacts in the task Artifacts tab. - Update tab labels, empty states, counts, translations, tests, docs, and release notes for the Artifacts wording. Files changed: .changeset/fn-6907-task-artifacts-tab.md | 5 + docs/dashboard-guide.md | 5 +- .../dashboard/app/components/ArtifactMedia.tsx | 55 +++++++ .../dashboard/app/components/DocumentsView.tsx | 47 +----- .../dashboard/app/components/TaskDetailModal.tsx | 3 +- .../dashboard/app/components/TaskDocumentsTab.css | 33 +++++ .../dashboard/app/components/TaskDocumentsTab.tsx | 109 ++++++++++++-- .../TaskDetailModal.attachments-and-tabs.test.tsx | 4 +- .../TaskDetailModal.definition-actions.test.tsx | 20 +-- .../components/__tests__/TaskDocumentsTab.test.tsx | 160 ++++++++++++++++++++- packages/i18n/locales/en/app.json | 16 ++- packages/i18n/locales/es/app.json | 16 ++- packages/i18n/locales/fr/app.json | 16 ++- packages/i18n/locales/ko/app.json | 16 ++- packages/i18n/locales/zh-CN/app.json | 16 ++- packages/i18n/locales/zh-TW/app.json | 16 ++- 16 files changed, 436 insertions(+), 101 deletions(-) Fusion-Task-Id: FN-6907 Fusion-Task-Lineage: a1318ed5-4d47-42f8-8b6c-fe91506e11fb --- .changeset/fn-6907-task-artifacts-tab.md | 5 + docs/dashboard-guide.md | 5 +- .../app/components/ArtifactMedia.tsx | 55 ++++++ .../app/components/DocumentsView.tsx | 47 +---- .../app/components/TaskDetailModal.tsx | 3 +- .../app/components/TaskDocumentsTab.css | 33 ++++ .../app/components/TaskDocumentsTab.tsx | 109 +++++++++++- ...kDetailModal.attachments-and-tabs.test.tsx | 4 +- ...askDetailModal.definition-actions.test.tsx | 20 +-- .../__tests__/TaskDocumentsTab.test.tsx | 162 +++++++++++++++++- packages/i18n/locales/en/app.json | 16 +- packages/i18n/locales/es/app.json | 16 +- packages/i18n/locales/fr/app.json | 16 +- packages/i18n/locales/ko/app.json | 16 +- packages/i18n/locales/zh-CN/app.json | 16 +- packages/i18n/locales/zh-TW/app.json | 16 +- 16 files changed, 437 insertions(+), 102 deletions(-) create mode 100644 .changeset/fn-6907-task-artifacts-tab.md create mode 100644 packages/dashboard/app/components/ArtifactMedia.tsx diff --git a/.changeset/fn-6907-task-artifacts-tab.md b/.changeset/fn-6907-task-artifacts-tab.md new file mode 100644 index 0000000000..ffdb6f32b0 --- /dev/null +++ b/.changeset/fn-6907-task-artifacts-tab.md @@ -0,0 +1,5 @@ +--- +"@runfusion/fusion": minor +--- + +Rename the task detail Documents tab to Artifacts and add a task-scoped media artifact gallery alongside existing task documents. diff --git a/docs/dashboard-guide.md b/docs/dashboard-guide.md index 80507c1f1f..d45019a163 100644 --- a/docs/dashboard-guide.md +++ b/docs/dashboard-guide.md @@ -487,7 +487,7 @@ Features: - Open project markdown files with inline preview - Browse the **Artifacts** tab for media registered by agents, users, or the system across tasks - Preview artifact images inline, play video and audio with native controls, read document previews, and open generic artifacts through their media URL -- Jump directly from a document group or artifact card to the owning task detail modal when a task is linked +- Jump directly from a document group or artifact card to the owning task detail modal when a task is linked; inside task detail, the **Artifacts** tab shows that task's documents and registered media artifacts together - Toggle between raw text and rendered markdown using the **Markdown/Plain** button - Highlight text in raw or rendered project-file previews, choose **Add comment**, and send the file path, selected snippet, and your comment to the **New Task** dialog @@ -812,7 +812,7 @@ For related global/project configuration behavior, see [Settings reference](./se ## Task Detail Modal -Inspect task definition, logs, review feedback, comments, documents, workflow outcomes, model overrides, and task routing from a single modal. +Inspect task definition, logs, review feedback, comments, artifacts, workflow outcomes, model overrides, and task routing from a single modal. - Editable tasks with descriptions show **Summarize as title** beside the read-mode title; it asks AI to generate a concise title from the description and saves it without opening the edit form. - The **Chat** tab includes an expand/collapse control that lets the transcript and composer fill the task-detail modal, then restores the normal header, tabs, and action footer when collapsed. @@ -831,6 +831,7 @@ Inspect task definition, logs, review feedback, comments, documents, workflow ou - The **Create Pull Request** modal now offers in-app remediation for every blocking preflight check. If `branchOnRemote` is false, use **Push branch to remote** and Fusion will publish `fusion/` to `origin` and refresh preflight. If `conflictsWithBase` is true, use **Resolve conflicts with AI** and Fusion will use an AI coding agent to resolve merge markers on the task branch, commit and push real merge changes, or report success without an empty commit when the selected base is already merged; preflight then refreshes so normal PR creation can continue once all checks pass. - The modal shell renders immediately: preflight checks and PR options load independently of AI-generated title/body metadata, so slow AI suggestions no longer block base-branch selection, diagnostics, or manual PR authoring. - AI title/body generation is bounded to 60 seconds and is canceled if the dialog request disconnects; on timeout/cancel, Fusion falls back to deterministic task-based PR title/body content instead of leaving the spinner stuck forever. +- The **Artifacts** tab combines task documents written by agents or users with task-scoped registered media artifacts. Images preview inline, video and audio use native controls, document artifacts show text previews, and generic artifacts open through their media URL. - The **Review** tab is separate from **Comments**: Review shows actionable PR/reviewer feedback and same-task revision controls, while Comments remains the general collaboration thread. - **Request revision** in Review resumes work on the same task ID (no refinement task): `in-progress` tasks get steering injection, while `in-review` tasks are moved back to `in-progress` for the same branch/worktree revision pass. - Review supports a manual **Refresh** action in-place: PR mode pulls latest GitHub review state/decision, while direct mode rehydrates reviewer-agent feedback from persisted task data (no GitHub call). diff --git a/packages/dashboard/app/components/ArtifactMedia.tsx b/packages/dashboard/app/components/ArtifactMedia.tsx new file mode 100644 index 0000000000..6636d75a95 --- /dev/null +++ b/packages/dashboard/app/components/ArtifactMedia.tsx @@ -0,0 +1,55 @@ +import { FileText, Package } from "lucide-react"; +import type { TFunction } from "i18next"; +import type { ArtifactType, ArtifactWithTask } from "@fusion/core"; + +export function getArtifactTypeLabel(t: TFunction<"app">, type: ArtifactType): string { + switch (type) { + case "image": + return t("documents.artifactTypeImage", "Image"); + case "video": + return t("documents.artifactTypeVideo", "Video"); + case "audio": + return t("documents.artifactTypeAudio", "Audio"); + case "document": + return t("documents.artifactTypeDocument", "Document"); + case "other": + return t("documents.artifactTypeOther", "Other"); + } +} + +interface ArtifactMediaProps { + artifact: Pick; + mediaUrl: string; + title: string; + preview?: string; + t: TFunction<"app">; +} + +/** + * FNXC:ArtifactRegistry 2026-06-21-21:31: + * The global Documents gallery and the per-task Artifacts tab must share one media renderer so image, video, audio, document, and generic artifact previews cannot drift across dashboard surfaces. + */ +export function ArtifactMedia({ artifact, mediaUrl, title, preview, t }: ArtifactMediaProps) { + switch (artifact.type) { + case "image": + return {title}; + case "video": + return