fix(gui): draw popup messages one line per line break - #27
Merged
Conversation
Messages carry explicit line breaks, but the popup wrapped them as a single run of text: each drawn section kept its embedded break and painted a second line on top of the next section, so the text overlapped itself. Line breaks in the message now start a new line, each paragraph is wrapped on its own, and the popup window is sized from the number of lines it has to draw, so a long message no longer runs into the buttons.
dkmstr
approved these changes
Aug 27, 2026
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.
Popup messages were drawn on top of each other: every line was painted at the same
origin, so a multi-line message ended up as an unreadable blob.
Text is now laid out one line per line break, and the popup grows to fit the
resulting block instead of assuming a single line.
Changes
crates/gui/src/draw/ui/text.rs— wrap the message into lines and measure the whole block.crates/gui/src/windows/popup.rs— lay out and draw the lines, sizing the popup from the measured block.Tests
Unit tests cover the wrapping and the resulting layout, including the multi-line
host-approval message that showed the bug.
Cosmetic only: no behaviour change beyond how the text is painted.