Skip to content

fix(dockview-core): allow chip drop just-before adjacent group (#1264)#1278

Merged
mathuo merged 1 commit into
masterfrom
fix/1264-chip-drag-just-before-group
May 13, 2026
Merged

fix(dockview-core): allow chip drop just-before adjacent group (#1264)#1278
mathuo merged 1 commit into
masterfrom
fix/1264-chip-drag-just-before-group

Conversation

@mathuo
Copy link
Copy Markdown
Owner

@mathuo mathuo commented May 13, 2026

Summary

  • Fixes Tab group can’t be placed to the left of a tab when another tab group is already on its right #1264 — dragging a tab group chip onto the LEFT of a tab placed it between the tab and the adjacent chip when another tab group already sat on the tab's right.
  • The dragover snap (if (isGroupDrag) { ... }) ran on both isInsideRange and isJustBeforeGroup. For isJustBeforeGroup (insertion at firstIdx - 1, just left of an existing chip group), it incorrectly snapped the index forward to firstIdx, dropping the chip between T and the adjacent chip.
  • Restrict the snap to isInsideRange; for isGroupDrag && isJustBeforeGroup, accept the index as-is and break — the index is already a valid drop position outside the group.

Test plan

  • New regression test in tabsAnimation.spec.ts covering the bug scenario (3 destination tabs, chip over tabs 1-2, external chip drag with cursor on tab 0's far left → currentInsertionIndex === 0)
  • Test fails on the original code (Expected: 0, Received: 1) and passes with the fix
  • Existing dragging a group chip never targets another group test (the isInsideRange path) still passes
  • Full dockview-core suite: 905/905 passing
  • Manual repro at dockview.dev/demo once deployed

🤖 Generated with Claude Code

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>
@sonarqubecloud
Copy link
Copy Markdown

@mathuo mathuo merged commit c239739 into master May 13, 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.

Tab group can’t be placed to the left of a tab when another tab group is already on its right

1 participant