on main help sign in
Make tool error results visually distinct with red border

- Change tool result border color to red when displaying errors - Keep green border for successful results - Improve visual distinction between error and success states ๐Ÿค– Generated with termai Co-Authored-By: termai <noreply@termai.io>

commit8f8b403bbcb171fae525e7239f2f7b9d46c78b77 authorKujtim Hoxha <kujtimii.h@gmail.com> dateFri 4 Apr 2025, 15:08 (2 years ago) parentfa5840c
1 file changed+5โˆ’1
internal/tui/components/repl/messages.go+5โˆ’1
internal/tui/components/repl/messages.go+5โˆ’1
@@ -221,11 +221,15 @@ func (m *messagesCmp) renderMessageWithToolCall(content string, tools []message.
221221 Bold(true).
222222 Foreground(styles.Green).
223223 Render(fmt.Sprintf("%s Result", styles.CheckIcon))
224+
225+ // Use the same style for both header and border if it's an error
226+ borderColor := styles.Green
224227 if result.IsError {
225228 resultHeader = lipgloss.NewStyle().
226229 Bold(true).
227230 Foreground(styles.Red).
228231 Render(fmt.Sprintf("%s Error", styles.ErrorIcon))
232+ borderColor = styles.Red
229233 }
230234
231235 truncate := 200
@@ -235,7 +239,7 @@ func (m *messagesCmp) renderMessageWithToolCall(content string, tools []message.
235239 }
236240
237241 resultContent := lipgloss.JoinVertical(lipgloss.Left, resultHeader, content)
238โˆ’ return toolResultStyle.Render(resultContent)
242+ return toolResultStyle.BorderForeground(borderColor).Render(resultContent)
239243 }
240244
241245 connector := connectorStyle.Render("โ””โ”€> Tool Calls:")