fix: avoid stale scroll retry sync#1495
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthrough修改了 ChangesforceScroll 滚动同步修复
Estimated code review effort: 1 (Trivial) | ~5 minutes Sequence Diagram(s)sequenceDiagram
participant TableBody as 表体滚动
participant forceScroll as forceScroll
participant Timer as setTimeout回调
participant TableHeader as 表头scrollLeft
TableBody->>forceScroll: 触发滚动事件
forceScroll->>Timer: 设置延迟同步
Timer->>Timer: 比较target.scrollLeft与期望值
alt 值不一致
Timer->>TableHeader: 写入scrollLeft
else 值一致
Timer-->>TableHeader: 跳过写入
end
Suggested reviewers: Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) 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 |
|
React Doctor found 15 issues in 2 files · 15 warnings · score 74 / 100 (Needs work) · vs 15 warnings
Reviewed by React Doctor for commit |
❌ Deploy failed
📋 Build log (last lines)🤖 Powered by surge-preview |
|||||||||
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to track the active scroll source (header, body, summary, or sticky scrollbar) using hover states (onMouseEnter) to improve scroll synchronization across different table sections. It also includes corresponding unit tests. The review feedback highlights two critical issues: first, a potential bug in getScrollSource where undefined or null values could incorrectly match and resolve the scroll source; second, the lack of a reset mechanism for hoverEle when the mouse leaves the table, which could break scroll synchronization during keyboard navigation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1495 +/- ##
=======================================
Coverage 99.04% 99.04%
=======================================
Files 45 45
Lines 1362 1362
Branches 409 409
=======================================
Hits 1349 1349
Misses 13 13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to track the active scroll source (using hoverEle and mouse enter/leave events) to prevent scroll synchronization conflicts between the table body, header, summary, and sticky scrollbar. The reviewer identified two critical issues with this implementation: first, dragging the scrollbar can cause the mouse to drift over the table body, triggering onMouseEnter and freezing the scrollbar, which can be fixed by checking that no mouse buttons are pressed (e.buttons === 0) before updating the hovered element; second, only 'body' scroll events should be ignored when the body is not the hovered element, as other sources are directly user-triggered and should always be processed.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
317647b to
2824b16
Compare
2824b16 to
98cdb2d
Compare

Fixes ant-design/ant-design#57850
Summary
Test Plan
Summary by CodeRabbit