fix(dockview-core): add drop target for tab group chip#1292
Merged
Conversation
When a tab group is the first item in the tabs container, the chip sits before the group's first tab in the DOM and covers the position-0 drop slot. The chip had no Droptarget, and the tabs container's dragover handler bails for individual tab drags in default animation mode, so hovering over the chip was a dead zone — no overlay rendered and drop fired nothing. Attach a Droptarget to the chip element (left zone only, horizontal / top zone only, vertical) that resolves to "insert before this group" on drop. Suppress the overlay in smooth animation mode where the existing gap-shift animation already covers this case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
When a tab group is the first item in a tabs container, the chip sits before the group's first tab in the DOM and covers the position-0 drop slot. The chip had no
Droptargetand the tabs container'sdragoverhandler bails for individual tab drags in default animation mode (tabs.ts:318-324), so hovering over the chip was a dead zone — no overlay, no drop.Droptargettochip.elementinTabGroupManager._ensureChipForGroup, accepting only the leading zone (lefthorizontal /topvertical) at 100% activation, so the whole chip = "before this group".canDisplayOverlaymirrorsTab's pattern: respectslocked/disableDnd, suppresses the overlay insmoothmode (the gap-shift animation already covers that case), delegates togroup.model.canDisplayOverlayfor cross-accessor drags.onChipDropcallback wired fromTabGroupManager→Tabs._handleChipDrop, which resolves the insertion index to the group's first tab and applies the standard same-group source-removal adjustment.updateDirection()onTabGroupManagerrefreshes target zones when the header direction changes.Test plan
yarn jest --selectProjects dockview-core(920 passed, +2 new regression tests)🤖 Generated with Claude Code