Commit 6598927
feat(tables): pinned columns (#4770)
* feat(tables): freeze columns
* fix(tables): sticky meta-header row for frozen workflow groups, remove dead handleChangeType
* fix(tables): scope frozenOffsets dep to frozen column widths only
* fix(tables): restore frozenColumns on delete-column undo/redo
* fix(tables): restore useMemo for isAllRowsSelected (O(n) computation)
* fix(tables): use current frozenColumns on delete-column redo, not stale snapshot
* fix(tables): clean up frozenColumns on create-column undo
* fix(tables): merge frozen state on delete-column undo instead of overwriting
* fix(tables): add previousFrozenColumns to test fixture for delete-column action
* fix(tables): skip frozen state update on delete-column redo when column was not frozen
* refactor(tables): rename frozen columns to pinned, fix sticky-zone UX
- rename frozenColumns → pinnedColumns across types, contract, undo
actions, grid state/refs/props, and dropdown labels
- add Pin / PinOff emcn icons; use them in the column menu in place of
Lock / Unlock
- pinned body cells render at z-[6], above the cell selection border
(z-[5]), so the blue selection border can't draw on top of the
sticky-left zone
- restrict column drag-reorder to within the pinned or unpinned zone in
both handleColumnDragOver and handleScrollDragOver; cross-zone drop
indicators are suppressed
- on unpin, slide the column to the first unpinned slot so the sticky
zone stays contiguous; consolidates pin and unpin into one branch
that always re-enforces pinned-at-front
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(tables): biome formatting + tighten pinned-zone comments
- collapse two onPinToggle JSX props that biome wanted on a single line
- drop a WHAT comment in handleScrollDragOver; tighten the why-comments
in handlePinToggle, handleColumnDragOver, and handleColumnDragEnd so
they describe the invariant being protected instead of narrating the
recent change
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(tables): re-sort reorder-columns undo to keep pinned-at-front
If the user reordered, then pinned a column, then undid the reorder, the
restored snapshot could leave a currently-pinned column in the middle of
columnOrder. pinnedOffsets walks displayColumns left→right and assigns
sticky `left` from checkboxColWidth — a pinned column in the middle gets
a sticky offset as if it were at the front, causing it to jump over its
left neighbors on horizontal scroll.
Re-sort the restored order with pinned entries pulled to the front before
applying. Mirrors the belt-and-suspenders re-sort in handleColumnDragEnd.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Theodore Li <theo@sim.ai>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 066cd70 commit 6598927
12 files changed
Lines changed: 568 additions & 226 deletions
File tree
- apps/sim
- app/workspace/[workspaceId]/tables/[tableId]/components/table-grid
- headers
- components/emcn/icons
- hooks
- lib
- api/contracts
- table
- stores/table
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
113 | 117 | | |
114 | 118 | | |
115 | 119 | | |
116 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
| |||
157 | 163 | | |
158 | 164 | | |
159 | 165 | | |
| 166 | + | |
| 167 | + | |
160 | 168 | | |
161 | 169 | | |
162 | 170 | | |
| |||
264 | 272 | | |
265 | 273 | | |
266 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
267 | 279 | | |
268 | 280 | | |
269 | 281 | | |
270 | 282 | | |
271 | 283 | | |
272 | 284 | | |
273 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
274 | 292 | | |
275 | 293 | | |
276 | 294 | | |
| |||
Lines changed: 22 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| |||
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
79 | 90 | | |
80 | 91 | | |
81 | 92 | | |
| |||
228 | 239 | | |
229 | 240 | | |
230 | 241 | | |
231 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
232 | 248 | | |
233 | 249 | | |
234 | 250 | | |
| |||
316 | 332 | | |
317 | 333 | | |
318 | 334 | | |
| 335 | + | |
| 336 | + | |
319 | 337 | | |
320 | 338 | | |
321 | 339 | | |
| |||
0 commit comments