Repository navigation
fix(web): timeline no longer jumps up when a row is removed mid scroll - #13707
santiago-ramos-02 wants to merge 1 commit into
Conversation
LegendList records the last index as its scroll target when scrollToEnd runs. If data shrinks before that scroll completes, the visible-position check sizes a target whose key is now null, and a null key resets the list's total size. The list then relays out from scroll 0 with average row sizes, which in a long thread lands near the top. The timeline hits this when a turn starts and its trailing live row is replaced while the send's scrollToEnd is still running. Skip that size check when the target row no longer exists. The guard is added to every build in T3 Code's existing @legendapp/list patch. Fixes pingdotgg#13706 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The change is a contained fix to existing LegendList scroll handling, preventing a removed in-flight target from collapsing the list’s measured height. All module variants receive the same guard, and the lockfile change only records the updated patch hash. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe LegendList patch updates MVCP checks, DOM ordering, and anchored end-space handling. The PR summary also describes keyboard inset adjustments, inset-aware scroll positioning, and content-size animation handling. ChangesLegendList behavior
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The patch updates LegendList behavior, and the reviewed changes establish no actionable regression; it appears ready for normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Out of Scope Changes checkExplanation The raw change summary reports changes unrelated to issue
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Update after more testing: this is a bug in the published |
Dismissing prior approval to re-evaluate 98056ad
Fixes #13706
What Changed
One guard in T3 Code's existing
@legendapp/listpatch, added to every build (web, React Native, React Native Web, CommonJS and ESM).prepareMVCPnow skips sizing the in-flight scroll target when that target's row no longer exists:pnpm-lock.yamlonly changes the patch hash.Why
scrollToEndrecords the last index asscrollingTo. Ifdatashrinks before that scroll completes,getId(state, scrollTarget)returnsnullbecause the index is past the end. The check then callsgetItemSizewith thatnullkey, andsetSizepasses it toaddTotalSize, which treats anullkey as "set the total to this size". The list's total height collapses to one estimated row. It then relays out fromscroll = 0and estimates unmeasured rows at the average measured size. In a long thread that lands near the top.The timeline hits this when a turn starts. The trailing live activity row is replaced, briefly removing a row, while the send's
scrollToEndis still running. Details and measurements are in #13706.Skipping the size check is safe here. It only adjusts for a target row that changed size, and a removed row has no size to compare. The scroll still finishes at the new end.
UI Changes
A page that renders only a
LegendListwith the timeline's options (150 tall rows,estimatedItemSize={90}), served by theapps/webdev server so it uses T3 Code's patched 3.3.5 and build. It scrolls up, callsscrollToEnd({ animated: true }), and removes the last row 60ms later.Before, the list lands on rows 0 and 1, about 25,000px from the end:
legendlist-before-fix.mp4
After, it ends at the end:
legendlist-after-fix.mp4
Checklist
Tested with the page above, before and after, removing the row at 60ms and 150ms. Also ran two controls: scrolling without removing ends at the end, and removing without a scroll in flight keeps the position.
pnpm install --frozen-lockfileapplies the patch cleanly. A plain app built with Rolldown-based Vite and pristine npm 3.3.5 reproduces it too; 3.4.0 does not. Moving to@legendapp/list3.4.x would also fix this, but that means porting the existing patch, so this guard is the smaller fix until then.Model: Claude Opus 5.5 (1M context), running in Claude Code inside T3 Code.
🤖 Generated with Claude Code