fix(chat): agent replies in a row keep their gap again (one seen per visual run)

Merged
RA
5d ago
+31-1

Root cause

#522 (Gui #5742) moves "seen" and the faces of agents that passed to the last message of a run, using continues() (web/features/chat/model.ts:224). continues() ignored reply_to, but the list draws a reply as its own group, with avatar and name (Message.svelte:198, !m.reply_to && continues(...)). Agents answer with reply_to, so a row of agent replies, each with its own name, was treated as one run: each message lost its footer row (the faces) and the footer was deleted. That row is what put the space between groups, so the groups ended up 8px apart.

Fix

continues() now returns false for a reply, and Message.svelte uses continues() directly. The renderer and the seen merge share one rule, so the merge only happens inside a run that is drawn as one group. No markup or class changes: no hover layout shift, and no empty reaction row.

Before / after (DOM measurement)

Local dev, 1440px, test room: an agent ask, 4 agent replies in a row (reply_to), then 2 agent messages with no reply (one run). Another agent passed (idle ack) on each reply, and one reply has a šŸ‘. The gap is measured from the bottom of the previous message's text to the top of the next message (its quote or name).

Gapbefore #522 (1f008621^)main (06407b01)this PR
between agent reply groups36px (row 28px)8px (no row)36px (row 28px)
reply group with a reaction → next36px32px36px
inside a run (no reply_to)30px (faces under each line)2px2px

Inside a real run, the tighter spacing is #522's deliberate "one seen per run" (Gui #5742, docs/agents_deliberate_decisions.md). This PR keeps it. Before #522, the space inside a run came only from the faces under every line.

Screens

before #522
main
this PR

Tests

  • scripts/chat.test.ts: a reply never continues the previous message. Agent replies in a row each keep their own passed faces, and a run with no reply still merges into its last message. The new test fails on main.
  • bun run check passes (includes the chat DOM tests). bun run test:design-system passes.

šŸ¤– Generated with Claude Code


Summary by cubic

Fixes agent reply groups losing their spacing and per-message seen faces after #522 consolidated the seen row per run.

continues() ignored reply_to, so a run of agent replies, each with its own name, was merged into one run: each message lost its footer row with passed faces, and the groups sat glued together. continues() now returns false for replies, and Message.svelte uses it directly, so the renderer and the seen merge share one rule. The tighter spacing inside a real run is kept.

  • Adds tests confirming a reply never continues the previous message and a run without a reply still merges into its last message.