Change summary
internal/ui/chat/tools.go | 13 +++++++------
internal/ui/styles/styles.go | 12 ++++++++++++
2 files changed, 19 insertions(+), 6 deletions(-)
Detailed changes
@@ -623,12 +623,13 @@ func toolOutputImageContent(sty *styles.Styles, data, mediaType string) string {
dataSize := len(data) * 3 / 4
sizeStr := formatSize(dataSize)
- loaded := sty.Base.Foreground(sty.Green).Render("Loaded")
- arrow := sty.Base.Foreground(sty.GreenDark).Render("→")
- typeStyled := sty.Base.Render(mediaType)
- sizeStyled := sty.Subtle.Render(sizeStr)
-
- return sty.Tool.Body.Render(fmt.Sprintf("%s %s %s %s", loaded, arrow, typeStyled, sizeStyled))
+ return sty.Tool.Body.Render(fmt.Sprintf(
+ "%s %s %s %s",
+ sty.Tool.ResourceLoadedText.String(),
+ sty.Tool.ResourceLoadedIndicator.String(),
+ sty.Base.Render(mediaType),
+ sty.Subtle.Render(sizeStr),
+ ))
}
// getDigits returns the number of digits in a number.
@@ -321,6 +321,12 @@ type Styles struct {
MCPName lipgloss.Style // The mcp name
MCPToolName lipgloss.Style // The mcp tool name
MCPArrow lipgloss.Style // The mcp arrow icon
+
+ // Images and external resources
+ ResourceLoadedText lipgloss.Style
+ ResourceLoadedIndicator lipgloss.Style
+ ResourceSize lipgloss.Style
+ MediaType lipgloss.Style
}
// Dialog styles
@@ -1168,6 +1174,12 @@ func DefaultStyles() Styles {
s.Tool.MCPToolName = base.Foreground(blueDark)
s.Tool.MCPArrow = base.Foreground(blue).SetString(ArrowRightIcon)
+ // Loading indicators for images, skills
+ s.Tool.ResourceLoadedText = base.Foreground(green).SetString("Loaded")
+ s.Tool.ResourceLoadedIndicator = base.Foreground(greenDark).SetString(ArrowRightIcon)
+ s.Tool.MediaType = base
+ s.Tool.ResourceSize = base.Foreground(fgMuted)
+
// Buttons
s.ButtonFocus = lipgloss.NewStyle().Foreground(white).Background(secondary)
s.ButtonBlur = s.Base.Background(bgSubtle)