Skip to content

feature: add floatingTabBehavior option for browser-style floating tab management (#1161)#1166

Open
shay-dr wants to merge 1 commit intomathuo:masterfrom
shay-dr:1161-floating-to-floating-tab-merge-and-tear-off-to-float-behavior
Open

feature: add floatingTabBehavior option for browser-style floating tab management (#1161)#1166
shay-dr wants to merge 1 commit intomathuo:masterfrom
shay-dr:1161-floating-to-floating-tab-merge-and-tear-off-to-float-behavior

Conversation

@shay-dr
Copy link
Copy Markdown

@shay-dr shay-dr commented Apr 10, 2026

Closes #1161

Adds a floatingTabBehavior option to DockviewOptions with two modes:

  • "default" (or omitted): No behavior change — full backward compatibility
  • "browser": Enables two features:
    • Floating-to-floating merge: Dragging a tab from one floating group onto another merges it into the target, rather than docking to the grid
    • Tear-off to float: Dragging a tab out of a multi-tab floating group creates a new floating group at the drop position, rather than docking to the grid

How it works

  • In canDisplayOverlay, when the mouse is over a non-source floating group, the root drop target suppresses its overlay so the floating group's own Droptarget can handle the event
  • In onDrop, when a tab is torn from a multi-tab floating group, addFloatingGroup is called instead of orthogonalize
  • All changes are gated behind floatingTabBehavior === 'browser' — zero impact on default behavior

Changes

  • options.ts: Add floatingTabBehavior to DockviewOptions and PROPERTY_KEYS_DOCKVIEW
  • dockviewComponent.ts: Root overlay suppression + tear-off-to-float logic + _isMouseOverNonSourceFloatingGroup helper
  • New test file: 11 tests covering merge, tear-off, bounds, backward compatibility, and overlay suppression

Test details

  • All 752 existing tests pass unchanged
  • 11 new tests cover both modes
  • Manual: created two floating groups, drag tab between them with floatingTabBehavior="browser"
  • Manual: verified default behavior unchanged when option is omitted

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Apr 10, 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 5eae784:

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

@shay-dr shay-dr force-pushed the 1161-floating-to-floating-tab-merge-and-tear-off-to-float-behavior branch from b564539 to 6f66bdb Compare April 11, 2026 14:30
@shay-dr
Copy link
Copy Markdown
Author

shay-dr commented Apr 11, 2026

I forgot to sign, hence my force push.

@mathuo
Copy link
Copy Markdown
Owner

mathuo commented Apr 11, 2026

Could you remove the tsBuildInfo files?

@shay-dr shay-dr force-pushed the 1161-floating-to-floating-tab-merge-and-tear-off-to-float-behavior branch 2 times, most recently from a1f7faf to 5eae784 Compare April 11, 2026 21:21
…b management (mathuo#1161)

Add a `floatingTabBehavior` configuration option to DockviewOptions.
When set to `"browser"`, dragging a tab onto a different floating group
merges it into the target group, and tearing a tab out of a multi-tab
floating group creates a new floating group at the drop position instead
of docking to the grid. Default behavior is unchanged.
@shay-dr
Copy link
Copy Markdown
Author

shay-dr commented Apr 11, 2026

@mathuo done.

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.

Support floating-to-floating tab merge and tear-off-to-float behavior

2 participants