diff --git a/src/components/Timeline.jsx b/src/components/Timeline.jsx index 6b3ef90..1236fef 100644 --- a/src/components/Timeline.jsx +++ b/src/components/Timeline.jsx @@ -346,7 +346,14 @@ export default function Timeline({ rows, onOpenAgent, onOpenChat, onOpenCall }) const grouped = [] for (const it of items) { const last = grouped[grouped.length - 1] - if (it.isChat && last && last.isChat) { + // SAME SPEAKER ONLY. Collapsing every contiguous chat turn folded the + // customer's question and the AI's answer into one entry that kept the + // FIRST turn's name and the LAST turn's words — so the customer's message + // printed under Engage's chip, attributing to the machine something a + // person had typed. Grouping per speaker still collapses the case this + // exists for (the same sentence resent four times) and can never + // misattribute, because every row in a run is the same voice. + if (it.isChat && last && last.isChat && last.agentKey === it.agentKey) { last.count += 1 last.when = it.when // Keep the newest line as the preview — an operator scanning the trail