console: stop printing the customer's words under the AI's name

A contiguous run of WhatsApp turns collapsed into one timeline entry that kept
the FIRST turn's speaker and previewed the LAST turn's message. When a run held
the customer's question and Engage's answer, the entry carried Engage's chip
over a quote the customer had typed — the trail claimed the machine said
something a person did, which on an accountability demo is the worst thing it
could get wrong.

Runs now group per speaker. That still collapses the case grouping exists for
(the same sentence resent several times) and can no longer misattribute,
because every row in a run is one voice. Customer runs read "the customer /
THE CUSTOMER SAID"; Engage runs read as Engage / WE REPLIED.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yashas 2026-09-09 17:17:25 +05:30
parent 3f36ea610b
commit 0df7d12073

View File

@ -346,7 +346,14 @@ export default function Timeline({ rows, onOpenAgent, onOpenChat, onOpenCall })
const grouped = [] const grouped = []
for (const it of items) { for (const it of items) {
const last = grouped[grouped.length - 1] 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.count += 1
last.when = it.when last.when = it.when
// Keep the newest line as the preview an operator scanning the trail // Keep the newest line as the preview an operator scanning the trail