Wrap long notice-plate text instead of overflowing the box
Browse files at this commit9e3e5bc0ac6ac420eb007134b633d9c270ece346Parent: 4a00a35- fix
- wrap long notice-plate text instead of overflowing the box
1 changed file +9 -1
crates/app/src/ui/stance.rsmodified+9 -1
| @@ -639,7 +639,15 @@ fn notice_plate(message: SharedString, bench_h: f32) -> impl IntoElement { | |||
| 639 | gpui::FontWeight::MEDIUM, | 639 | gpui::FontWeight::MEDIUM, |
| 640 | )) | 640 | )) |
| 641 | .text_color(rgb(INK1())) | 641 | .text_color(rgb(INK1())) |
| 642 | - .child(message) | 642 | + // `div()` is a flex row by default, and a bare text child measures |
| 643 | + // its min-content as the *whole line* (`TextLayout::layout` only | ||
| 644 | + // wraps against a `Definite` available width, which a flex item's | ||
| 645 | + // content-sizing pass never supplies). `w_full`/`max_w` on the | ||
| 646 | + // plate itself only bounds the *container* -- the text still never | ||
| 647 | + // sees a definite width to wrap against unless it is a `flex_1` | ||
| 648 | + // child, which is handed the container's resolved width. Same fix | ||
| 649 | + // as `overlays.rs`'s notice bar (`div().flex_1().min_w(...)`). | ||
| 650 | + .child(div().flex_1().child(message)) | ||
| 643 | } | 651 | } |
| 644 | 652 | ||
| 645 | /// Thin strip at the bottom of the centre column: project identity, last | 653 | /// Thin strip at the bottom of the centre column: project identity, last |