Skip to content

fix(tables): auto-scroll during column drag - #6722

Merged
TheodoreSpeaks merged 4 commits into
stagingfrom
fix/table-column-drag
Aug 15, 2026
Merged

fix(tables): auto-scroll during column drag#6722
TheodoreSpeaks merged 4 commits into
stagingfrom
fix/table-column-drag

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • auto-scroll horizontally while dragging table columns near viewport edges
  • account for pinned columns and stop scrolling when the drag ends

Type of Change

  • Bug fix

Testing

  • 21 focused tests
  • app type-check
  • root lint, block registry, and 26 repository audits

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 15, 2026 2:52am

Request Review

@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes column reorder interaction and drop-target logic in a large grid component; layout/metadata persistence paths are unchanged but DOM edge cases could misplace drops.

Overview
Adds horizontal auto-scroll while reordering table columns: when the pointer sits in a 48px edge zone of the scrollable area (after pinned columns), the grid scrolls at up to 14px/frame and keeps updating the drop indicator.

Drop targeting no longer walks column widths from scroll coordinates. Headers now expose data-column-drag-target and data-column-drag-group; drop position is resolved with elementFromPoint, nearest-header fallback at edges, and workflow groups treated as one target spanning sibling headers.

Column drag uses stable column keys (including workflow group meta cells via columnKey). Auto-scroll is skipped for pinned drags; cross-zone pinned/unpinned drops still clear the indicator.

Reviewed by Cursor Bugbot for commit 3c831be. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds horizontal auto-scrolling while table columns are dragged near viewport edges and keeps drag targets aligned with the visible headers.

  • Computes edge-scroll velocity with safe handling for pinned or narrow viewports.
  • Re-hit-tests visible headers after scrolling and uses stable column keys for grouped columns.
  • Stops animation-frame scrolling when the drag ends or the component unmounts.
  • Adds focused tests for edge velocity, zero-width viewports, and overlapping hot zones.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx Implements drag auto-scroll, viewport-based target resolution, grouped-header handling, and drag lifecycle cleanup; the previously reported failures are addressed at current HEAD.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/utils.ts Adds a bounded edge-scroll velocity helper that safely handles zero-width and narrow scrollable viewports.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/utils.test.ts Covers left and right edge scrolling, central dead zones, fully pinned viewports, and narrow overlapping edge zones.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/column-header-menu.tsx Adds stable drag-target and workflow-group metadata to rendered column headers.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/workflow-group-meta-cell.tsx Uses stable column keys for workflow-group dragging and exposes group metadata for viewport hit-testing.

Reviews (4): Last reviewed commit: "fix(tables): align workflow group drop i..." | Re-trigger Greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 3c831be. Configure here.

@TheodoreSpeaks
TheodoreSpeaks merged commit cfb99e1 into staging Aug 15, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant