feat(dockview-core): allow overriding the group drag ghost (#1167)#1281
Merged
Conversation
…om component Closes #1167. The drag ghost previously rendered hard-coded English text ("Multiple Panels (N)"), preventing i18n. Introduces an `IGroupDragGhostRenderer` interface and a `createGroupDragGhostComponent` option (parallel to `createTabGroupChipComponent`) so consumers can replace the entire ghost with their own renderer. Default behavior is unchanged when no factory is supplied. Wires `groupDragGhostComponent` props through the React, Vue, and Angular wrappers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a "Customizing the group drag ghost" section to the DnD page with framework-specific examples and DocRef blocks, exports IDockviewGroupDragGhostProps from the React entry, and wires a sample ghost component into the demo sandbox. Regenerates api.output.json so the new DocRef references resolve. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a "Custom Drag Ghost" toggle to the demo sandbox's View settings
so flipping the switch exercises updateOptions({
createGroupDragGhostComponent }) at runtime, validating live swaps
between the built-in and a user-supplied ghost.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
"Multiple Panels (N)", blocking i18n. Adds acreateGroupDragGhostComponentoption (parallel tocreateTabGroupChipComponent) that lets consumers replace the entire ghost with their own renderer. Default behavior is unchanged when no factory is supplied.IGroupDragGhostRendererinterface exported fromdockview-core:{ element: HTMLElement; init({ group, api }); dispose?() }.groupDragGhostComponentprops throughdockview(React),dockview-vue, anddockview-angular, mirroring the existing chip component wiring.Test plan
dockview-core— 2 new tests ingroupDragHandler.spec.tscover custom factory invocation/disposal and the default-ghost fallback. Full suite 909/909 passing.dockview(React) — 6 tests inreactGroupDragGhostPart.spec.ts. Full suite 50/50 passing.dockview-vue— 1 new test indockview.spec.tsassertingcreateGroupDragGhostComponentflows throughupdateOptions. Full suite 78/78 passing.dockview-angular— 4 tests inangular-group-drag-ghost-renderer.spec.ts. Full suite 126/126 passing.yarn lintclean (0 errors).setDragImagesnapshotting.)Notes for reviewers
GroupDragHandler.getDataonly when set; otherwise the original"Multiple Panels (N)"ghost is preserved verbatim.addGhostImagealready removes the ghost element viasetTimeout(0); the custom renderer'sdispose()is scheduled on the same tick so the framework portal/component is torn down together.HTMLElementin their factory.🤖 Generated with Claude Code