Agent chat: opening the running tray moves no transcript row

Merged
TE
5d ago
+291-6

Leo, 2026-11-01:

and this also there's a layout shift when i expand it

tho i did say maybe it'd be better to just have it attached to the bottom message rather than the composer but im not sure

Picked: the tray stays on the composer

Both placements are in the gallery (agent-pane.subagent-tray):

  • expand-on-composer (chosen). The tray stays on the composer, and opening it moves no transcript row. Its columns stay on the composer's (Stop over Stop, chevron over the microphone), as ChatGPT and Claude desktop keep their working strip with the input.
  • expand-after-latest (not chosen). The tray sits under the latest message, in the transcript's flow. At the end, opening it pushes the whole transcript up by what opened (141px in the fixture), the same shift in a new place, and its columns no longer line up with the composer's.

The shift, and the fix

The room under the last row (VirtualTranscript dockSpace) followed the bottom stack's height on every frame of the tray's fold, so the view, pinned at the latest row, rode the fold up.

Now, what the reader opens or folds in the tray lies over the transcript's foot, as a menu over the composer does. That covers the header, View all and a command's live tail. The room keeps what it was (trayHold, App.tsx) until one of these:

  • the rows move anyway: a reply streaming on or a send gives the room an opened list at once, and a folded list's room is filled as the rows grow;
  • Jump to latest;
  • the reader's wheel down at the end (giveTrayRoom).

A line that joins or leaves the tray, and the tray coming or going, make room as before. Scrolled up, nothing changed.

MetricBeforeAfterDeltaHarness
Latest row's move when the tray opens at the end (760×380, panel-two)141px, over 3 frames0px−141pxChromium probe on the gallery stage
Latest row's move, any painted frame, open then fold (760×420, expand-on-composer)≥1px from frame 1≤0.5px—test/subagent-tray-expand-shift.test.ts

New: one capture-phase click listener on the dock (removed with the dock's ResizeObserver) and one passive wheel listener on the scroller (removed on unmount). No timers or animation loops.

Tests

CMUX_BROWSER_TESTS=1 bun test test/subagent-tray-expand-shift.test.ts (Chromium):

  • on base: 2 fail (a row moved on the first painted frame; the rows were never under the tray);
  • on this head: 2 pass.

Observed / Not run

  • Observed: the file above, red on base and green on this head, on this lane VM with a local Chromium; vp fmt, oxlint and check-browser-test-lanes on the changed files.
  • Not run locally: the full bun run check type check and the webview suite; CI runs them.

Leo's other question in the same message, whether expanding tool calls still pushes the chat up, is a different path (the transcript's fold anchor). #29857 is open on it, so this PR leaves it alone.

Design: running tray ("Placement and opening", branch lane/tray-expand-no-shift-spec).

Risk: normal. The transcript's room under the last row changes only for a click on the tray's own disclosures; every other path computes trayHold = 0.

Changelog

Fixed: Opening or folding the running tray above the composer no longer moves the conversation.

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

Opening the running tray in agent chat no longer shifts the transcript. The tray previously pushed the whole conversation up as it expanded; now what opens in it lies over the transcript's foot, and the room under the last row stays as-is until the rows move anyway.

  • The room takes what opened once the rows move (a reply streaming in, a send), on Jump to latest, or when the reader scrolls past the end.
  • Drafts skip measuring the tray's leaving exit copy and hold no room for a click that changes no height.
  • Adds gallery comparisons of the chosen placement (tray on the composer) against the rejected alternative (tray under the latest message), and a Chromium test asserting no row moves on any painted frame.