From 82a34c708a0902c15eb984293415900c823a4784 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Tue, 22 Jul 2025 09:57:58 -0400 Subject: [PATCH] fix(tui): renderer: line wrapping in chat This fixes an issue where the tool call in nested headers don't wrap correctly when the tool name is long. The tool name is now rendered without an extra trailing space, and the parameter list is rendered with the correct width calculation. --- internal/tui/components/chat/messages/renderer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/tui/components/chat/messages/renderer.go b/internal/tui/components/chat/messages/renderer.go index 898780495242819e42257ba72d90a02e10e1cd71..4483b4ed2a9d2bf0b87a6eeae4565049edfa303e 100644 --- a/internal/tui/components/chat/messages/renderer.go +++ b/internal/tui/components/chat/messages/renderer.go @@ -124,9 +124,9 @@ func (br baseRenderer) makeNestedHeader(v *toolCallCmp, tool string, width int, } else if v.cancelled { icon = t.S().Muted.Render(styles.ToolPending) } - tool = t.S().Base.Foreground(t.FgHalfMuted).Render(tool) + " " + tool = t.S().Base.Foreground(t.FgHalfMuted).Render(tool) prefix := fmt.Sprintf("%s %s ", icon, tool) - return prefix + renderParamList(true, width-lipgloss.Width(tool), params...) + return prefix + renderParamList(true, width-lipgloss.Width(prefix), params...) } // makeHeader builds ": param (key=value)" and truncates as needed.