diff --git a/.changeset/fn-7324-chat-focused-task-detail.md b/.changeset/fn-7324-chat-focused-task-detail.md new file mode 100644 index 0000000000..023aab18bb --- /dev/null +++ b/.changeset/fn-7324-chat-focused-task-detail.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": minor +--- + +summary: Make task details open with a focused planner Chat experience. +category: feature +dev: Reorders task-detail Chat before Activity, keeps legacy Activity tab ids, and pins the planner Chat composer. diff --git a/docs/dashboard-guide.md b/docs/dashboard-guide.md index 9ba2066979..f22535c780 100644 --- a/docs/dashboard-guide.md +++ b/docs/dashboard-guide.md @@ -1040,9 +1040,9 @@ For related global/project configuration behavior, see [Settings reference](./se 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 **Summary** tab appears first for `done` tasks and is their default landing tab. It shows the recorded completion summary, changed-file/merge stats when available, completed steps, workflow results, retry counts, and a token usage & cost section broken down by model from the already-loaded task detail; unpriced models show cost as unavailable rather than `$0`. Non-`done` tasks still open on **Activity** by default. -- The **Activity → Live**, **Feed**, and **Raw Logs** segments share an expand/collapse control that lets the active Activity segment fill the task-detail modal, then restores the normal header, tabs, and action footer when collapsed. -- The top-level **Chat** tab appears immediately after **Activity** and starts a task-scoped planner-model conversation. It uses the task's effective planning model, persists messages in a resumable chat session, and sends bounded server-built task context so the planner can answer current status, progress, recent activity, dependency, and task definition questions without polluting visible chat history. It shows starter prompts for common planning questions, can render structured planner questions, and converts only explicit operator steering intent through the scoped steering tool. Activity remains the primary operational transcript/feed/raw-log surface. +- The top-level **Chat** tab appears first for active task details and is the default landing tab for non-`done` tasks. It starts a task-scoped planner-model conversation using the task's effective planning model, persists messages in a resumable chat session, and sends bounded server-built task context so the planner can answer current status, progress, recent activity, dependency, and task definition questions without polluting visible chat history. It shows starter prompts for common planning questions, can render structured planner questions, and converts only explicit operator steering intent through the scoped steering tool. The composer stays pinned while the transcript, loading, error, starter, history, and streaming states scroll internally; on mobile/narrow task detail, the default focused Chat layout hides nonessential title/metadata/tab/action rows until you collapse it from the in-view expand control. +- The **Activity → Live**, **Feed**, and **Raw Logs** segments remain immediately after **Chat** and share an expand/collapse control that lets the active Activity segment fill the task-detail modal, then restores the normal header, tabs, and action footer when collapsed. +- The **Summary** tab appears for `done` tasks and remains their default landing tab. It shows the recorded completion summary, changed-file/merge stats when available, completed steps, workflow results, retry counts, and a token usage & cost section broken down by model from the already-loaded task detail; unpriced models show cost as unavailable rather than `$0`. - Task-detail Activity steering comments are persisted as user comments/steering guidance and surfaced to every relevant agent lane: live executor sessions receive steering injection, while planner, reviewer (spec/plan/code), and merger agents (standard and clean-room AI merge/review) receive the latest user comments in their next prompt/pass. - The priority chip in task metadata is an inline picker: you can change priority directly without entering full edit mode. - Execution mode has a read-mode inline lightning-bolt toggle for Fast mode on/off without opening the full edit form. @@ -1119,9 +1119,10 @@ Recommended workflow: ordinary chains stay as `Blocks N` so noise stays low, hig ### Activity → Raw Logs view -The **Activity** tab is the first task-detail tab and presents a segmented control for **Live**, **Feed**, and **Raw Logs**. Live contains the live, chat-styled transcript of task agent output. Consecutive entries are grouped by role and labeled as Planner, Executor, Reviewer, or Merger; legacy log rows without an agent role use the neutral Agent fallback. Agent group headers and user message headers show a small muted relative timestamp (for example, “just now”, “1m ago”, or “2h ago”) based on the transcript timestamp, while agent group metadata still includes the entry count. Consecutive text/message chunks inside a role group render as one continuous markdown bubble, while consecutive tool/tool-result/tool-error rows collapse into one expandable, compact tool-call summary that stays collapsed by default and mirrors regular Chat's dense treatment; the summary stays single-line/ellipsis-friendly on desktop and mobile, counts tool invocations, lists deduped tool names with overflow, and shows an error count when failures are present, while the expanded body pairs each call with its result or error in dense entry cards. Thinking entries render in a collapsible block that starts expanded. The transcript opens at the latest output whenever the tab loads or becomes active, then follows new live output when you are already near the bottom while preserving your scroll position when you review older messages. When older task-agent history exists, scrolling to the top or selecting **Load previous messages** prepends earlier transcript entries without moving the message you were reading. When you scroll away from the bottom of a populated transcript, a sticky **Latest** button appears inside the transcript so you can jump back to the newest message and resume live follow. For non-`done` tasks, the **Steering comment** composer sends guidance through the same steering path used by comments, including active planning/triage, `in-progress`, and `in-review` sessions, plus live CLI-agent sessions reported by the session bridge; an `in-review` Activity Live message or Comments-tab task comment re-engages an executor unless an open PR blocks moving the task back, and other messages are still saved as queued guidance when no session is currently live. Feed and Raw Logs do not show a steering composer. On a `done` task, the composer switches to **Refinement request** copy; sending starts a refinement task using the typed text as feedback and shows a success toast with the new task ID, while the current task detail modal remains on the completed task. The task-detail Activity Live segment keeps the composer pinned and visible on mobile and desktop while the transcript scrolls internally; its textarea placeholder reads “Steer the currently executing agent” for steering mode and switches to refinement copy for completed tasks, with the same inline, icon-only send affordance to the right of the input at every breakpoint. In the composer, plain **Enter** sends, **Shift+Enter** inserts a newline, and **Cmd/Ctrl+Enter** remains a supported send shortcut. + +The **Activity** tab is the second task-detail tab, after **Chat**, and presents a segmented control for **Live**, **Feed**, and **Raw Logs**. Live contains the live, chat-styled transcript of task agent output. Consecutive entries are grouped by role and labeled as Planner, Executor, Reviewer, or Merger; legacy log rows without an agent role use the neutral Agent fallback. Agent group headers and user message headers show a small muted relative timestamp (for example, “just now”, “1m ago”, or “2h ago”) based on the transcript timestamp, while agent group metadata still includes the entry count. Consecutive text/message chunks inside a role group render as one continuous markdown bubble, while consecutive tool/tool-result/tool-error rows collapse into one expandable, compact tool-call summary that stays collapsed by default and mirrors regular Chat's dense treatment; the summary stays single-line/ellipsis-friendly on desktop and mobile, counts tool invocations, lists deduped tool names with overflow, and shows an error count when failures are present, while the expanded body pairs each call with its result or error in dense entry cards. Thinking entries render in a collapsible block that starts expanded. The transcript opens at the latest output whenever the tab loads or becomes active, then follows new live output when you are already near the bottom while preserving your scroll position when you review older messages. When older task-agent history exists, scrolling to the top or selecting **Load previous messages** prepends earlier transcript entries without moving the message you were reading. When you scroll away from the bottom of a populated transcript, a sticky **Latest** button appears inside the transcript so you can jump back to the newest message and resume live follow. For non-`done` tasks, the **Steering comment** composer sends guidance through the same steering path used by comments, including active planning/triage, `in-progress`, and `in-review` sessions, plus live CLI-agent sessions reported by the session bridge; an `in-review` Activity Live message or Comments-tab task comment re-engages an executor unless an open PR blocks moving the task back, and other messages are still saved as queued guidance when no session is currently live. Feed and Raw Logs do not show a steering composer. On a `done` task, the composer switches to **Refinement request** copy; sending starts a refinement task using the typed text as feedback and shows a success toast with the new task ID, while the current task detail modal remains on the completed task. The task-detail Activity Live segment keeps the composer pinned and visible on mobile and desktop while the transcript scrolls internally; its textarea placeholder reads “Steer the currently executing agent” for steering mode and switches to refinement copy for completed tasks, with the same inline, icon-only send affordance to the right of the input at every breakpoint. In the composer, plain **Enter** sends, **Shift+Enter** inserts a newline, and **Cmd/Ctrl+Enter** remains a supported send shortcut. -The adjacent top-level **Chat** tab opens the planner-model conversation for the same task instead of posting steering comments. Each send includes server-built, bounded context for the task id, status/column/progress/current step, dependencies, recent activity/comment excerpts, prompt/plan content, and available source/review state; unavailable sections are labeled so the planner states uncertainty rather than inventing execution evidence. When no planner-chat history has loaded yet, Chat shows a guided empty state with starter prompts for recent activity, current status/blockers, next best action, and plan/definition review; selecting one sends that prompt as an ordinary chat message through the task-context-aware planner-chat composer/stream path. The starter prompts disappear while history is loading or after conversation history exists, so Activity Live, Feed, Raw Logs, and the steering composer remain separate. +The preceding top-level **Chat** tab opens the planner-model conversation for the same task instead of posting steering comments. Each send includes server-built, bounded context for the task id, status/column/progress/current step, dependencies, recent activity/comment excerpts, prompt/plan content, and available source/review state; unavailable sections are labeled so the planner states uncertainty rather than inventing execution evidence. When no planner-chat history has loaded yet, Chat shows a guided empty state with starter prompts for recent activity, current status/blockers, next best action, and plan/definition review; selecting one sends that prompt as an ordinary chat message through the task-context-aware planner-chat composer/stream path. The starter prompts disappear while history is loading or after conversation history exists, so Activity Live, Feed, Raw Logs, and the steering composer remain separate. Planner Chat defaults to focused mode, keeps its composer visible at the bottom while only the transcript scrolls, and on narrow/mobile task-detail layouts collapses nonessential rows above the chat until the user selects the Chat collapse control. The **Raw Logs** segment is designed for debugging long-running and tool-heavy sessions, while legacy links that requested the former top-level Logs tab land on Activity → Feed: diff --git a/packages/dashboard/app/components/TaskDetailModal.css b/packages/dashboard/app/components/TaskDetailModal.css index 3a34370e0a..326f7211a3 100644 --- a/packages/dashboard/app/components/TaskDetailModal.css +++ b/packages/dashboard/app/components/TaskDetailModal.css @@ -130,7 +130,8 @@ Task detail workflow badges share the board badge's slight token-based icon-to-l /* Activity → Live and expanded Activity mirror the Raw Logs fill-height layout: the modal body does not scroll; each segment owns internal scrolling while composers and controls stay visible. */ -.detail-body--chat { +.detail-body--chat, +.detail-body--planner-chat { display: flex; flex-direction: column; min-height: 0; @@ -865,6 +866,29 @@ The same expanded-mode chrome collapse now applies to all Activity segments: Liv overflow-y: auto; } +/* +FNXC:TaskDetailPlannerChat 2026-06-30-23:58: +Planner Chat defaults to a focused state, but operator steering says large screens should keep the full task-detail context visible. Desktop therefore uses the same internal-scroll chat body without hiding rows; narrow/mobile layouts collapse nonessential title/meta/tabs/actions so the composer remains reachable while header identity and close/back controls stay available. +*/ +.detail-section--planner-chat { + display: flex; + flex: 1; + flex-direction: column; + min-height: 0; + margin-top: 0; +} + +.task-detail-content--planner-chat-expanded .detail-body--planner-chat { + flex: 1; + min-height: 0; + padding: var(--space-md); +} + +.task-detail-content--planner-chat-expanded .detail-section--planner-chat { + flex: 1; + min-height: 0; +} + .detail-spec-edit-trigger { display: flex; @@ -1141,6 +1165,27 @@ FN-6500 fixes a tablet regression from FN-5599: the task-detail overlay offset a .task-detail-content--chat-expanded .modal-actions { display: none; } + + .task-detail-content--planner-chat-expanded .detail-heading-row, + .task-detail-content--planner-chat-expanded .detail-description-toggle, + .task-detail-content--planner-chat-expanded .detail-meta, + .task-detail-content--planner-chat-expanded .detail-near-duplicate-banner, + .task-detail-content--planner-chat-expanded .detail-tabs, + .task-detail-content--planner-chat-expanded .branch-group-card, + .task-detail-content--planner-chat-expanded .workspace-worktrees-summary, + .task-detail-content--planner-chat-expanded .modal-actions { + display: none; + } + + .task-detail-content--planner-chat-expanded .modal-header { + flex: 0 0 auto; + justify-content: space-between; + padding-block: var(--space-sm); + } + + .task-detail-content--planner-chat-expanded .detail-body--planner-chat { + padding: var(--space-sm); + } } .detail-actions-menu-item-danger { diff --git a/packages/dashboard/app/components/TaskDetailModal.tsx b/packages/dashboard/app/components/TaskDetailModal.tsx index c633a6d7e4..5eb112bc60 100644 --- a/packages/dashboard/app/components/TaskDetailModal.tsx +++ b/packages/dashboard/app/components/TaskDetailModal.tsx @@ -197,10 +197,13 @@ type ActivitySegment = "current" | "feed" | "raw-logs"; /* FNXC:TaskDetailActivityTab 2026-06-30-00:00: -The existing task activity/steering surface keeps the stable internal `chat` tab id for deep-link/plugin compatibility, but its top-level user-facing label is Activity. Activity is the implicit default for active task columns; done tasks keep Summary as their omitted-initial-tab landing surface so completed work still opens on the completion report while Activity remains first in tab order. +The existing task activity/steering surface keeps the stable internal `chat` tab id for deep-link/plugin compatibility, but its top-level user-facing label is Activity. Done tasks keep Summary as their omitted-initial-tab landing surface so completed work still opens on the completion report. FNXC:TaskDetailPlannerChat 2026-06-30-22:30: -Task detail now separates Activity from planner-model Chat. `chat` remains the legacy Activity id for old links and Activity → Live (internal `current`)/Feed/Raw Logs/steering, while `planner-chat` is the new top-level Chat tab for task-aware planning conversation and must render immediately after Activity. +Task detail separates Activity from planner-model Chat. `chat` remains the legacy Activity id for old links and Activity → Live (internal `current`)/Feed/Raw Logs/steering, while `planner-chat` is the top-level Chat tab for task-aware planning conversation. + +FNXC:TaskDetailPlannerChat 2026-06-30-23:58: +Task details should prioritize task-aware Chat: render Chat before Activity, default omitted non-done task opens to `planner-chat`, and reserve expanded/focused layout behavior for the planner Chat surface rather than the legacy Activity `chat` id. FNXC:TaskDetailActivity 2026-06-30-15:50: Only an omitted initial tab is the implicit default. Preserve explicit `initialTab="chat"` requests from plugins and task-detail entrypoints so existing links continue to open Activity → Live (internal `current`). Legacy `initialTab="logs"` now routes to Activity → Feed, and Raw Logs remains an Activity segment. @@ -221,7 +224,7 @@ function resolveDefaultTab(initialTab: TabId | undefined, column: ColumnId): Tab if (initialTab) { return initialTab; } - return column === "done" ? "summary" : "chat"; + return column === "done" ? "summary" : "planner-chat"; } function resolveDefaultActivitySegment(initialTab: TabId | undefined): ActivitySegment { @@ -536,6 +539,7 @@ export function TaskDetailContent({ const [activeTab, setActiveTab] = useState(() => resolveDefaultTab(initialTab, task.column)); const [activitySegment, setActivitySegment] = useState(() => resolveDefaultActivitySegment(initialTab)); const [activityExpanded, setActivityExpanded] = useState(false); + const [plannerChatExpanded, setPlannerChatExpanded] = useState(true); // ── CLI agent session (U11) ──────────────────────────────────────────────── const [cliSession, setCliSession] = useState(null); @@ -683,9 +687,10 @@ export function TaskDetailContent({ } }, [activeTab, task.column]); - // Reset description expanded state when task changes + // Reset description and planner-chat focus state when task changes useEffect(() => { setDescriptionExpanded(false); + setPlannerChatExpanded(true); }, [task.column, task.id]); const [highlightStallCode, setHighlightStallCode] = useState(null); @@ -2618,6 +2623,7 @@ export function TaskDetailContent({ const effectiveAutoMerge = resolveEffectiveAutoMerge({ autoMerge: task.autoMerge }, { autoMerge: autoMergeEnabled }); const isManualPrFlow = mergeStrategy === "pull-request" && !effectiveAutoMerge; const isActivityExpanded = activityExpanded && activeTab === "chat" && !isEditing; + const isPlannerChatExpanded = plannerChatExpanded && activeTab === "planner-chat" && !isEditing; /* FNXC:TaskDetailActivity 2026-06-30-23:55: Maximized Activity applies to Live, Feed, and Raw Logs, not only the legacy `current` chat segment. Reserve the detail surface for header context and Activity content, and do not mount branch-group chrome in this mode so expand/promote controls are not hidden-but-focusable. @@ -2740,7 +2746,7 @@ export function TaskDetailContent({ return (
@@ -2820,7 +2826,7 @@ export function TaskDetailContent({ )}
-
+
{isEditing ? (
{/* - FNXC:TaskDetailPlannerChat 2026-06-30-22:30: - The existing task activity/steering surface is labelled Activity and always renders first with the legacy `chat` tab id. The adjacent `planner-chat` tab is the separate planner-model Chat destination, so `initialTab="chat"` remains Activity while visible Chat opens task-aware planning conversation. + FNXC:TaskDetailPlannerChat 2026-06-30-23:58: + Chat is the first visible task-detail tab and maps to `planner-chat` so omitted non-done task opens prioritize task-aware planning conversation. Activity stays immediately after Chat with the legacy `chat` id for explicit `initialTab="chat"` callers and operational steering/feed/raw-log history. */} - + {task.column === "done" && (
- {isUsableModel(planningModel) && ( - - {planningModel.provider}/{planningModel.modelId} - - )} +
+ {onExpandedChange && ( + + )} + {isUsableModel(planningModel) && ( + + {planningModel.provider}/{planningModel.modelId} + + )} +
- {error &&
{error}
} -
+ {error &&
{error}
} {loading ? (