Repository navigation
Conversation
Assisted-by: Codex GPT-6
| ### With drag and drop reordering | ||
|
|
||
| When `enableDragDrop` is set to `true`, users can drag and drop columns to reorder them. The order changes are reflected both in the modal and in the table when applied. This is useful when column order matters for the user experience. | ||
| When `enableDragDrop` is set to `true`, users can drag and drop columns to reorder them. The order changes are reflected both in the modal and in the table when applied. Select a column's **Sticky** checkbox to keep it at its current position; other columns cannot be moved into that position. The `isSticky` column property reflects this selection. In this example, the first `ID` column is sticky. |
There was a problem hiding this comment.
This states users can "Select a column's Sticky checkbox" — but no such checkbox is rendered anywhere. ListManager only renders the show/hide checkbox for each row.
As written, the docs page will describe an interaction that can't be performed. Either the checkbox needs to be implemented, or this text should be updated to describe the prop-based behavior that actually exists (a consumer setting isSticky in the columns config).
There was a problem hiding this comment.
Good catch — there is no Sticky checkbox, so I rewrote this to describe the prop-based behavior that actually ships:
Set a column's
isStickyproperty totrueto pin it to its current position. A sticky column stays where it is and no other column can be moved into that position, while the remaining columns reorder around it. In this example, theIDcolumn is sticky.
Fixed in 41f7cb6.
-- Claude Opus 5
| /** Callback when a column is selected or deselected */ | ||
| onSelect?: (column: ListManagerItem) => void; | ||
| /** Callback when a column's sticky state changes */ | ||
| onStickyChange?: (column: ListManagerItem) => void; |
There was a problem hiding this comment.
onStickyChange is declared here and passed by ColumnManagementModal (with a handleStickyChange handler), but ListManager never destructures it and has no code path that calls it — there's no UI that toggles isSticky.
As it stands this is dead code on both sides. Could it either be wired up to an actual control, or removed until that UI exists?
There was a problem hiding this comment.
Agreed, it was dead on both sides. Removed onStickyChange from ListManagerProps along with handleStickyChange and the prop pass in ColumnManagementModal.
While in there I also reverted the isSticky: matchingItem.isSticky ?? column.isSticky lines in updateColumns and handleOrderChange — the ...column / ...originalColumn spread already carries isSticky through, so those were no-ops too. The prop stays on ColumnManagementModalColumn and ListManagerItem, and handleSave still maps it explicitly since that one builds fresh objects.
Fixed in 41f7cb6.
-- Claude Opus 5
| return found; | ||
| }); | ||
|
|
||
| // Sticky columns reserve their current positions. Reorder only the remaining columns. |
There was a problem hiding this comment.
The sticky-position algorithm here (filter non-sticky columns, then re-slot them around the reserved positions) is non-trivial and currently has no test coverage — including edge cases like a sticky column in the middle of the list, all columns sticky, or a no-op drag.
Since this is the one piece of the feature that does ship, could tests be added for it?
There was a problem hiding this comment.
Added a reordering describe block to ListManager.test.tsx covering the cases you named plus a couple more:
- no column sticky (plain reorder)
- leading sticky column
- sticky column in the middle of the list
- every column sticky
- a drag that ends where it started
- selection state surviving a reorder
Each case asserts both the onOrderChange payload and the rendered DOM order. The DragDropSort mock now records its props so a test can drop items in a specific order instead of only reversing them.
Added in 41f7cb6.
-- Claude Opus 5
Drop the onStickyChange callback from ListManagerProps and the handleStickyChange handler in ColumnManagementModal. There is no control that toggles isSticky, so nothing ever invoked the callback. Sticky state comes from the columns config the consumer passes in, and the spread of the existing column already carries it through updateColumns and handleOrderChange, so the explicit isSticky reassignments there were no-ops too. The docs described selecting a "Sticky" checkbox, which does not exist. Describe the prop-based behavior that actually ships instead. Cover the sticky reorder algorithm in ListManager tests: leading sticky column, sticky column in the middle, every column sticky, a drag that ends where it started, and selection state surviving a reorder. The DragDropSort mock now records its props so a test can drop items in a specific order rather than only reversing them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
closes #991
Assisted-by: Codex GPT-6 Luna
Screen.Recording.2026-10-07.at.10.36.11.AM.mp4
I tried to have the drag handle for the sticky column disabled as well, but Codex says that's not possible with the current react-drag-drop and instead it ended up reimplementing the entire package...