on main help sign in
chore(styles): create specific styles for image loading indicators
commitd6312f4f3d2813fc0eac06b00ca3a4932cb5a15d authorChristian Rocha <christian@rocha.is> dateSat 21 Feb 2026, 09:58 (8 months ago) parente3376ad
2 files changed+19−6
internal/ui/chat/tools.go+7−6 internal/ui/styles/styles.go+12
internal/ui/chat/tools.go+7−6
@@ -623,12 +623,13 @@ func toolOutputImageContent(sty *styles.Styles, data, mediaType string) string {
623623 dataSize := len(data) * 3 / 4
624624 sizeStr := formatSize(dataSize)
625625
626− loaded := sty.Base.Foreground(sty.Green).Render("Loaded")
627− arrow := sty.Base.Foreground(sty.GreenDark).Render("→")
628− typeStyled := sty.Base.Render(mediaType)
629− sizeStyled := sty.Subtle.Render(sizeStr)
630−
631− return sty.Tool.Body.Render(fmt.Sprintf("%s %s %s %s", loaded, arrow, typeStyled, sizeStyled))
626+ return sty.Tool.Body.Render(fmt.Sprintf(
627+ "%s %s %s %s",
628+ sty.Tool.ResourceLoadedText.String(),
629+ sty.Tool.ResourceLoadedIndicator.String(),
630+ sty.Base.Render(mediaType),
631+ sty.Subtle.Render(sizeStr),
632+ ))
632633}
633634
634635// getDigits returns the number of digits in a number.
internal/ui/styles/styles.go+12
@@ -321,6 +321,12 @@ type Styles struct {
321321 MCPName lipgloss.Style // The mcp name
322322 MCPToolName lipgloss.Style // The mcp tool name
323323 MCPArrow lipgloss.Style // The mcp arrow icon
324+
325+ // Images and external resources
326+ ResourceLoadedText lipgloss.Style
327+ ResourceLoadedIndicator lipgloss.Style
328+ ResourceSize lipgloss.Style
329+ MediaType lipgloss.Style
324330 }
325331
326332 // Dialog styles
@@ -1168,6 +1174,12 @@ func DefaultStyles() Styles {
11681174 s.Tool.MCPToolName = base.Foreground(blueDark)
11691175 s.Tool.MCPArrow = base.Foreground(blue).SetString(ArrowRightIcon)
11701176
1177+ // Loading indicators for images, skills
1178+ s.Tool.ResourceLoadedText = base.Foreground(green).SetString("Loaded")
1179+ s.Tool.ResourceLoadedIndicator = base.Foreground(greenDark).SetString(ArrowRightIcon)
1180+ s.Tool.MediaType = base
1181+ s.Tool.ResourceSize = base.Foreground(fgMuted)
1182+
11711183 // Buttons
11721184 s.ButtonFocus = lipgloss.NewStyle().Foreground(white).Background(secondary)
11731185 s.ButtonBlur = s.Base.Background(bgSubtle)