test(dnd): verify pointer mode clears the anchor overlay on drag-leave - #1535
Merged
Merged
Conversation
…g-leave Verification follow-up to the session's floating-group drop-target fixes. The stale-overlay fix (clearing the shell containers on HTML5 `dragend`) was HTML5-specific because the HTML5 backend does not clear the anchor container on drag-leave. The pointer backend does clear on leave (and the drag controller fires that leave on every target transition and at drag end), so the same stale overlay cannot occur in pointer mode. Add a PointerDropTarget test asserting `_onDragLeave` clears the override target and drops the latched state, documenting and guarding that difference. The other two fixes need no pointer-specific coverage: the floating-group drop-overlay routing lives in the backend-agnostic `DockviewGroupPanelModel.dropTargetContainer` getter (both backends read it via `getOverrideTarget`, and the pointer anchor-render path is already covered), and the always-render split z-index fix (`correctLayerPosition`) involves no DnD backend at all. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PjU3r4fnmpLUz7Bx1SjNvP
|
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.



Description
Verification follow-up to this series of floating-group drop-target fixes (#1531, #1533, #1534), confirming they hold under
dndStrategy: 'pointer'as well as HTML5. No code fixes were required — pointer mode was already correct; this PR adds one guarding test.Analysis per fix:
DockviewGroupPanelModel.dropTargetContainergetter, which both backends read viagetOverrideTarget; the pointer anchor-render path is already covered.correctLayerPositioninvolves no DnD backend (split is driven bymoveGroupOrPanel), so behavior is identical._onDragLeave→overrideTarget.clear()), and the drag controller fires that leave on every target transition and at drag end/cancel — so the cross-container stale overlay cannot occur. The #1534 shelldragendlistener only responds to HTML5dragend, which pointer drags never emit, so it is inert (and harmless) for pointer.The one genuine coverage gap was that no test pinned down the pointer backend's drag-leave clearing — the exact reason it is immune to the #1534 stale overlay. This PR adds that test.
Type of change
Affected packages
dockview-coreHow to test
yarn test— the newPointerDropTargettest (drag-leave clears the anchor overlay (pointer mode leaves no stale overlay behind)) asserts that_onDragLeaveclears the override target and drops the latched drop position.Checklist
yarn testpasses (1680 dockview-core tests)biome formatclean🤖 Generated with Claude Code
https://claude.ai/code/session_01PjU3r4fnmpLUz7Bx1SjNvP
Generated by Claude Code