Skip to content

fix: Allow external Dockview drags to use root edge drop targets#1153

Open
jrmal99 wants to merge 1 commit intomathuo:masterfrom
jrmal99:external-root-edge-dnd
Open

fix: Allow external Dockview drags to use root edge drop targets#1153
jrmal99 wants to merge 1 commit intomathuo:masterfrom
jrmal99:external-root-edge-dnd

Conversation

@jrmal99
Copy link
Copy Markdown

@jrmal99 jrmal99 commented Apr 4, 2026

Summary

Root edge drop targets currently reject panel drags from another Dockview instance. I'm using multiple Dockview instances and noticed an inconsistency when writing support in my app to transfer tabs between instances.

Dockview already supports external drag handling for group/header/content targets through onUnhandledDragOverEvent and onDidDrop, but the root edge path returns early when panel drag data exists and viewId !== this.id. That makes cross-instance drops inconsistent:

  • inner targets work
  • root left/right/top/bottom edge targets do not

This PR makes root edge behavior consistent with the existing external drop flow.

Changes

  • Update root edge canDisplayOverlay(...) to only treat panel drags as internal when data?.viewId === this.id
  • Update root edge onDrop(...) to only call moveGroupOrPanel(...) for same-instance drags
  • Allow cross-instance root edge drags to fall through to the existing external drop event path
  • Add tests for external root-edge dragover and external root-edge drop behavior

Behavior After This Change

  • Same-instance drags still use the existing internal move behavior
  • Cross-instance drags can activate root edge overlays
  • Cross-instance root edge drops emit onDidDrop instead of attempting an internal move

Why

This makes Dockview’s root edge targets behave the same way as its other drop targets for external drags, and removes the need for app-side workarounds when supporting cross-instance tab transfer.

Testing

  • Added coverage for external drags activating root edge handling
  • Added coverage for external root edge drops emitting root-level onDidDrop

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Apr 4, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e53dec6:

Sandbox Source
dockview-app Configuration
editor-gridview Configuration
externaldnd-dockview Configuration
fullwidthtab-dockview Configuration
iframe-dockview Configuration
keyboard-dockview Configuration
nativeapp-dockview Configuration
rendering-dockview Configuration

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