Change VerticalLayout/HorizontalLayout defaults from Fill() to Auto() #97
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
VerticalLayoutandHorizontalLayoutdefault constraints fromFill()toAuto()for both height and widthStackLayoutasFill()since overlays should fill by defaultFill()is actually neededBreaking Change
This is a breaking change for users who rely on implicit
Fill()behavior for nested layouts. Previously, nested layouts would compete with siblings for space. Now they size to their content by default.Migration: Add
.Fill()explicitly where expansion is desired. Note that root layouts (returned fromBuildLayout()) always receive full terminal bounds regardless of constraints, so no changes needed there.Why This Change
The previous
Fill()default caused unexpected behavior when nesting layouts. An inner layout with implicitFill()would compete with siblings for space rather than sizing to its content. The documentation already worked around this by always calling.Fill()explicitly - this change makes the default match the documented patterns.Changes
src/Termina/Layout/VerticalLayout.cs- Default toAuto()src/Termina/Layout/HorizontalLayout.cs- Default toAuto()docs/layout/vertical-horizontal.md- Updated default behavior sectiondocs/layout/size-constraints.md- Clarified when Fill() is neededdocs/layout/nesting.md- Removed redundant Fill() from examplesTest plan
Fixes #95