feat(core): LayoutPriority.Fill — one view/group fills, siblings stay fixed#1389
Open
mathuo wants to merge 1 commit into
Open
feat(core): LayoutPriority.Fill — one view/group fills, siblings stay fixed#1389mathuo wants to merge 1 commit into
mathuo wants to merge 1 commit into
Conversation
Add `LayoutPriority.Fill` so a view (standalone gridview) or group (dockview) absorbs all surplus/deficit space while its siblings keep their fixed sizes — the common "central content fills, side panels stay put" layout that proportional priorities cannot express. Closes #1378. - splitview: fill views absorb space in layout/relayout/distributeEmptySpace; multiple fills split the surplus equally; hidden fills fall back to normal - gridview: Fill propagates up the branch tree (highest precedence); the runtime priority setter forces a full relayout so propagation takes effect - dockview: group-level priority via addGroup({ priority }), group.api.priority, and toJSON/fromJSON round-trip Backwards compatible: every behaviour change is gated on a fill view being present, so existing layouts and serialized state are unchanged; the serialized `priority` key only appears when a group opts in. Co-Authored-By: Claude Opus 4.8 (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
Adds
LayoutPriority.Fillso a view (standalone gridview) or group (dockview) absorbs all surplus/deficit space while its siblings keep their fixed sizes — the common "central content fills, side/bottom panels stay put" layout that the existing proportional priorities (Low/High/Normal) can't express.Closes #1378.
Motivation
Today every priority participates in proportional redistribution, so resizing the window / adding / removing a panel rescales every view. Consumers end up fighting this with manual
setSizecalls on every layout change.Fillsolves it declaratively: designate one leaf as the filler and the rest hold their size.What's included
Engine ( standalone gridview + splitview)
LayoutPriority.Fill— a fill view absorbs surplus/deficit inlayout/relayout/distributeEmptySpace; siblings are held fixed.BranchNodepropagatesFillup the grid tree (highest precedence), so it works in nested layouts.GridviewPaneltriggers a full relayout so propagation up the branch tree takes effect.Dockview (group-level)
api.addGroup({ priority: LayoutPriority.Fill }).group.api.priority = LayoutPriority.Fill.toJSON/fromJSON).Backwards compatibility
Fully backwards compatible. Every behaviour change is gated on a fill view being present, so existing layouts and serialized state are unchanged. The serialized
prioritykey only appears when a group opts in; older payloads simply omit it and load unchanged.Tests
priorityround-trips throughtoJSON/fromJSON.addGroup({ priority })+ round-trip persistence, runtimegroup.api.priority, and a behavioural test (three groups; middle set toFill; only it resizes while siblings stay fixed).dockview-core: 1082/1082 green,tscclean.🤖 Generated with Claude Code