Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(views): coalesce repeated task_completed/task_failed activity entries (#2044)

Jiayuan Zhang9a5f5ca49842
diff --git a/packages/core/types/activity.ts b/packages/core/types/activity.ts
index 1f33a06801..b857cffc6c 100644
--- a/packages/core/types/activity.ts
+++ b/packages/core/types/activity.ts
@@ -23,4 +23,6 @@ export interface TimelineEntry {
comment_type?: string;
reactions?: Reaction[];
attachments?: Attachment[];
+ /** Set by frontend coalescing when consecutive identical activities are merged. */
+ coalesced_count?: number;
}
diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsx
index eac22faf02..a4e2bc79a3 100644
--- a/packages/views/issues/components/issue-detail.tsx
+++ b/packages/views/issues/components/issue-detail.tsx
@@ -113,10 +113,14 @@ function formatActivity(
return `renamed this issue from "${details.from ?? "?"}" to "${details.to ?? "?"}"`;
case "description_updated":
return "updated the description";
- case "task_completed":
- return "completed the task";
- case "task_failed":
- return "task failed";
+ case "task_completed": {
+ const n = entry.coalesced_count ?? 1;
+ return n > 1 ? `completed the task (${n} times)` : "completed the task";
+ }
+ case "task_failed": {
+ const n = entry.coalesced_count ?? 1;
+ return n > 1 ? `task failed (${n} times)` : "task failed";
+ }
default:
return entry.action ?? "";
}
@@ -259,8 +263,11 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
}
}
- // Coalesce: same actor + same action within 2 min → keep last only
+ // Coalesce consecutive activities from the same actor + action.
+ // - task_completed / task_failed: no time limit (these repeat across runs)
+ // - all other actions: within a 2-minute window
const COALESCE_MS = 2 * 60 * 1000;
+ const NO_TIME_LIMIT_ACTIONS = new Set(["task_completed", "task_failed"]);
const coalesced: TimelineEntry[] = [];
for (const entry of topLevel) {
if (entry.type === "activity") {
@@ -270,9 +277,10 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
prev.action === entry.action &&
prev.actor_type === entry.actor_type &&
prev.actor_id === entry.actor_id &&
- Math.abs(new Date(entry.created_at).getTime() - new Date(prev.created_at).getTime()) <= COALESCE_MS
+ (NO_TIME_LIMIT_ACTIONS.has(entry.action!) ||
+ Math.abs(new Date(entry.created_at).getTime() - new Date(prev.created_at).getTime()) <= COALESCE_MS)
) {
- coalesced[coalesced.length - 1] = entry;
+ coalesced[coalesced.length - 1] = { ...entry, coalesced_count: (prev.coalesced_count ?? 1) + 1 };
continue;
}
}