Repository navigation
Wrap text inside a border or a horizontal stack to the width it gets [patch] - #205
Merged
matt-edmondson merged 1 commit intoOct 9, 2026
Merged
Conversation
…[patch] BorderElement measured its child without the width its parent passed in, and a horizontal StackPanel measured children width-independently, so word-wrapped text in either reported one unwrapped row and only its first line was drawn. BorderElement now forwards the width inside the border, and a horizontal StackPanel measures each child against the width its earlier siblings and the spacing leave, in both arrange and measure. Replaces the test that locked in the border's width-blind measure. Fixes #161 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016rdMXULeUT13t6FCwNfocx
|
matt-edmondson
deleted the
claude/tui-161-wrap-in-border-and-horizontal-stack
branch
October 9, 2026 08:00
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.



Fixes #161
What changed
BorderElementoverrides the width-awareOnCalculateRequiredDimensionsForChildren(int)and forwards the width inside the border to its child. The title-width rule from BorderElement title is truncated or not drawn at all because the border's measured width ignores the title #157 is shared between both overloads.StackPanelmeasures each child against the width still free:contentArea.Width - currentOffsetwhen arranging, and the available width minus earlier siblings and spacing when measuring. Width-independent measures (no width given) are unchanged.Tests
ContainerWithoutAWidthAwareLayoutMeasuresTheSameWithAWidth, which locked in the old behaviour, with five tests:TUI.Testsuite passes (260/260).🤖 Generated with Claude Code
https://claude.ai/code/session_016rdMXULeUT13t6FCwNfocx
Generated by Claude Code