Skip to content

fix(dockview-core): add drop target for tab group chip#1292

Merged
mathuo merged 2 commits into
masterfrom
fix/tab-group-chip-drop-target
May 19, 2026
Merged

fix(dockview-core): add drop target for tab group chip#1292
mathuo merged 2 commits into
masterfrom
fix/tab-group-chip-drop-target

Conversation

@mathuo
Copy link
Copy Markdown
Owner

@mathuo mathuo commented May 19, 2026

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 Droptarget and the tabs container's dragover handler 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.

  • Attach a Droptarget to chip.element in TabGroupManager._ensureChipForGroup, accepting only the leading zone (left horizontal / top vertical) at 100% activation, so the whole chip = "before this group".
  • canDisplayOverlay mirrors Tab's pattern: respects locked/disableDnd, suppresses the overlay in smooth mode (the gap-shift animation already covers that case), delegates to group.model.canDisplayOverlay for cross-accessor drags.
  • New onChipDrop callback wired from TabGroupManagerTabs._handleChipDrop, which resolves the insertion index to the group's first tab and applies the standard same-group source-removal adjustment.
  • updateDirection() on TabGroupManager refreshes target zones when the header direction changes.

Test plan

  • yarn jest --selectProjects dockview-core (920 passed, +2 new regression tests)
  • Manual: default animation mode — drag a tab over the chip of the first-positioned group → overlay appears on chip's leading edge, drop inserts the tab before the group.
  • Manual: smooth animation mode — drag a tab over the chip → existing gap-shift animation still works (chip's Droptarget overlay is suppressed).
  • Manual: vertical header direction — same as above with the top zone.
  • Manual: locked group — chip does not accept drops.

🤖 Generated with Claude Code

mathuo and others added 2 commits May 19, 2026 20:50
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>
@sonarqubecloud
Copy link
Copy Markdown

@mathuo mathuo merged commit ad1c2c8 into master May 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant