[Bug]: Timeline jumps far up right after sending in a long thread#13706

openedSep 25, 2026bySsantiago-ramos-02

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

In the app it is timing dependent. It shows up most in long threads with long replies, especially on desktop with a busy main thread:

  1. Open a thread with a lot of history and long assistant replies, scrolled to the bottom.
  2. Send a message.
  3. About half a second later the timeline jumps far up, often near the top of the loaded history, and stays there.

A small page that renders only a LegendList (no T3 Code components or data), served by the apps/web dev server, reproduces it every time:

  1. Render a LegendList with 150 rows of about 900px each, estimatedItemSize={90}, initialScrollAtEnd, and maintainVisibleContentPosition={{ data: true, size: true }} (the timeline's options).
  2. Scroll up a few screens.
  3. Call listRef.current.scrollToEnd({ animated: true }).
  4. While that scroll is running, remove the last row from data.

Expected behavior

The list ends at the end, with 149 rows.

Actual behavior

The list lands on rows 0 and 1, about 25,000px from the end. The same steps without step 4 end at the end. Removing the last row without a scroll in flight keeps the position.

The same page reproduces in a separate plain app with pristine npm @legendapp/list 3.3.5, when built with Rolldown-based Vite (apps/web builds with Rolldown through vite-plus). With esbuild-based Vite it does not jump. Under the same Rolldown setup, 3.4.0 does not jump either.

Impact

Major degradation or frequent failure

Version or commit

main @ ed809f7ad2 (@legendapp/list 3.3.5 with T3 Code's patch). @legendapp/list 3.4.0 does not reproduce. Its changelog lists "End-following and animated programmatic scrolling now stay aligned through footer, viewport, and native layout changes."

Environment

Windows 11, desktop nightly and web client from vp run dev. Provider independent. The same code is in the React Native build that mobile uses.

Logs or stack traces

No errors. Reading listRef.current.getState() every frame during a jump in a long thread:

Time after sendscrollcontentLengthRows in dataRendered rows
before12,41413,162144131 to 143
631 ms0334143131 to 142
1,047 ms12,15849,29114336 to 39

The element's scrollTop stayed about where it was the whole time; only LegendList's state reset. The row data never went empty. A totalSize listener caught the collapse. Its stack runs through checkResetContainers, calculateItemsInView, the MVCP check, getItemSize, setSize, and addTotalSize.

Screenshots, recordings, or supporting files

The standalone repro, unpatched:

https://github.com/user-attachments/assets/22c266c7-1763-42e4-ae23-851b2de6cc01

Workaround

Press End or use "Scroll to end".

Cause

scrollToEnd records the last index as state.scrollingTo. When data shrinks before that scroll completes, the MVCP check in prepareMVCP resolves the target with getId(state, scrollTarget). That index is now past the end of data, so it returns null. The check still sizes it:

js
1if (scrollingToViewPosition && scrollingToViewPosition > 0) {
2 const newSize = getItemSize(ctx, targetId, scrollTarget, state.props.data[scrollTarget]);

getItemSize passes the null key to setSize, and addTotalSize treats a null key as "set the total to this value". The total height collapses to one estimated row. That sends the list to scroll = 0 and it re-lays out unmeasured rows at the average measured row height. In a thread of long replies that average is several times the 90px estimate, so the old offset now lands near the top.

In T3 Code the shrink comes from the timeline's trailing rows. When a turn starts, the live activity row at the end is replaced, which briefly removes one row while the send's scrollToEnd is still in flight. A busy main thread widens that window. The desktop running-thread keep-alive and very large environments made it frequent here, but neither is required.

Skipping that size check when targetId is null fixes the repro. I'll open a PR that adds the guard to patches/@legendapp__list@3.3.5.patch.

Open PR #13707 already targets this with Fixes #13706 (guard in the @legendapp/list patch so prepareMVCP skips sizing when the in-flight scrollToEnd target was removed mid-scroll).

Synced from GitHub

Additional user report on macOS, installed T3 Code (Alpha) desktop 0.0.45 (verified from app Info.plist), observed October 5, 2026 CDT / October 6 UTC.

The user reports repeated jumps all the way to the beginning of long conversations across multiple sessions, requiring manual scrolling back to recent messages. Exact triggering action has not been isolated. The environment uses existing orchestration thread.turn.start messages for agent coordination and a 15-minute scheduled CoS turn; those may trigger row updates but causation is unconfirmed. The same symptom might also overlap #14051 (position restoration on thread switch/reopen).

We reduced the scheduled message from 5,433 to 296 characters and moved detailed coordination out of the human transcript. This is a noise mitigation only, not a verified scroll fix. The inspected sender scripts dispatch turns; they do not explicitly scroll or navigate the client. A bounded scan of current desktop/server traces found no scroll-specific diagnostic; no recording or controlled reproduction is available yet.

Expected: preserve the reader's anchor during background activity, and continue following the latest message only when already at the end. New activity should not reset a long thread to its first message.

Please confirm whether the fix associated with #13707 is intended to cover desktop 0.0.45 and whether additional diagnostics would distinguish this from #14051. No private conversation, credentials, or raw logs are attached.

Triaged as a bug on main b5a226e49c. No matching duplicate among 949 open issues; thread-switch stranding and downward live-follow reports have different triggers.

Linux Chromium, 1280×800, real web dev server with patched LegendList 3.3.5:

  • Full app: 75 seeded long replies, send from the bottom, real Claude Sonnet 5.5 response. Both a short reply and a long reply with 120ms main-thread work every 250ms for 8 seconds stayed at the end.
  • Reporter’s standalone list served by the same dev server: 150 × 900px rows, estimate 90, initialScrollAtEnd, MVCP data+size. Scroll to offset 5,000, animate to end, remove the final row after 150ms. One run reached scroll=0; a recorded repeat settled on rows 62–63, scroll=25,010 of 46,661 with 149 rows. Other timings reached the end. No-removal control reached row 149.

Standalone failing repeat (interaction near 4s): mcp-launch-client-3a549473ca-aaf0-4aec-93bf-0338c23302e1-fwd-3a6f9a5659b735e262c-24507d95-048a-481c-bbc0-a15308f72130-mp4.mp4

Full app short / long attempts: mcp-launch-client-3a549473ca-aaf0-4aec-93bf-0338c23302e1-fwd-3a6f9a5659b735e262c-6d7edab1-73a7-4f33-b456-dd578372afe5-mp4.mp4 mcp-launch-client-3a549473ca-aaf0-4aec-93bf-0338c23302e1-fwd-3a6f9a5659b735e262c-bb06f456-7f3f-44e0-a2ed-cb0155ed96ba-mp4.mp4

Windows desktop and native mobile were not verified.

Fix proposed in #23209, head e136fdfd55. The dependency fixture reproduces the 90px height collapse before the guard and retains 134100px with Row 148 visible afterward across four viewport/theme pairs. All 14 focused tests pass after merging current main.

Before/after recordings and captures. Natural product reproduction and the remaining matrix controls are incomplete; Electron, iOS and Android are unverified. Those gaps are listed in the PR for maintainer review.