tab: Add max_width to TabBar (#2578)
## Description Adds `max_tab_width` to `TabBar`, capping each tab rendered width. Labels set via `.label()` truncate with an ellipsis past the limit; icon-only tabs are unaffected. Tabs with `.child()` content get the width constraint but handle their own truncation. The overflow menu still shows full labels. ## Screenshot | Before | After | | ------ | ----- | | <img width="1712" height="1242" alt="image" src="https://github.com/user-attachments/assets/d7a1d81e-7aed-4889-835b-9c7b980a571f" /> | <img width="1712" height="1242" alt="image" src="https://github.com/user-attachments/assets/82630c9d-54e6-4253-bb90-4f4cd489eb42" /> | ## How to Test 1. `cargo run` and open the Tabs story. 2. Toggle “Max tab width”; the enabled value is fixed at 110px. 3. Confirm long labels truncate, short labels keep their intrinsic width, custom children remain constrained, and the overflow menu shows full text. 4. Run `cargo test -p gpui-component tab::`. ## Checklist - [x] Read CONTRIBUTING and followed the guidelines. - [x] Reviewed changes, confirmed AI-generated code is accurate. - [x] Passed Story compilation and tab tests. - [ ] Tested macOS, Windows, Linux performance (if platform-specific). --------- Co-authored-by: Jason Lee <huacnlee@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
S
Scott Cummings committed
bbe06759696217633237364a6f5020fe997ba039
Parent: 7033423
Committed by GitHub <noreply@github.com>
on 8/13/2026, 3:38:49 PM