diff --git a/.changeset/fn-7434-document-task-status.md b/.changeset/fn-7434-document-task-status.md new file mode 100644 index 0000000000..74d6037a37 --- /dev/null +++ b/.changeset/fn-7434-document-task-status.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": patch +--- + +summary: Show task status badges on Documents task groups. +category: fix +dev: DocumentsView now renders taskColumn metadata in task document group headers and covers collapsed done/non-done states. diff --git a/docs/dashboard-guide.md b/docs/dashboard-guide.md index 0327be1ebd..9dd8446d8a 100644 --- a/docs/dashboard-guide.md +++ b/docs/dashboard-guide.md @@ -674,7 +674,7 @@ Artifacts view aggregates project markdown files, task documents, and registered Features: -- Group task documents by task ID (with revision history metadata) +- Group task documents by task ID (with revision history metadata) and show the parent task status badge in each task group header when status metadata is available - Search documents across tasks - Open project markdown files with inline preview - Browse the **Artifacts** tab for registry media registered by any agent, dashboard chat/user action, or system tool across tasks diff --git a/packages/dashboard/app/components/DocumentsView.css b/packages/dashboard/app/components/DocumentsView.css index 926fc8c860..3690df2c09 100644 --- a/packages/dashboard/app/components/DocumentsView.css +++ b/packages/dashboard/app/components/DocumentsView.css @@ -364,7 +364,7 @@ Artifacts controls are the first page content below the shared header, so add a .documents-group-header { display: grid; - grid-template-columns: minmax(0, 1fr) auto auto; + grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); @@ -421,6 +421,14 @@ Artifacts controls are the first page content below the shared header, so add a white-space: nowrap; } +.documents-group-status { + display: inline-flex; + align-items: center; + gap: var(--space-xs); + justify-self: end; + white-space: nowrap; +} + .documents-group-count { font-size: 12px; color: var(--text-dim); @@ -903,6 +911,7 @@ The artifacts tab is a thumbnail-first responsive media gallery for agent-create grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "toggle count" + "status status" "link link"; row-gap: var(--space-xs); } @@ -911,6 +920,11 @@ The artifacts tab is a thumbnail-first responsive media gallery for agent-create grid-area: toggle; } + .documents-group-status { + grid-area: status; + justify-self: start; + } + .documents-group-count { grid-area: count; justify-self: end; diff --git a/packages/dashboard/app/components/DocumentsView.tsx b/packages/dashboard/app/components/DocumentsView.tsx index e0241c3eac..a7aaebf1c5 100644 --- a/packages/dashboard/app/components/DocumentsView.tsx +++ b/packages/dashboard/app/components/DocumentsView.tsx @@ -4,7 +4,7 @@ import { useTranslation } from "react-i18next"; import { ArrowLeft, FileText, ChevronDown, ChevronUp, ChevronRight, RefreshCw, Search, X, Eye, EyeOff } from "lucide-react"; import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; -import type { ArtifactWithTask, TaskDocumentWithTask, TaskDetail } from "@fusion/core"; +import type { ArtifactWithTask, ColumnId, TaskDocumentWithTask, TaskDetail } from "@fusion/core"; import type { ToastType } from "../hooks/useToast"; import { artifactMediaUrl, fetchTaskDetail, fetchWorkspaceFileContent, type MarkdownFileEntry } from "../api"; import { useArtifacts } from "../hooks/useArtifacts"; @@ -15,6 +15,7 @@ import { SelectionCommentPopover } from "./SelectionCommentPopover"; import { LoadingSpinner } from "./LoadingSpinner"; import { ArtifactMedia, getArtifactTypeLabel } from "./ArtifactMedia"; import { ViewHeader } from "./ViewHeader"; +import { useColumnLabel } from "../i18n/labels"; const MOBILE_BREAKPOINT = 768; @@ -38,6 +39,7 @@ interface TaskGroupProps { taskId: string; taskTitle?: string; documents: TaskDocumentWithTask[]; + taskColumn?: string; onOpenTask: (taskId: string) => void; renderMarkdownStates: Map; onToggleMarkdown: (docId: string) => void; @@ -72,6 +74,13 @@ function getContentPreview(content: string, maxLength: number = 200): string { return `${content.substring(0, maxLength)}…`; } +function getTaskColumnStatusDotClass(taskColumn: string): string { + if (taskColumn === "done") return "status-dot status-dot--online"; + if (taskColumn === "archived") return "status-dot status-dot--offline"; + if (taskColumn === "todo" || taskColumn === "triage") return "status-dot status-dot--pending"; + return "status-dot status-dot--connecting"; +} + function DocumentCard({ document, renderMarkdown, onToggleMarkdown }: DocumentCardProps) { const { t } = useTranslation("app"); const [expanded, setExpanded] = useState(false); @@ -140,9 +149,12 @@ function DocumentCard({ document, renderMarkdown, onToggleMarkdown }: DocumentCa ); } -function TaskGroup({ taskId, taskTitle, documents, onOpenTask, renderMarkdownStates, onToggleMarkdown }: TaskGroupProps) { +function TaskGroup({ taskId, taskTitle, documents, taskColumn, onOpenTask, renderMarkdownStates, onToggleMarkdown }: TaskGroupProps) { const { t } = useTranslation("app"); + const columnLabel = useColumnLabel(); const [expanded, setExpanded] = useState(false); + const taskStatusLabel = taskColumn ? columnLabel(taskColumn as ColumnId) : null; + const taskStatusDotClass = taskColumn ? getTaskColumnStatusDotClass(taskColumn) : "status-dot"; return (
@@ -160,6 +172,13 @@ function TaskGroup({ taskId, taskTitle, documents, onOpenTask, renderMarkdownSta {taskTitle || t("documents.untitled", "Untitled")} + {taskStatusLabel ? ( + + + ) : null} + {t("documents.docCount", "{{count}} doc{{plural}}", { count: documents.length, plural: documents.length !== 1 ? "s" : "" })}