Agent chat: a composer that grows never moves the transcript

Merged
TE
15d ago
+149-4

Summary

Leo, 2026-10-20: typing a newline in the composer (Shift-Return, or a wrap) makes the transcript's scrollbar jump. Growing the composer must never move the transcript's scroll position, and a view following the latest row stays at the end.

  • agent-pane-scrollbar-full-height.test.ts, sampled after every painted frame while typing five lines with Shift-Return, deleting three, then clearing the draft:
    • "a composer that grows leaves a reader scrolled up where they were on every frame": a reader scrolled up is never moved (no frame's scrollTop differs by more than half a pixel).
    • "a composer that grows and shrinks keeps a followed view at its end on every frame": the latest row stays visible above the composer's card on every frame (no row under the card, never past the end), and it holds the same spot over the card throughout, so the view neither lags a frame nor overshoots.
    • The existing case "a composer that grows keeps the followed end above it on every frame".

Changelog

none

Testing

Command: cd webviews && CMUX_BROWSER_TESTS=1 bun test test/agent-pane-scrollbar-full-height.test.ts (real Chromium).

Observed / Not run

  • CI (Chromium) on 3604d2a and 030cac5: PASS test/agent-pane-scrollbar-full-height.test.ts. The guards pass on the current code, so the same-frame lockstep needs no fix for these cases. This PR adds guards only.
  • Other web / react-apps-check reds on this head are in files this PR does not touch: + is its glyph, named Add with no tooltip (also red on base run 39386215666) and timeouts in composer-location-strip, composer-draft-wrap and composer-type-scale.
  • Not run: WebKit (the test is Chromium-only), and a line made by wrapping instead of Shift-Return.

Agent session: cosmic-gray

šŸ¤– Generated with Claude Code