Swap tab groups to render icon only to match tabs#13105
Conversation
|
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 makes horizontal tab group headers switch from the full collage-and-title layout to an icon-only collage at the same width threshold used by tabs. The attached before/after Loom links satisfy the repo's visual-evidence requirement, and I did not find security findings or spec-drift concerns because no approved spec context was provided.
Concerns
- The new responsive header is still laid out as a non-flex child of the group row, so it receives an unbounded horizontal constraint and the
SizeConstraintSwitchcannot observe the finite tab slot width it is meant to compare against.
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
| .finish(); | ||
|
|
||
| // Go compact at the same width as a tab, so headers and tabs shrink in step. | ||
| let content = SizeConstraintSwitch::new( |
There was a problem hiding this comment.
render_horizontal_tab_group as a normal Flex child, and Flex lays non-flex children out with an unbounded main-axis constraint. With constraint.max.x() infinite, WidthLessThan(COMPACT_TAB_WIDTH_THRESHOLD) never matches; the default full row also uses MainAxisSize::Max, which tries to expand to infinity. Make the header a finite flex slot (for example by wrapping it in Shrinkable::new(1.0, ...) at the group-row call site) before switching on width.
c139c45 to
3a3f0c1
Compare
4787e90 to
a036ec2
Compare
Description
When tabs shrink to a certain size in the horizontal tab bar, they stop displaying the tab name and just show their icon. This PR modifies tab group headers to follow the same behavior.
How it works
SizeConstraintSwitchthat swaps the full layout (collage + name) for a compact, icon-only collage belowCOMPACT_TAB_WIDTH_THRESHOLD(42px) — the same mechanism and thresholdTabComponentalready uses, so headers and tabs go compact at the same width.TAB_INDICATOR_HEIGHT, 14px), centeredLinked Issue
https://linear.app/warpdotdev/issue/APP-4777/tab-group-header-icon-collage-is-clipped-when-many-tabs-open
Testing
./script/runScreenshots / Videos
Demo before
Demo after