Skip to content

feat(dockview-core): dedicated floating-group drag handle#1312

Merged
mathuo merged 3 commits into
masterfrom
feat/floating-group-drag-handle
Jun 2, 2026
Merged

feat(dockview-core): dedicated floating-group drag handle#1312
mathuo merged 3 commits into
masterfrom
feat/floating-group-drag-handle

Conversation

@mathuo
Copy link
Copy Markdown
Owner

@mathuo mathuo commented Jun 2, 2026

Description

Adds a dedicated, configurable drag handle for floating groups. All changes are in dockview-core.

New option floatingGroupDragHandle?: 'titlebar' | 'tabbar':

  • 'titlebar' (default) — a dedicated blank grab bar is rendered above the tab bar; drag it to move the window, shift+drag (mouse) / long-press (touch) to redock into the grid. Styleable via the --dv-floating-titlebar-* theme variables.
  • 'tabbar' — legacy behaviour: the tab bar's empty "void container" doubles as the move handle.

Also in this PR:

  • The floating void container redocks on a plain drag.
  • A border/corner fix for the floating drag handle in spaced layouts (_space-mixin.scss).

Notable behaviour change: floating groups now show the dedicated title-bar handle by default. Pass floatingGroupDragHandle: 'tabbar' to keep the previous look.

This is the first of two stacked PRs split out of #1310; the nested multi-grid floating/popout layouts build on top of it.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / cleanup
  • Build / CI / tooling

Affected packages

  • dockview-core
  • dockview (vanilla JS)
  • dockview-react
  • dockview-vue
  • dockview-angular
  • docs

How to test

  • yarn test in dockview-core — 1009 tests pass (adds overlay.spec.ts, voidContainer.spec.ts, and floating drag-handle coverage in dockviewComponent.spec.ts).
  • Manual: float a group; confirm the title-bar grab strip appears above the tabs, drag it to move the window, shift+drag / long-press to redock. Set floatingGroupDragHandle: 'tabbar' and confirm the legacy void-container handle behaviour.

Checklist

  • yarn lint:fix passes
  • yarn format passes
  • npm run gen has been run and generated files are up to date
  • yarn test passes
  • I have added or updated tests where applicable
  • Breaking changes are documented

mathuo and others added 3 commits June 2, 2026 20:36
Add an optional dedicated grab bar rendered above a floating group's tab
bar that acts as the window move handle (FlexLayout-style). A plain drag
moves the float; shift+drag (mouse) / long-press (touch) redocks into the
grid, reusing the same gesture disambiguation as the tab-bar void handle.

- Overlay gains an optional `header` slot (flex-column layout) + headerHeight
- Extract the redock drag-source machinery (ghost + html5/pointer sources +
  floating disambiguation) out of VoidContainer into a shared GroupDragSource
- New FloatingTitleBar component (contentless; styled via theme vars)
- New option `floatingGroupDragHandle: 'titlebar' | 'tabbar'` (default
  'titlebar') with a per-call `dragHandle` override on FloatingGroupOptions
- floatingGroupService adds the header offset on the group->overlay size path
- Theme vars: --dv-floating-titlebar-{height,background-color,border-bottom}
- Enable it on the docs demo

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…outs

In spaced themes the floating border + rounded corners are applied to the group
(.dv-groupview) rather than the outer resize container. With the dedicated
drag-handle bar now sitting above the group, that left the handle with a square,
border-less top while the group below it kept the rounded top — so the card
looked wrong. Move the top border and rounded top corners onto the drag handle
(it's now the top of the card) and flatten the group's top so the two read as a
single rounded card.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When a floating window has a dedicated title-bar move handle, the tab bar's
void container is no longer the move handle, so it no longer needs the shift
(mouse) / long-press (touch) gate that disambiguated it from moving the float.
It now initiates a group drag with a plain drag, exactly like a group in the
main grid. The gate still applies to whichever element actually moves the float
(the title bar, or the void container itself in the legacy tab-bar mode).

GroupDragSource gains an `isFloatingMoveHandle` predicate; the void container
reports false when its overlay is `.dv-resize-container-with-titlebar`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2026

@mathuo mathuo merged commit 2cb37b1 into master Jun 2, 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