Repository navigation
Leave a hidden child out of BorderElement's and the default container measure [patch] - #252
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
… measure [patch] UIContainerBase's default measure looped over every child, and BorderElement measured Children.First(), whatever its visibility. StackPanel already filtered to visible children, so collapsing a section with IsVisible = false inside a BorderElement, or inside a custom container on the default measure, still reserved the hidden child's rows. Both measures now consider only visible children, so a border whose child is hidden measures as the bare border (still wide enough for its title). Fixes #190 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW2U95Ey8C2h9t4Ljwn
|
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
UIContainerBase's default measure looped over every child, andBorderElementmeasuredChildren.First()whether or not it was visible.StackPanelalready filtered to visible children. So collapsing a section withIsVisible = false, either inside aBorderElementor inside a custom container that uses the default measure, still reserved the hidden child's rows.Both measures now consider only visible children. A border whose child is hidden measures as the bare border, still wide enough for its title.
Tests
UIContainerBaseMeasureTests.DefaultMeasurementIgnoresHiddenChildren, covering both the width-independent and the width-dependent measure.BorderElementRenderTests.HiddenChildIsMeasuredAsAbsent: a bordered section with a hidden two-line child, inside a verticalStackPanel, measures 2×2, and the next element is drawn directly under it.mainand pass with the fix. Full suite: 329/329 pass.This change is independent of #251, which handles hidden containers drawing their children (#180). Each PR stands alone on
main.Fixes #190
Generated by Claude Code