From dc279aa0f97dc833b509768a0b8077b58a6e488e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 13 Aug 2026 01:12:01 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(ui):=20a=20notice=20reads=20?= =?UTF-8?q?as=20a=20sentence=20at=20the=20640x360=20floor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bar is a message beside a hint that keeps its own width, and at the floor the picture region is narrower than the hint alone: the message was squeezed to nothing and, with `min_w(0)` under it, wrapped one character per line -- every failure rendered as a column of letters. The row wraps now, so the hint drops to its own line, and the message carries a floor instead of zero: gpui measures a text element's min-content as the whole unwrapped line, so with no floor at all it would refuse to shrink and run off the region instead. --- crates/app/src/main.rs | 11 +++++++++++ crates/app/src/ui/overlays.rs | 17 ++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 4e5d8fd..9717e60 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -6343,6 +6343,17 @@ fn file_name(path: &std::path::Path) -> String { /// eight is more than a user will ever answer in a row. const NOTICES_MAX: usize = 8; +/// The narrowest a notice's *message* is allowed to be squeezed before its hint +/// gives up the line and drops below it. +/// +/// The bar is a message beside a hint, and at the 640x360 floor the picture +/// region it hangs under is narrower than the hint alone -- so the message was +/// squeezed to nothing and wrapped one character per line, which is a failure +/// rendered as a column of letters. Wide enough that a line of it is a phrase +/// rather than a word ladder, and narrow enough to still fit beside the hint in +/// any window worth putting two things on a line in. +const NOTICE_MIN_W: f32 = 180.; + /// The whole of the queue's policy, where it can be read at once and tested /// without a window: dedupe against the back, a ceiling, oldest out first. /// [`Player::notify_user`] is the door every message comes through; this is what diff --git a/crates/app/src/ui/overlays.rs b/crates/app/src/ui/overlays.rs index 543efe6..0397c44 100644 --- a/crates/app/src/ui/overlays.rs +++ b/crates/app/src/ui/overlays.rs @@ -147,6 +147,14 @@ impl Player { }) .flex_none() .flex() + // The hint keeps its own width, and at the 640x360 floor the + // picture region is narrower than the hint alone: with both on + // one line the message was squeezed to nothing and wrapped a + // character per line -- a notice rendered as a column of + // letters. Wrapping puts the hint on its own line instead, so + // the message keeps the whole width and the queue counter + // stays on screen under it. + .flex_wrap() .items_start() .gap(px(12.)) .px(px(12.)) @@ -170,7 +178,14 @@ impl Player { this.dismiss_notice(); cx.notify(); })) - .child(div().flex_1().min_w(px(0.)).child(notice)) + // Shrinkable, because a gpui text element measures its + // min-content as the *whole line* (`TextLayout::layout` only + // wraps against a definite width) -- without a `min_w` the + // message would refuse to shrink at all and run off the region + // instead. With a floor under it, it shrinks to that floor, + // which pushes the hint onto its own line and leaves the + // message the width it needs to wrap like a sentence. + .child(div().flex_1().min_w(px(NOTICE_MIN_W)).child(notice)) .child( div() .flex_none()