on main help sign in
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.

commit82a34c708a0902c15eb984293415900c823a4784 authorAyman Bagabas <ayman.bagabas@gmail.com> dateTue 22 Jul 2025, 09:57 (1 year ago) parenta8ec22f
1 file changed+2−2
internal/tui/components/chat/messages/renderer.go+2−2
internal/tui/components/chat/messages/renderer.go+2−2
@@ -124,9 +124,9 @@ func (br baseRenderer) makeNestedHeader(v *toolCallCmp, tool string, width int,
124124 } else if v.cancelled {
125125 icon = t.S().Muted.Render(styles.ToolPending)
126126 }
127− tool = t.S().Base.Foreground(t.FgHalfMuted).Render(tool) + " "
127+ tool = t.S().Base.Foreground(t.FgHalfMuted).Render(tool)
128128 prefix := fmt.Sprintf("%s %s ", icon, tool)
129− return prefix + renderParamList(true, width-lipgloss.Width(tool), params...)
129+ return prefix + renderParamList(true, width-lipgloss.Width(prefix), params...)
130130}
131131
132132// makeHeader builds "<Tool>: param (key=value)" and truncates as needed.