Skip to content

fix(gui): draw popup messages one line per line break - #27

Merged
dkmstr merged 1 commit into
masterfrom
fix/popup-message-layout
Aug 27, 2026
Merged

fix(gui): draw popup messages one line per line break#27
dkmstr merged 1 commit into
masterfrom
fix/popup-message-layout

Conversation

@aschumann-virtualcable

Copy link
Copy Markdown
Contributor

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.

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
dkmstr merged commit d2d4d9c into master Aug 27, 2026
3 checks passed
@aschumann-virtualcable
aschumann-virtualcable deleted the fix/popup-message-layout branch August 27, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants