feat(tables): virtualize data grid with bounded copy and chunked delete#4693
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Hardens large bulk actions. Select-all delete now drains all filtered pages before prompting, and Reviewed by Cursor Bugbot for commit 4620a07. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR introduces three related improvements to the user-tables grid: windowed rendering via
Confidence Score: 4/5Safe to merge; the core virtualization, clipboard, and chunked-delete logic is sound with one minor structural defect in virtual spacer rows that does not affect functionality. The clipboard and delete changes address real correctness problems and are well-implemented. The virtual spacer rows use colSpan={displayColumns.length + 1} but TableColGroup renders a third column group for the Add Column button, so each spacer row is one column short. With border-spacing-0 table-fixed the visual impact is nil, but the table structure is technically malformed. There are no data-loss risks or security concerns in the changed paths. The two spacer rows in table-grid.tsx (paddingTop / paddingBottom) have the off-by-one colSpan; everything else is straightforward. Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User (Ctrl+C/X)
participant H as handleCopy/handleCut
participant W as writeSelectionToClipboard
participant CB as navigator.clipboard.write()
participant LR as ensureRowsLoadedUpTo
participant AC as afterCopy (clearCutRows)
participant T as Toast
U->>H: copy/cut gesture (transient activation)
H->>W: call writeSelectionToClipboard(opts)
W->>T: show Copying N rows toast
W->>CB: write new ClipboardItem with async blob
Note over CB: gesture activation preserved - write is synchronous
CB-->>LR: ClipboardItem resolves blob async
LR->>LR: page through rows up to MAX_COPY_ROWS+1
LR-->>CB: blob resolved TSV text
CB-->>W: writePromise resolves
alt write failed
W->>T: Failed to copy please try again
else write succeeded cut
W->>AC: afterCopy copiedRows
AC->>AC: chunkBatchUpdates clear cells
alt clear succeeded
W->>T: Cut N rows or Cut first 50k rows
else clear failed
W->>T: Copied but clearing cells failed
end
else write succeeded copy
W->>T: Copied N rows or Copied first 50k rows
end
Reviews (2): Last reviewed commit: "fix(tables): keep copy/cut progress toas..." | Re-trigger Greptile |
…, clipboard error handling Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@greptile review |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e9434cb. Configure here.
… error Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Summary
@tanstack/react-virtualspacer-row approach over the native table) so 4k+ row tables scroll smoothly — DOM goes from one<tr>per loaded row to visible + overscan. Pages kept unbounded so bulk ops keep working; memory drops.ClipboardItem(fixes clipboard gesture-expiry); capped at 50k rows with a "use Export CSV" steer beyond that. Cut clears only the copied rows.Type of Change
Testing
Tested manually.
tsc --noEmitclean,vitest hooks/queries lib/table(202 passing),bun run lint(16/16), andcheck:api-validation:strictall pass.Checklist