From 655ce65564a2813bae27d6be0a7562b6a28e60e4 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 25 Feb 2026 11:38:02 -0500 Subject: [PATCH] fix(ui): truncate status messages that would otherwise wrap (#2306) --- internal/ui/model/status.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/ui/model/status.go b/internal/ui/model/status.go index 00f637832cf67a65efb66630308234f353169d3c..fbec7792bd9f6fbc9445036323f9a425438c200d 100644 --- a/internal/ui/model/status.go +++ b/internal/ui/model/status.go @@ -1,6 +1,7 @@ package model import ( + "strings" "time" "charm.land/bubbles/v2/help" @@ -99,9 +100,10 @@ func (s *Status) Draw(scr uv.Screen, area uv.Rectangle) { } ind := indStyle.String() - messageWidth := area.Dx() - lipgloss.Width(ind) + messageWidth := max(0, area.Dx()-lipgloss.Width(ind)-msgStyle.GetHorizontalPadding()) msg := ansi.Truncate(s.msg.Msg, messageWidth, "…") - info := msgStyle.Width(messageWidth).Render(msg) + msg += strings.Repeat(" ", max(0, messageWidth-lipgloss.Width(msg))) + info := msgStyle.Render(msg) // Draw the info message over the help view uv.NewStyledString(ind+info).Draw(scr, area)