forge
Explore
Log in

Don't you dare go Hollow

Wrap long notice-plate text instead of overflowing the box

Browse files at this commit

9e3e5bc0ac6ac420eb007134b633d9c270ece346Ahmet Kaan GümüşParent: 4a00a35
  • fix
    • wrap long notice-plate text instead of overflowing the box
Show full message
🐛 fix(ui): wrap long notice-plate text instead of overflowing the box

notice_plate's max_w(480) only bounds the div; a bare text child of a
flex row measures min-content as the whole line, so GPUI never gave it
a Definite width to wrap against. Same shape as overlays.rs's notice
bar: wrap the text in a flex_1 child so it inherits the container's
resolved width.
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, last653 /// Thin strip at the bottom of the centre column: project identity, last