refactor: Replace SortableJS 3/4: drop SortableJS from SlickDraggableGrouping (native drag & drop) - #1243
Open
6pac-ai wants to merge 1 commit into
Open
Conversation
…drop) Part 3 of the SortableJS removal (port of ghiscoding/slickgrid-universal#2634). The SlickDraggableGrouping plugin now runs entirely on the native drag engines; nothing in src/ uses SortableJS anymore (the dependency itself is removed in the next and final part). - add `setupDropzonePillDrag()` to slick.interactions.ts: native pill reordering inside the grouping dropzone, column-header drop acceptance via the dataTransfer column id, with Firefox/Linux mouse and touch fallbacks - rewire slick.draggablegrouping.ts: `getSetupColumnReorder()` uses `setupColumnReorderDrag` (container/viewport resolved through public grid getters), the dropzone uses `setupDropzonePillDrag`, and the hand-rolled dragover/dragenter/dragleave dropzone listeners fold into engine callbacks - grouping pills are created with `draggable=true` (required for the native HTML5 pill drag) - a header drop is handled by both the dropzone's native `drop` and the reorder engine's fallback `onDrop` path, deduplicated by handleGroupByDrop's existing columnAllowed guard - BREAKING: `getSetupColumnReorder()` now returns `{ columnReorderDragInstance }` (a `{ destroy() }` instance) instead of `{ sortableLeftInstance, sortableRightInstance }` - behavior deltas: no spurious onColumnsReordered after a grouping drop; grouping pages now respect `unorderableColumnCssClass` (the old filter was commented out); pill drags only reapply grouping when the order changed Full Cypress suite: 600/601 passing (1 intentional pending), lint and TS declaration build clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Part 3 of the SortableJS removal (port of slickgrid-universal's refactor(core)!: drop SortableJS dependency #2634). Stacked on #1242 (which is stacked on #1240). After this PR nothing in
src/uses SortableJS anymore; the dependency itself and the example<script>tags are removed in the final part.The header→dropzone characterization spec from #1240 (
example-draggable-grouping-header-drop.cy.ts) plus both existing draggable-grouping specs pass unchanged against this port — that was the acceptance gate.What's in here
src/slick.interactions.ts— newsetupDropzonePillDrag()(ported from Slickgrid-Universal): native HTML5 reordering of group pills inside the dropzone, acceptance of column-header drops via thedataTransfercolumn id, and the same Firefox/Linux mouse + touch fallbacks as the column reorder engine. Registered on theSlicknamespace for iife/browser builds.src/plugins/slick.draggablegrouping.ts— fully off SortableJS:getSetupColumnReorder()wiressetupColumnReorderDrag(grid container/viewport resolved through public grid getters), with the dropzone show/hide UI choreography moved into the engine'sonDragStart/onDragEnd/onDropcallbacks;setupDropzonePillDrag; the hand-rolledaddDragOverDropzoneListeners()is gone (engine callbacks cover it);draggable = true(required for the native HTML5 pill drag);drophandler and the reorder engine's fallbackonDroppath, deduplicated byhandleGroupByDrop's existingcolumnAllowedguard (the fallback path is the only one that fires on Firefox/Linux and touch).Breaking change
getSetupColumnReorder()now returns{ columnReorderDragInstance }(a{ destroy() }instance) instead of{ sortableLeftInstance, sortableRightInstance }. The grid itself never consumed this return value; only external callers holding the SortableJS instances are affected.Behavior deltas (all deliberate, noted in-code)
onColumnsReorderedafter a grouping drop (the old SortableJSonEndfired it with an unchanged order after every cross-list drop).unorderableColumnCssClassfor header reordering (the old plugin's filter was commented out, so non-reorderable columns could be dragged there).Verification
dist/browser/plugins/slick.draggablegrouping.jsgreps clean of SortableJS after a rebuild.Next (final) part: remove the sortablejs dependency and sweep the example pages.
🤖 Generated with Claude Code