on main help sign in
fix(ui): notification width and text truncation

Prior to this fix, notifications in the footer would not span the width of the window, and text truncation would often happen prematurely.

commit09a112040fb774e9799dc611736baf405e438b1d authorChristian Rocha <christian@rocha.is> dateSun 26 Apr 2026, 20:18 (6 months ago) parent9c4a316
1 file changed+6−4
internal/ui/model/status.go+6−4
internal/ui/model/status.go+6−4
@@ -101,11 +101,13 @@ func (s *Status) Draw(scr uv.Screen, area uv.Rectangle) {
101101
102102 ind := indStyle.String()
103103 indWidth := lipgloss.Width(ind)
104+ msgPad := msgStyle.GetPaddingLeft() + msgStyle.GetPaddingRight()
105+ avail := max(0, area.Dx()-indWidth-msgPad)
104106 msg := strings.Join(strings.Split(s.msg.Msg, "\n"), " ")
105− msgWidth := lipgloss.Width(msg)
106− msg = ansi.Truncate(msg, area.Dx()-indWidth-msgWidth, "…")
107− padWidth := max(0, area.Dx()-indWidth-msgWidth)
108− msg += strings.Repeat(" ", padWidth)
107+ msg = ansi.Truncate(msg, avail, "…")
108+ if w := lipgloss.Width(msg); w < avail {
109+ msg += strings.Repeat(" ", avail-w)
110+ }
109111 info := msgStyle.Render(msg)
110112
111113 // Draw the info message over the help view