Keep transcript bottom pinned while tool folds open

Merged
TE
6d ago
+248-58

Opening a tool/work disclosure at the end of a long transcript now keeps the bottom pinned and moves the content upward in one stack. Away from the end, the clicked row keeps its existing anchor.

Leo (2026-10-31): “CHATGPT WHEN YOU EXPAND THEIR TOOL CALLS THEY PUSH THE CHAT UP / THAT'S THE BEHAVIOUR WE WANT / THE LITTLE ANIMATION FOR IT GRACEFULLY ALL MOVING UP AS A STACK TOO / FAST NO FLICKER SMOOTH THAT'S IT”.

The body takes its final height before paint; one thread transform uses the shared fold token (180ms by default). No body-height animation or additional ResizeObserver runs alongside it. Late measurements update the same animation without restarting its clock. Reduce Motion snaps. Short transcripts and message disclosures retain their existing behavior.

The animation ends naturally. A bounded settle timer handles no-size-change toggles; both are cleaned up on reader input, another toggle, Find, send, Jump to latest, chat switch and unmount. Risk: transcript scroll ownership and virtualized row measurements during disclosure toggles.

Design: chat-transcript.md, updated in teamleaderleo/leo-workspace#1989.

Validation: scripts/web-lint.sh and pre-push checks passed. Fold/anchor fleet run passed 72 tests, including all 12 Chromium tests for bottom pinning, exactly one stack animation, stable scroll extent, cancellation, Reduce Motion and existing anchors. Gallery run passed both existing anchor tests. These ran at 32526efc4e430811baecd62b69a4502f2f2c0667; the final commit only registers the new non-popup animation in the existing guard, with runtime code unchanged. Final-head guard and desktop tests passed all 16 tests at 636ebf456313e27eabbcfbbfa65e538547da786a, including the WebKit selection case that failed in the earlier broad run. Total: 90 focused tests passed. Exact-head independent review: SHIP.

The existing non-popup animation guard now explicitly lists the transcript stack motion; menu opening behavior remains instantaneous.

Changelog

Tool calls expand upward smoothly when the chat is at the bottom.

Agent session: agent session
🤖 Generated with Claude Code