test(chat): transcript spacing table, measured against ChatGPT and Claude

Merged
TE
4d ago
+538-0

Leo, 2026-11-02, on our agent chat transcript (big empty gaps between "Sent 3 messages", "Sending message to …" and "2 messages from 2 sessions", the reply footer jammed under the reply):

"ugh we'll really want to study how chatgpt desktop and claude desktop do their spacing i just feel gross looking at these"

"we need to like enforce the good versions when we find them later in the specs/comments/tests or something"

What changed

  • webviews/src/agent-session/acpmux/transcriptSpacing.ts (new): one table of every settled vertical distance between transcript row kinds, measured on chatgpt.com, ChatGPT desktop, Codex desktop, claude.ai and Claude Code desktop, with the source of each value and the spec it comes from (design spec: leo-workspace design/transcript-spacing.md, teamleaderleo/leo-workspace#2406). Also the reply footer's button sizes (ChatGPT's 20-in-32) and the prompt bubble's padding and radius (Claude's 12/16, radius 12).
  • webviews/test/transcript-spacing-table.test.ts (new): draws the new gallery entry in Chromium, light and dark, and checks each row of the table between visible marks: a text line's centre, a bubble's edge, an icon glyph's centre. Line-heights and element nesting don't change those marks, so they can't shift a number without the test noticing.
  • agent-pane.transcript-spacing-table (new gallery entry): every row kind in Leo's capture, in the order he saw them.

A row whose fix hasn't landed carries pending: "<PR>" and runs as test.failing. The fix's PR then has to drop the mark, and from then on the row is enforced. Pending today:

  • the 22 pitch between one-line rows (#31497; these rows are 52 apart on base, which are Leo's gaps);
  • the reply footer (grid-system's footer PR 1b, after #31609);
  • the room around runs and prompts, and the bubble padding (this lane's next PR).

paragraph (34.75) is enforced now.

No product code changes.

Observed / Not run

  • cmux-ci test --setup playwright -- bun test test/transcript-spacing-table.test.ts at this tree (fast-checks run 41373031225): 26 pass. That is paragraph passing, and every pending row failing as expected (test.failing reports it as a pass). Measured on base: one-line rows 52 apart, prompt to step 45.5, run to prose 49, footer glyph 24.25 under the last line, buttons 28 around 16 glyphs, bubble 8/12, radius 10.
  • vp fmt was run on the three files. Not run: the full webviews suite.

Changelog

none

Agent session: agent session

šŸ¤– Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Locks the agent transcript's spacing to values measured against ChatGPT desktop, chatgpt.com, Claude Code desktop, and claude.ai, enforced by a new Chromium test.

  • Adds transcriptSpacing.ts, a table of every vertical distance between transcript row kinds with its source and tolerance, plus the reply footer's button and glyph sizes and the prompt bubble's height, padding, and radius.
  • Adds a gallery entry shaped like Leo's 2026-11-02 capture and a test that measures every gap in light and dark; every row must also find both its marks, so a pending row that measured nothing can't silently pass.
  • Rows whose fix hasn't landed carry pending and run as test.failing; the fix's PR drops the mark and the row is enforced from then on.
  • Only paragraph (34.75) is enforced today; the rest await #31497, the grid-system footer PR, and the room-around-runs work.
  • No product code changes.