fix(tables): suppress phantom rows on sort, center gutter numbers, stop select-all viewport jump#4445
Conversation
…op select-all viewport jump
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Stops rendering position gap placeholder rows when a sort is active (in addition to filters), avoiding phantom empty rows/out-of-order row numbering. Adjusts gutter/checkbox cell layout so row numbers are centered and the per-row run/stop button stays aligned (including for gap rows). Reviewed by Cursor Bugbot for commit c9c0c48. Configure here. |
Greptile Summary
Confidence Score: 5/5Safe to merge — all three fixes are narrowly scoped, use correct React patterns, and carry no functional regression risk. No P0 or P1 issues found. The ref-based scroll-suppression pattern is correct: the flag is set synchronously before batched state updates, and the useEffect checks and clears it before any scroll is attempted. The sort-gap-row guard is a straightforward truthy extension of the existing filter guard. Gutter layout changes are purely visual. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant HandleSelectAll
participant React State
participant useEffect (scroll)
User->>HandleSelectAll: click select-all / Ctrl+A
HandleSelectAll->>HandleSelectAll: suppressFocusScrollRef.current = true
HandleSelectAll->>React State: setSelectionAnchor({0,0})
HandleSelectAll->>React State: setSelectionFocus({maxRow,maxCol})
HandleSelectAll->>React State: setIsColumnSelection(false)
Note over React State: React 18 batches all updates → single re-render
React State-->>useEffect (scroll): fires with new selectionAnchor/Focus
useEffect (scroll)->>useEffect (scroll): suppressFocusScrollRef.current == true?
useEffect (scroll)->>useEffect (scroll): reset flag → false, return early
Note over useEffect (scroll): scroll-into-view is skipped (viewport stays put)
Reviews (2): Last reviewed commit: "fix(tables): suppress scroll on Ctrl+A s..." | Re-trigger Greptile |
Cmd/Ctrl+A duplicates the select-all logic but missed the suppressFocusScrollRef flag, so the keyboard path still triggered the viewport jump. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c9c0c48. Configure here.
Summary
Type of Change
Testing
Tested manually
Checklist