Skip to content

Commit 6086ca8

Browse files
waleedlatif1claude
authored andcommitted
feat(table): column drag-and-drop reorder (#3738)
* feat(table): column drag-and-drop reorder * fix(table): remove duplicate onDragEnd call from handleDrop * fix(table): persist columnOrder on rename/delete and defer delete to onSuccess * fix(table): prevent stale refs during column drag operations Fix two bugs in column drag-and-drop: 1. Stale columnWidths ref during rename - compute updated widths inline before passing to updateMetadata 2. Escape-cancelled drag still reorders - update dropTargetColumnNameRef directly in handleColumnDragLeave to prevent handleColumnDragEnd from reading stale ref value Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(table): insert column at correct side when anchor is unordered When the anchor column isn't in columnOrder, add it first then insert the new column relative to it, so 'right' insertions appear after the anchor as expected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cac3bfa commit 6086ca8

File tree

3 files changed

+241
-33
lines changed
  • apps/sim

3 files changed

+241
-33
lines changed

apps/sim/app/api/table/[tableId]/metadata/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const MetadataSchema = z.object({
1313
workspaceId: z.string().min(1, 'Workspace ID is required'),
1414
metadata: z.object({
1515
columnWidths: z.record(z.number().positive()).optional(),
16+
columnOrder: z.array(z.string()).optional(),
1617
}),
1718
})
1819

0 commit comments

Comments
 (0)