Skip to content

feat(dockview-core): add tab groups with colored chips, collapse/expand, and drag-and-drop#1136

Open
KyDenZ wants to merge 6 commits intomathuo:masterfrom
KyDenZ:001-tab-groups-clean
Open

feat(dockview-core): add tab groups with colored chips, collapse/expand, and drag-and-drop#1136
KyDenZ wants to merge 6 commits intomathuo:masterfrom
KyDenZ:001-tab-groups-clean

Conversation

@KyDenZ
Copy link
Copy Markdown
Contributor

@KyDenZ KyDenZ commented Mar 20, 2026

Depends on the smooth tab reorder PR (tab-drag-animation)

Summary

Adds a tab grouping system to dockview, allowing panels to be organized into named, colored groups with collapsible chips and full drag-and-drop support.

Closes #259, #631

Screen Recording 2026-03-20 at 23 20 41

Tab groups

  • Data model: TabGroup class with color (8 preset colors), label, collapse/expand, serialization (toJSON/fromJSON)
  • Tab group chips: Colored chip rendered before a group's tabs, click to toggle collapse/expand
  • Customizable chip renderer: createTabGroupChipComponent option + framework bindings (React, Vue, Angular)
  • Chrome-style underline: SVG-based underline that wraps around the active tab within each group
  • Drag-and-drop:
    • Drag individual tabs between groups or to standalone positions
    • Drag entire groups by their chip with composite drag image (chip + all group tabs)
    • Groups cannot be dropped inside other groups (snaps to group boundaries)
  • Collapse/expand animations: Smooth CSS transitions with prefers-reduced-motion support

API additions (DockviewApi)

  • createTabGroup({ groupId, label?, color? })ITabGroup
  • dissolveTabGroup({ groupId, tabGroupId })
  • addPanelToTabGroup({ groupId, tabGroupId, panelId, index? })
  • removePanelFromTabGroup({ groupId, panelId })
  • getTabGroups(groupId)readonly ITabGroup[]
  • getTabGroupForPanel({ groupId, panelId })ITabGroup | undefined
  • moveTabGroup({ groupId, tabGroupId, index })

Demo

  • New tab-groups template with context menu for group management (create, rename, change color, collapse, dissolve, add/remove tabs

Test plan

  • 53 unit tests for TabGroup class (creation, add/remove panels, collapse/expand, serialization, events, dispose)
  • Drag-and-drop animation regression tests
  • Full test suite passes (565 tests)

Breaking changes

None — all additions are opt-in. Depends on the smooth tab reorder PR (tab-drag-animation).

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Mar 20, 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 d430678:

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

@KyDenZ KyDenZ force-pushed the 001-tab-groups-clean branch 2 times, most recently from c392480 to e1e46f9 Compare March 27, 2026 09:36
@mathuo
Copy link
Copy Markdown
Owner

mathuo commented Mar 30, 2026

@KyDenZ I haven't forgotten about this but I wanted to get one change in before this to make tab groups works out of the box going forwards

I'm creating native support for dockview to have tab context menus here. It's something I've been meaning to do for awhile and this change for tab groups would be a great use case for it allowing tabgroups to work by default through the native tab dropdown.

Once I merge this we can add tab groups as a default tab context menu item and then get this merged.

@KyDenZ KyDenZ force-pushed the 001-tab-groups-clean branch 2 times, most recently from ecec07b to d9307aa Compare April 2, 2026 17:26
Flavien VACCARETTI added 6 commits April 2, 2026 19:42
…nd, and drag-and-drop

Introduces a tab grouping system that allows panels to be organized into
named, colored groups with collapsible chips. Includes smooth drag-and-drop
reordering for both individual tabs and entire groups, with Chrome-style
underline indicators and FLIP animations.

Key additions:
- TabGroup data model with color, label, collapse/expand, serialization
- Tab group chip renderer (default + framework bindings for React, Vue, Angular)
- DockviewApi methods: createTabGroup, dissolveTabGroup, addPanelToTabGroup, etc.
- Drag constraints: groups cannot be dropped inside other groups
- Adjacent-tab-to-group drop fix for position 0
- Demo template with context menu for group management
- Factored _commitGroupMove helper to eliminate 3x duplication
- Removed dead code (unreachable lastIdx+1 branch)
… color picker

- Add getTabGroupChipContextMenuItems callback to DockviewOptions
- Add 'colorPicker' as a built-in chip menu item that renders a native color swatch grid
- Wire contextmenu event on TabGroupChip through ContextMenuController.showForChip()
- Fix DnD regression: inverted tabAnimation condition in tabs.ts drop handler
- Fix smooth animation running in default mode by guarding runFlipAnimation call
- Refactor tab-groups example to use native context menu APIs (remove custom React ContextMenu component)
@KyDenZ KyDenZ force-pushed the 001-tab-groups-clean branch from 2c3eb26 to d430678 Compare April 2, 2026 17:42
@KyDenZ
Copy link
Copy Markdown
Contributor Author

KyDenZ commented Apr 2, 2026

Rebased on master

Replaced the custom React ContextMenu with the native context menu + new getTabGroupChipContextMenuItems callback + built-in colorPicker item.

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.

Group Tab

2 participants