feat(dockview-core): add tab groups with colored chips, collapse/expand, and drag-and-drop#1136
feat(dockview-core): add tab groups with colored chips, collapse/expand, and drag-and-drop#1136KyDenZ wants to merge 6 commits intomathuo:masterfrom
Conversation
|
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:
|
c392480 to
e1e46f9
Compare
|
@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. |
ecec07b to
d9307aa
Compare
…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)
2c3eb26 to
d430678
Compare
|
Rebased on Replaced the custom React |
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
Tab groups
TabGroupclass with color (8 preset colors), label, collapse/expand, serialization (toJSON/fromJSON)createTabGroupChipComponentoption + framework bindings (React, Vue, Angular)prefers-reduced-motionsupportAPI additions (
DockviewApi)createTabGroup({ groupId, label?, color? })→ITabGroupdissolveTabGroup({ groupId, tabGroupId })addPanelToTabGroup({ groupId, tabGroupId, panelId, index? })removePanelFromTabGroup({ groupId, panelId })getTabGroups(groupId)→readonly ITabGroup[]getTabGroupForPanel({ groupId, panelId })→ITabGroup | undefinedmoveTabGroup({ groupId, tabGroupId, index })Demo
tab-groupstemplate with context menu for group management (create, rename, change color, collapse, dissolve, add/remove tabsTest plan
TabGroupclass (creation, add/remove panels, collapse/expand, serialization, events, dispose)Breaking changes
None — all additions are opt-in. Depends on the smooth tab reorder PR (
tab-drag-animation).