@@ -66,7 +66,7 @@ There are no events and no input handling.
6666
6767### Measurement model
6868
69- ` TextBlock ` measures to a fixed size based on:
69+ ` TextBlock ` measures based on:
7070- the text's cell width (not string length)
7171- the wrap flag and available width
7272- the available height (clamped)
7676- ` naturalWidth = TerminalTextUtility.GetWidth(text) `
7777- ` width = min(constraints.MaxWidth, naturalWidth) `
7878
79- When ` Wrap ` is false or ` width == 0 ` :
80- - desired size is ` (width, 1) ` (height is clamped to 1)
79+ When ` Wrap ` is false:
80+ - ` Natural.Width ` is the full text width
81+ - ` Min.Width ` is ` 1 ` for non-empty text (` 0 ` for empty text), so single-line text can shrink during layout
82+ - ` Max.Width ` is the full text width
83+ - ` FlexShrinkX = 1 ` when the text is wider than its minimum
84+
85+ When ` Wrap ` is true and ` width == 0 ` :
86+ - desired size is ` (0, 1) ` (height is clamped to 1)
8187
8288When ` Wrap ` is true:
8389- height is computed as the number of wrapped lines for the given width (at least 1)
@@ -86,6 +92,8 @@ When `Wrap` is true:
8692Notes:
8793- The measured width does not attempt to "stretch to fill" when there is more horizontal space than the text requires.
8894 Stretching is handled by layout via ` HorizontalAlignment = Align.Stretch ` if desired.
95+ - This horizontal shrink budget is what allows layouts such as ` Grid(Star + Auto) ` to keep trailing controls visible
96+ while the text trims in the remaining width.
8997
9098### Rendering model
9199
0 commit comments