Implement CrossAxisAlignment options for TUI flex#13417
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
CrossAxisAlignment options for TUI flex
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR changes TuiFlex cross-axis sizing/alignment semantics, adds CrossAxisAlignment support, updates affected TUI call sites, and adds coverage for the new layout behavior.
Concerns
- For this user-facing TUI layout change, the PR description lists manual testing but does not include screenshots or a screen recording. Repository review guidance requires visual evidence demonstrating user-visible behavior end to end.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
TuiFlex now sizes its cross axis to its largest child (clamped to the constraint) instead of filling the offered extent, matching the GUI Flex/Flutter policy. with_cross_axis_alignment() mirrors the GUI enum: Start (default), Center/End position each child within its slot, and Stretch fills the offered cross extent and tightens child constraints (used by the transcript input banner). The input editor element now claims its full wrap width since its inner column hugs content. Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
23000b8 to
a16368f
Compare

Description
This PR was originally motivated by wanting to turn the input into a flex row w/
[!][input](when shell mode was enabled). To do this with the existing flex API (where the flex reports its cross axis as the largest cross axis offered instead of auto-constraining the height), we would have had to manually constrain the row with a calculated height, which we could only know at layout time.The solution was to update the TUI flex api to be aligned w/ the GUI flex API, where the flex now reports its cross axis as the largest child's cross extent, clamped to that constraint. You can still achieve the original full-constraint-reporting by using the
CrossAxisAlignment::Stretch(using the same enum as the GUI w/ the same semantics), but you can also use the other cross axis alignment options offered to the GUI flex (i.e. start — the default — center, or end). With this change, the TUI flex's cross axis behavior reaches feature/behavior parity w/ the GUI flex.The PR above this one uses this new API to implement the
[!][input]flex row for the input.Testing
./script/runAgent Mode