From c88c609ac81ddc9d76c530f93b62c0fc52d081d8 Mon Sep 17 00:00:00 2001 From: Adam Bowker Date: Mon, 20 Jul 2026 11:44:37 -0400 Subject: [PATCH] fix(canvas): show only team messages in thread sidebar on full task view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The channel task detail route renders the thread sidebar next to TaskDetail, which already hosts the agent session. The sidebar's timeline interleaved agent turns and user→agent prompts with the team conversation, so expanding a task from the channel-home thread left the same agent comms duplicated in both panes. Add a showAgentComms prop (default true) to ThreadPanel/ThreadSidebar that drops agent turns and prompts from the timeline and hides the agent status line. The full task view passes false, so its sidebar shows only the human-to-human thread. The channel-home sidebar is unchanged. Generated-By: PostHog Code Task-Id: c44f7e31-52a1-404e-8eda-0d21860bf272 --- .../features/canvas/components/ThreadPanel.tsx | 15 +++++++++++---- .../features/canvas/components/ThreadSidebar.tsx | 5 +++++ .../routes/website/$channelId/tasks/$taskId.tsx | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/features/canvas/components/ThreadPanel.tsx b/packages/ui/src/features/canvas/components/ThreadPanel.tsx index fba801b8f1..0166a4450f 100644 --- a/packages/ui/src/features/canvas/components/ThreadPanel.tsx +++ b/packages/ui/src/features/canvas/components/ThreadPanel.tsx @@ -482,6 +482,7 @@ function ThreadConversation({ onToggleCollapsed, onOpenFull, showTaskSummary, + showAgentComms, }: { task: Task; channelId: string; @@ -489,6 +490,7 @@ function ThreadConversation({ onToggleCollapsed?: () => void; onOpenFull?: () => void; showTaskSummary: boolean; + showAgentComms: boolean; }) { const taskId = task.id; const client = useOptionalAuthenticatedClient(); @@ -557,8 +559,8 @@ function ThreadConversation({ const timeline = useMemo( () => buildThreadTimeline({ - prompts: promptMsgs, - agentMessages: agentMsgs, + prompts: showAgentComms ? promptMsgs : [], + agentMessages: showAgentComms ? agentMsgs : [], humanMessages: messages.map((message) => ({ id: message.id, content: message.content, @@ -567,7 +569,7 @@ function ThreadConversation({ value: message, })), }), - [promptMsgs, messages, agentMsgs], + [promptMsgs, messages, agentMsgs, showAgentComms], ); const lastAgentId = agentMsgs[agentMsgs.length - 1]?.id; @@ -680,7 +682,9 @@ function ThreadConversation({ /> - {agentStatus && } + {showAgentComms && agentStatus && ( + + )} void; onOpenFull?: () => void; showTaskSummary?: boolean; + showAgentComms?: boolean; }) { const { data: fetchedTask } = useQuery({ ...taskDetailQuery(taskId), @@ -747,6 +753,7 @@ export function ThreadPanel({ onToggleCollapsed={onToggleCollapsed} onOpenFull={onOpenFull} showTaskSummary={showTaskSummary} + showAgentComms={showAgentComms} /> ); } diff --git a/packages/ui/src/features/canvas/components/ThreadSidebar.tsx b/packages/ui/src/features/canvas/components/ThreadSidebar.tsx index 4a81cf8700..727c785aa7 100644 --- a/packages/ui/src/features/canvas/components/ThreadSidebar.tsx +++ b/packages/ui/src/features/canvas/components/ThreadSidebar.tsx @@ -17,6 +17,7 @@ export function ThreadSidebar({ onClose, onOpenFull, showTaskSummary, + showAgentComms = true, }: { taskId: string; channelId: string; @@ -25,6 +26,8 @@ export function ThreadSidebar({ onClose?: () => void; onOpenFull?: () => void; showTaskSummary?: boolean; + /** Show agent turns/prompts and the agent status line. Off on the full task view, where the agent session already lives next to the thread. */ + showAgentComms?: boolean; }) { const collapsed = useThreadPanelStore((s) => s.collapsed); const width = useThreadPanelStore((s) => s.width); @@ -49,6 +52,7 @@ export function ThreadSidebar({ task={task} collapsed onToggleCollapsed={() => toggleCollapsed(false)} + showAgentComms={showAgentComms} /> ); } @@ -70,6 +74,7 @@ export function ThreadSidebar({ onToggleCollapsed={() => toggleCollapsed(true)} onOpenFull={onOpenFull} showTaskSummary={showTaskSummary} + showAgentComms={showAgentComms} /> ); diff --git a/packages/ui/src/router/routes/website/$channelId/tasks/$taskId.tsx b/packages/ui/src/router/routes/website/$channelId/tasks/$taskId.tsx index 62ce110a5d..3a2da4b020 100644 --- a/packages/ui/src/router/routes/website/$channelId/tasks/$taskId.tsx +++ b/packages/ui/src/router/routes/website/$channelId/tasks/$taskId.tsx @@ -73,6 +73,7 @@ function ChannelTaskDetailRoute() { channelId={channelId} task={task} showTaskSummary={false} + showAgentComms={false} /> );