fix: retry key scroll after data update - #377
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
React Doctor found no issues. 🎉
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #377 +/- ##
==========================================
+ Coverage 96.88% 97.60% +0.71%
==========================================
Files 19 19
Lines 836 836
Branches 209 209
==========================================
+ Hits 810 816 +6
+ Misses 26 20 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
❌ Deploy failed
📋 Build log (last lines)🤖 Powered by surge-preview |
|||||||||
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Walkthrough当目标索引无效时,滚动同步会继续收集高度。测试覆盖布局阶段扩展数据后重试 key scroll,并验证最终位置。 Changes滚动同步重试
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |

Summary
Retry key-based scrolling while its target index is unresolved, allowing data added by a later layout update to be found.
Root cause
#376 retried key lookup only when a scroll measurement retry was already needed. If the target data appeared after the first layout pass,
needCollectHeightstayed false and no retry was scheduled.The previous regression test updated data in the same event batch as
scrollTo, so the first layout pass already saw the target and did not expose this gap.Changes
Test
masterwithscrollTop = 0ut test -- tests/scroll.test.js --runInBandut test -- --runInBandut run tsceslint src/hooks/useScrollTo.tsx tests/scroll.test.jsFollow-up to #376. Related to ant-design/ant-design#58841.
Summary by CodeRabbit