fix(dockview-core): allow chip drop just-before adjacent group (#1264)#1278
Merged
Conversation
The chip-drag dragover snap moved an insertion index sitting one slot before an existing tab group forward into that group's first slot. A drop on the left of a standalone tab placed the dropped chip between the tab and the adjacent chip instead of before the tab. Restrict the snap to insertions that actually land inside a group's range; keep `isJustBeforeGroup` indices untouched since they are already a valid drop position outside the group. Co-Authored-By: Claude Opus 4.7 (1M context) <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.



Summary
if (isGroupDrag) { ... }) ran on bothisInsideRangeandisJustBeforeGroup. ForisJustBeforeGroup(insertion atfirstIdx - 1, just left of an existing chip group), it incorrectly snapped the index forward tofirstIdx, dropping the chip between T and the adjacent chip.isInsideRange; forisGroupDrag && isJustBeforeGroup, accept the index as-is and break — the index is already a valid drop position outside the group.Test plan
tabsAnimation.spec.tscovering the bug scenario (3 destination tabs, chip over tabs 1-2, external chip drag with cursor on tab 0's far left →currentInsertionIndex === 0)Expected: 0, Received: 1) and passes with the fixdragging a group chip never targets another grouptest (theisInsideRangepath) still passesdockview.dev/demoonce deployed🤖 Generated with Claude Code