mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 11:14:23 +01:00
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>
This commit is contained in:
@@ -221,11 +221,15 @@ func (m *messagesCmp) renderMessageWithToolCall(content string, tools []message.
|
||||
Bold(true).
|
||||
Foreground(styles.Green).
|
||||
Render(fmt.Sprintf("%s Result", styles.CheckIcon))
|
||||
|
||||
// Use the same style for both header and border if it's an error
|
||||
borderColor := styles.Green
|
||||
if result.IsError {
|
||||
resultHeader = lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(styles.Red).
|
||||
Render(fmt.Sprintf("%s Error", styles.ErrorIcon))
|
||||
borderColor = styles.Red
|
||||
}
|
||||
|
||||
truncate := 200
|
||||
@@ -235,7 +239,7 @@ func (m *messagesCmp) renderMessageWithToolCall(content string, tools []message.
|
||||
}
|
||||
|
||||
resultContent := lipgloss.JoinVertical(lipgloss.Left, resultHeader, content)
|
||||
return toolResultStyle.Render(resultContent)
|
||||
return toolResultStyle.BorderForeground(borderColor).Render(resultContent)
|
||||
}
|
||||
|
||||
connector := connectorStyle.Render("└─> Tool Calls:")
|
||||
|
||||
Reference in New Issue
Block a user