@@ -85,30 +85,31 @@ func (mv *toolModel) View() string {
8585 return mv .Render (mv .width )
8686}
8787
88- // MessageView specific methods
89-
9088// Render renders the message view content
9189func (mv * toolModel ) Render (width int ) string {
9290 msg := mv .message
9391
94- // Add spinner for pending and running tools
95- var spinnerText string
96- if msg .ToolStatus == types .ToolStatusPending || msg .ToolStatus == types .ToolStatusRunning {
97- spinnerText = " " + mv .spinner .View ()
98- }
99-
10092 // Ask the tool what's its display name
10193 team := mv .app .Team ()
10294 agent := team .Agent (msg .Sender )
10395 displayName := agent .ToolDisplayName (context .TODO (), msg .ToolCall .Function .Name )
104- content := fmt .Sprintf ("%s %s%s " , icon (msg .ToolStatus ), styles .HighlightStyle .Render (displayName ), spinnerText )
96+ content := fmt .Sprintf ("%s %s" , icon (msg .ToolStatus ), styles .HighlightStyle .Render (displayName ))
10597
10698 if msg .ToolCall .Function .Arguments != "" {
107- lines := wrapLines (msg .ToolCall .Function .Arguments , mv .width - 2 )
108- argsViewport := viewport .New (viewport .WithWidth (mv .width ), viewport .WithHeight (len (lines )))
109- argsViewport .SetContent (styles .MutedStyle .Render (strings .Join (lines , "\n " )))
110- argsViewport .GotoBottom ()
111- content += "\n " + argsViewport .View ()
99+ if msg .ToolCall .Function .Name == "search_files" {
100+ content += " " + render_search_files (msg .ToolCall )
101+ } else {
102+ lines := wrapLines (msg .ToolCall .Function .Arguments , mv .width - 2 )
103+ argsViewport := viewport .New (viewport .WithWidth (mv .width ), viewport .WithHeight (len (lines )))
104+ argsViewport .SetContent (styles .MutedStyle .Render (strings .Join (lines , "\n " )))
105+ argsViewport .GotoBottom ()
106+ content += "\n " + argsViewport .View ()
107+ }
108+ }
109+
110+ // Add spinner for pending and running tools
111+ if msg .ToolStatus == types .ToolStatusPending || msg .ToolStatus == types .ToolStatusRunning {
112+ content += " " + mv .spinner .View ()
112113 }
113114
114115 // Add tool result content if available (for completed tools with content)
0 commit comments