diff --git a/webui/src/components/thread/AgentActivityCluster.tsx b/webui/src/components/thread/AgentActivityCluster.tsx index 46be8b43d..135f33ef6 100644 --- a/webui/src/components/thread/AgentActivityCluster.tsx +++ b/webui/src/components/thread/AgentActivityCluster.tsx @@ -27,6 +27,7 @@ interface ActivityCounts { fileCount: number; added: number; deleted: number; + hasDiffStats: boolean; hasEditingFiles: boolean; hasFailedFiles: boolean; primaryFilePath?: string; @@ -61,6 +62,7 @@ function countActivity(messages: UIMessage[], fileEdits: FileEditSummary[]): Act } let added = 0; let deleted = 0; + let hasDiffStats = false; let hasEditingFiles = false; let failedFileCount = 0; let primaryFilePath: string | undefined; @@ -77,6 +79,10 @@ function countActivity(messages: UIMessage[], fileEdits: FileEditSummary[]): Act if (edit.status === "error" || edit.binary) { continue; } + if (!hasVisibleDiffStats(edit)) { + continue; + } + hasDiffStats = true; added += edit.added; deleted += edit.deleted; } @@ -86,6 +92,7 @@ function countActivity(messages: UIMessage[], fileEdits: FileEditSummary[]): Act fileCount: fileEdits.length, added, deleted, + hasDiffStats, hasEditingFiles, hasFailedFiles: fileEdits.length > 0 && failedFileCount === fileEdits.length, primaryFilePath, @@ -120,6 +127,7 @@ export function AgentActivityCluster({ fileCount, added, deleted, + hasDiffStats, hasEditingFiles, hasFailedFiles, primaryFilePath, @@ -140,6 +148,7 @@ export function AgentActivityCluster({ const headerBusy = fileCount > 0 ? hasEditingFiles : isTurnStreaming; const singleFilePath = fileCount === 1 ? primaryFilePath : undefined; const singleFileTooltipPath = fileCount === 1 ? primaryFileTooltipPath : undefined; + const hasVisibleActivity = reasoningSteps > 0 || toolCalls > 0 || fileCount > 0; const fileActivitySummary = fileCount > 0 ? hasPendingFileEdit && !singleFilePath @@ -243,6 +252,8 @@ export function AgentActivityCluster({ autoFollowActivityRef.current = distance < ACTIVITY_SCROLL_NEAR_BOTTOM_PX; }, []); + if (!hasVisibleActivity) return null; + return (