on main help sign in
fix(ui): truncate status messages that would otherwise wrap (#2306)
commit655ce65564a2813bae27d6be0a7562b6a28e60e4 authorChristian Rocha <christian@rocha.is> dateWed 25 Feb 2026, 11:38 (8 months ago) parent62b8c0b
1 file changed+4−2
internal/ui/model/status.go+4−2
internal/ui/model/status.go+4−2
@@ -1,6 +1,7 @@
11package model
22
33import (
4+ "strings"
45 "time"
56
67 "charm.land/bubbles/v2/help"
@@ -99,9 +100,10 @@ func (s *Status) Draw(scr uv.Screen, area uv.Rectangle) {
99100 }
100101
101102 ind := indStyle.String()
102− messageWidth := area.Dx() - lipgloss.Width(ind)
103+ messageWidth := max(0, area.Dx()-lipgloss.Width(ind)-msgStyle.GetHorizontalPadding())
103104 msg := ansi.Truncate(s.msg.Msg, messageWidth, "…")
104− info := msgStyle.Width(messageWidth).Render(msg)
105+ msg += strings.Repeat(" ", max(0, messageWidth-lipgloss.Width(msg)))
106+ info := msgStyle.Render(msg)
105107
106108 // Draw the info message over the help view
107109 uv.NewStyledString(ind+info).Draw(scr, area)