Repository navigation
Conversation
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.
kopeng-mi
added a commit
to kopeng-mi/zeron
that referenced
this pull request
Oct 15, 2026
…ng over popovers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In side chats, opening the model picker above the composer showed the fork marker's source title (e.g. "Zeron") drawn on top of the picker card, over the effort slider and its thumb, crisp and unblurred.
Cause. The fork seam centered its title with
text_center()on a full-width block. gpui paints each text line inside apaint_layerregistered at the line origin with the text's own width (paint_lineintext_system/line.rs), while the glyphs are shifted byaligned_origin_x. The draw-order bounds tree therefore sees the title as a small box at the left edge, so a popover layer painted later over the centered glyphs can get a draw order at or below them. Long titles that truncate fill the width and are unaffected; short ones trigger it.Fix. Center the title with flex (
justify_center) around a shrink-to-fit child, so its box matches the glyphs.min_w_0+truncatekeep long titles from widening narrow side-chat panes.Possible follow-up. This only patches the fork marker; the root cause is in gpui's
paint_lineand still affects anytext_center()/text_right()text in a block wider than its content (about 25 call sites incrates/ui/src) whenever a popover, menu or toast overlaps it. A fix could go in zui: register the line's layer over the aligned span (e.g. widthalign_width.max(layout.width), or starting from the aligned x) instead oforigin+layout.width, then bump therev. That touches the draw order of every aligned text line, so it would deserve its own change with a visual pass. Upstream gpui has the same code.Validation:
cargo check -p zeron-uipassed.rustfmt --checkon the changed file passed.