ui: deduplicate live run from comments timeline
When an issue has an active running run, the same run was appearing both as a live widget and as a run entry in the comments timeline. Filter out runs shown by the live widget from the timeline linkedRuns to prevent this duplication. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -214,6 +214,15 @@ export function IssueDetail() {
|
|||||||
|
|
||||||
const hasLiveRuns = (liveRuns ?? []).length > 0 || !!activeRun;
|
const hasLiveRuns = (liveRuns ?? []).length > 0 || !!activeRun;
|
||||||
|
|
||||||
|
// Filter out runs already shown by the live widget to avoid duplication
|
||||||
|
const timelineRuns = useMemo(() => {
|
||||||
|
const liveIds = new Set<string>();
|
||||||
|
for (const r of liveRuns ?? []) liveIds.add(r.id);
|
||||||
|
if (activeRun) liveIds.add(activeRun.id);
|
||||||
|
if (liveIds.size === 0) return linkedRuns ?? [];
|
||||||
|
return (linkedRuns ?? []).filter((r) => !liveIds.has(r.runId));
|
||||||
|
}, [linkedRuns, liveRuns, activeRun]);
|
||||||
|
|
||||||
const { data: allIssues } = useQuery({
|
const { data: allIssues } = useQuery({
|
||||||
queryKey: queryKeys.issues.list(selectedCompanyId!),
|
queryKey: queryKeys.issues.list(selectedCompanyId!),
|
||||||
queryFn: () => issuesApi.list(selectedCompanyId!),
|
queryFn: () => issuesApi.list(selectedCompanyId!),
|
||||||
@@ -743,7 +752,7 @@ export function IssueDetail() {
|
|||||||
<TabsContent value="comments">
|
<TabsContent value="comments">
|
||||||
<CommentThread
|
<CommentThread
|
||||||
comments={commentsWithRunMeta}
|
comments={commentsWithRunMeta}
|
||||||
linkedRuns={linkedRuns ?? []}
|
linkedRuns={timelineRuns}
|
||||||
issueStatus={issue.status}
|
issueStatus={issue.status}
|
||||||
agentMap={agentMap}
|
agentMap={agentMap}
|
||||||
draftKey={`paperclip:issue-comment-draft:${issue.id}`}
|
draftKey={`paperclip:issue-comment-draft:${issue.id}`}
|
||||||
|
|||||||
Reference in New Issue
Block a user