fix(agent-pane): clear stopped transcript scroll lead

Merged
TE
4d ago
+35-0

Fixes #16424

The current transcript keeps the fling direction in scrollRef.delta after scrolling stops, so the lead range continues mounting rows several viewports away on every later render. This clears the lead after a short idle interval and cancels the timer on unmount.

The other #16424 follow-ups are already covered on feat-cmux-next by #16426, #16452, #16454, #16463, and #16464.

Validation:

  • cmux-ci test -- bun test webviews/test/transcript-fling.test.ts

Next-issue: #16424

Agent session: agent session


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


Summary by cubic

Fixes #16424. The transcript kept the fling direction in scrollRef.delta after scrolling stopped, so mounted rows stayed several viewports ahead of the settled view on every later render. The lead now decays 120ms after the last scroll, and the idle timer is cancelled on unmount. Adds a test asserting the mounted row count shrinks once a stopped fling settles.