Repository navigation
Conversation
✅ Deploy Preview for react-arborist ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This was referenced Oct 20, 2026
ccombe
force-pushed
the
drag-overlay-modernization
branch
from
October 21, 2026 09:26
220edab to
b77a3a1
Compare
Each Tree now always owns its DndContext. Removes the parent-context detection that relied on dnd-kit's internal noop stubs, the treeCollisionDetection export, and the dndBackend/dndManager/ dndRootElement props. Deletes the drag-out showcase and its spec, which depended on sharing one context with the app. Tracks the real pointer during a drag instead of deriving it from activator coordinates plus event.delta, which dnd-kit folds scroll adjustments into. Defaults to a pointer sensor only: KeyboardSensor started a drag on Space or Enter, swallowing the tree's own commands. The drag listeners now receive the target and event methods the activators touch. Adds tests for a scroll mid-drag, a source row unmounting during a drag, and Space/Enter on a nested button.
ccombe
force-pushed
the
drag-overlay-modernization
branch
from
October 28, 2026 11:00
b77a3a1 to
6357a27
Compare
Contributor
Author
|
Folding this into #391 rather than keeping it as a stacked draft. Reason: with the base pinned to What came with it, beyond a straight merge:
Branch |
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.
Part 2 of the @dnd-kit migration stack (#390).
Summary
Replaces the custom fixed-viewport drag preview with
@dnd-kit/core's<DragOverlay>.Changes
components/drag-preview-container.tsx: renders the preview inside<DragOverlay dropAnimation={null}>, taking the dragged id fromuseDndContext().components/default-drag-preview.tsx: drops the manualtranslate(x, y)styles and the fixed viewport layer; the overlay positions itself.components/provider.tsx: removesdragPreviewState,INITIAL_DRAG_PREVIEW_STATE,DragPreviewContextwiring and the preview offset math. Keeps the pointer tracking from Migrate drag and drop from react-dnd to @dnd-kit #391, which still feedscomputeDropthroughupdateHover.context.ts: removesDragPreviewContextanduseDragPreviewState.dnd/dnd-provider.test.tsx: awaitsactso the overlay's lifecycle updates flush; drops the test that asserted the tree-computed preview offset.Test note
#391 adds a scroll mid-drag test that asserts the preview's
translatetransform, because the tree computed that offset itself. WithDragOverlay, dnd-kit positions the preview and deliberately folds scroll into its transform, so that assertion no longer describes this branch's behavior and the test is removed here. The pointer fix it guards (feeding the real pointer, notactivator + delta, tocomputeDrop) is unchanged and still exercised by the hover and drop tests; if you want the scroll case covered after this lands, the assertion has to target the computed drop rather than the preview's transform.Verification
yarn workspace react-arborist test: 12 suites, 137 tests passing, warning-free.yarn workspace showcase build+xvfb-run yarn workspace e2e test: 3 specs, 17 tests passing.yarn lint,yarn fmt:check: clean.