Skip to content

A5: <Text> always carries flexShrink: 1 on wrap-family modes #58

Description

@re-marked

Imported from the local Yokai shakedown tracker as A5.

Project metadata: category=A: Core API, effort=0 (subsumed), impact=unknown, risk=unknown, when=with A1.


Status: OPEN (related to A1; the fix landed for truncate modes was reverted)

Where: Text.tsx memoizedStylesForWrap'wrap' and 'wrap-trim' modes set flexShrink: 1

Symptom: Nested Text inside a column-flex parent containing larger siblings → yoga shrinks the wrapping Text. Its content wraps to a 2nd line that's invisible because of height: 1 on the parent. Looks identical to fixed-position truncation, but silent.

Common manifestation: title bar fights with file list — title bar's text gets shrunk by yoga to make room for the file list's natural width, title text wraps to invisible 2nd line.

Workaround: put the title in a <Box flexShrink={0}> wrapper, OR use explicit width on the title's container (subject to A1 caveats — the wrapper might still allow basis to be wrong).

Proper fix: wrap-mode Text shouldn't make itself shrink-eligible by default. Wrap-when-necessary should kick in only when yoga has actually committed less width than natural during the EXACTLY pass — not preemptively make the Text a flex-shrink victim during the AtMost basis pass.

This is the same root issue as A1 — measureTextNode reporting wrapped/truncated dimensions during intrinsic measurement gets baked in as basis, and flexShrink: 1 then locks the wrong basis. Fix A1 properly and A5 mostly evaporates.

Effort: dependent on A1. If A1 is fixed at the measure layer, A5's flexShrink: 1 becomes safe to keep (basis is now natural; flex math distributes correctly).


B. Layout footguns

These are documentable gotchas more than bugs — yoga / CSS-flex semantics that are correct per spec but trip TUI-context expectations.


Metadata

Metadata

Assignees

No one assigned

    Labels

    area:layoutFlexbox/Yoga/layout semanticsarea:textText measurement, wrapping, or renderingbugSomething isn't workingkind:bugBehavioral bug or incorrect runtime behaviorsource:real-worldSurfaced through real-world downstream usagesource:shakedownImported from the local Yokai shakedown issue list

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions