Skip to content

Commit c01c0a2

Browse files
sallyomclaude
andcommitted
fix(frontend): Filter out started events when session is completed
The Activity Timeline was showing both "Session Started" (with spinning icon) and "Session Completed" events for the same session, making it appear that sessions were still running even after completion. Now filters out session_started events when a corresponding session_completed or session_failed event exists for the same sessionId. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Signed-off-by: sallyom <[email protected]>
1 parent 104894e commit c01c0a2

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

components/frontend/src/components/workspaces/bugfix/BugTimeline.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,25 @@ interface BugTimelineProps {
4040

4141
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4242
export default function BugTimeline({ workflowId, events, sessions = [], className }: BugTimelineProps) {
43+
// Filter out session_started events if there's a corresponding completed/failed event
44+
const filteredEvents = events.filter((event) => {
45+
// Keep all non-started events
46+
if (event.type !== 'session_started') {
47+
return true;
48+
}
49+
50+
// For session_started events, only keep if there's no corresponding completed/failed event
51+
const hasCompletionEvent = events.some(
52+
(e) =>
53+
e.sessionId === event.sessionId &&
54+
(e.type === 'session_completed' || e.type === 'session_failed')
55+
);
56+
57+
return !hasCompletionEvent;
58+
});
59+
4360
// Sort events by timestamp (newest first)
44-
const sortedEvents = [...events].sort((a, b) =>
61+
const sortedEvents = [...filteredEvents].sort((a, b) =>
4562
new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
4663
);
4764

0 commit comments

Comments
 (0)