From 34fb5420a44512ed1afb3b9231d405071557d444 Mon Sep 17 00:00:00 2001 From: David Kaya Date: Wed, 15 Apr 2026 10:29:19 +0200 Subject: [PATCH] fix: show activity panels for all turns, not just the last one The displayItems logic only injected orphan run panels for the most recent user message's run. Previous turns whose thinking messages were not produced or were lost during reclassification silently dropped their activity panels. Now iterate all unconsumed runs and splice a turn-activity panel after each trigger user message, ensuring every turn with a run gets a visible activity panel in the chat transcript. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/renderer/components/ChatPane.tsx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/renderer/components/ChatPane.tsx b/src/renderer/components/ChatPane.tsx index 728a5ce..1011b2f 100644 --- a/src/renderer/components/ChatPane.tsx +++ b/src/renderer/components/ChatPane.tsx @@ -228,9 +228,30 @@ export function ChatPane({ const activeRun = runsByTrigger.get(lastUserMessageId); if (activeRun && !consumedRunIds.has(activeRun.id)) { items.push({ type: 'turn-activity', thinkingMessages: [], run: activeRun, turnStartedAt: activeRun.startedAt }); + consumedRunIds.add(activeRun.id); } } + // Inject activity panels for any remaining unconsumed runs from + // previous turns (e.g. turns where thinking messages were not + // produced or were lost). Place each panel right after the trigger + // user message so it appears in the correct chronological position. + for (const run of session.runs) { + if (consumedRunIds.has(run.id)) continue; + const triggerIndex = items.findIndex( + (it) => it.type === 'message' && it.message.role === 'user' && it.message.id === run.triggerMessageId, + ); + if (triggerIndex === -1) continue; + const panel: DisplayItem = { + type: 'turn-activity', + thinkingMessages: [], + run, + turnStartedAt: run.startedAt, + }; + items.splice(triggerIndex + 1, 0, panel); + consumedRunIds.add(run.id); + } + // Tag the last turn-activity panel for each run so only it shows // run-level metadata (git summary, discard button, etc.). const lastPanelIndexByRunId = new Map();