From 2b542ca50902bb824d5e2427d2c714cebc2eee09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Gurruchaga?= Date: Wed, 14 Oct 2026 20:32:40 -0300 Subject: [PATCH] Keep the fork marker title from painting over popovers The fork seam centered its source title with text_center() on a full-width block. gpui registers a text line's paint layer at the line origin with the text's own width, so alignment-shifted glyphs paint outside that layer and can take a draw order at or above a popover opened later over them. In side chats the model picker opened above the composer showed a short source title drawn on top of its effort slider. Center the title with flex instead, so its shrink-to-fit box matches the glyphs. Long titles still truncate. --- crates/ui/src/transcript.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/crates/ui/src/transcript.rs b/crates/ui/src/transcript.rs index 20545b8cfa..7745145189 100644 --- a/crates/ui/src/transcript.rs +++ b/crates/ui/src/transcript.rs @@ -8977,16 +8977,19 @@ fn fork_marker(source_title: SharedString, theme: &Theme) -> AnyElement { ) .child(rule()), ) + // Centered by flex, not `text_center()`: gpui registers a text line's + // layer at the line origin with the text's own width, so glyphs shifted + // by alignment paint outside it and can draw over popovers above them. .child( - div() - .w_full() - .min_w_0() - .truncate() - .text_center() - .text_size(crate::typography::ui_rems(13.0)) - .font_weight(gpui::FontWeight::MEDIUM) - .text_color(theme.text_muted) - .child(source_title), + div().w_full().min_w_0().flex().justify_center().child( + div() + .min_w_0() + .truncate() + .text_size(crate::typography::ui_rems(13.0)) + .font_weight(gpui::FontWeight::MEDIUM) + .text_color(theme.text_muted) + .child(source_title), + ), ) .into_any_element() }