gallery health: received-row plays open "Received N messages"; a sender's mark centres on its line

Merged
TE
3d ago
+42-14

Base red: gallery health on feat-cmux-next (run 41623839244 at f504928798). This PR fixes the cluster for received and agent-message rows.

What was red, and the cause

Broken: "play: waitFor did not hold within 5000 ms"

  • agent-pane.incoming-message#files, #files-elsewhere, #minimal-open, #minimal-fade-count, #minimal-inline-name
  • agent-pane.agent-message-row#folded-run-opened

Culprit: #32720 ("Transcript: a turn's inbox notices and received lines are one "Received N messages" row"). That was a deliberate design change. Leo, 2026-11-02: "can't we simply just display most of these as recieved x messages and all of them get revealed then we can expand the messages". Received lines that sit next to each other now gather in one closed "Received N messages" row. These plays waited for .cv-received lines that only show once that row is open.

Fix: the plays follow the design. They open the row first, as #32820 does for IncomingMessageDisclosure.gallery.ts (that file is not touched here) and #32823 did for the message-preview browser test. In IncomingMessageCard.gallery.ts, openAllLines and linesDrawn call a new openReceivedRow. AgentMessageRow.gallery.ts#folded-run-opened opens the row before it opens each line. The comments and notes that still said several received lines "never fold into one" now describe the row.

Geometry [center-line]: "row received:user-N: its icon centres -2 px off its first line"

  • agent-pane.message-preview#baseline-fade, #full-cards-no-fade, #one-line, #cards-no-fade
  • agent-pane.agent-message-row#folded-run (row received:user-76)

Culprit: #32720 again, which made these states' received lines into a "Received N messages" head with the row key received:<first id>. The head has one sender, so it draws that sender's mark (SenderMark, in the head since #30652). The mark nests its glyph in inline spans: AgentIdentity's wrapper, then the tone span. An inline svg sits on a text baseline, so the glyph drew 2px above the line's centre. The individual received lines had the same 2px miss before: invariant-baseline.json lists them as center-line:row user-1/user-2. Under the new key, the miss is a new red.

Fix (CSS): the mark's wrappers centre the glyph (inline-flex, align-items: center, and the svg/img display: block). This applies in the group head (MessageGroupHead.css) and in a received line's mark (conversation.css, where only the direct child span was centred). The Chief's text avatar keeps its own box. This follows the design rule the invariant cites (chat-transcript.md "glyph centered": a row's leading icon centres on its first line).

Layout shift past baseline

  • agent-pane.agent-message-row#both-directions-opened: shift 0.0265 vs baseline 0.02068 (light theme only, on all three attempts). The play opens the sent line, then the received line. Each opened panel pushes the rows under it down. That move is the variant's purpose and is no regression of its own.

The shift row is raised to 0.0265 so it matches the opened lines' geometry today. Exact culprit: not pinned from the artifacts. The run lists no moving rows, and several deliberate row changes since the row was written (#30256) touch these lines: #32867 puts the chevron after the label, #32574 shows the reply's Copy footer at rest under the turn, and #32742 changes received-row spacing. This is the one baseline row raised, and only by the measured amount. The dark theme of the same state stays under the old row.

Shift rows for the plays that now open the row. Opening the gathered row adds one more step, and the rows under it move one more time. This PR's first gallery run (41631275437) showed every play passing and every received center-line miss gone. It also put these states past their old shift rows. Each row is set to that run's measured worst, the same thing #32820 does for the disclosure entry:

stateoldnew
incoming-message#files0.154890.2418
incoming-message#files-elsewhere0.007730.0154
incoming-message#minimal-open0.036590.0624
incoming-message#minimal-fade-count00.0175
incoming-message#minimal-inline-name00.0175
agent-message-row#folded-run-opened0.056510.0974

Risk

Low. The gallery plays and notes change only fixtures. The CSS changes only how a sender's mark centres inside its 16px slot: the glyph moves at most 2px down onto the line's centre, and the row's size does not change. This PR's own gallery health run is the check.

Agent session: agent session

šŸ¤– Generated with Claude Code