chore: integrate overhauled spinner

Christian Rocha created

Change summary

internal/tui/components/chat/messages/messages.go | 5 ++---
internal/tui/components/chat/messages/tool.go     | 8 ++++----
internal/tui/components/core/list/list.go         | 3 +--
3 files changed, 7 insertions(+), 9 deletions(-)

Detailed changes

internal/tui/components/chat/messages/messages.go 🔗

@@ -6,7 +6,6 @@ import (
 	"strings"
 	"time"
 
-	"github.com/charmbracelet/bubbles/v2/spinner"
 	tea "github.com/charmbracelet/bubbletea/v2"
 	"github.com/charmbracelet/lipgloss/v2"
 
@@ -52,7 +51,7 @@ var focusedMessageBorder = lipgloss.Border{
 func NewMessageCmp(msg message.Message) MessageCmp {
 	m := &messageCmp{
 		message: msg,
-		anim:    anim.New(15, ""),
+		anim:    anim.New(15, "", styles.CurrentTheme()),
 	}
 	return m
 }
@@ -71,7 +70,7 @@ func (m *messageCmp) Init() tea.Cmd {
 // Manages animation updates for spinning messages and stops animation when appropriate.
 func (m *messageCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 	switch msg := msg.(type) {
-	case anim.ColorCycleMsg, anim.StepCharsMsg, spinner.TickMsg:
+	case anim.StepMsg:
 		m.spinning = m.shouldSpin()
 		if m.spinning {
 			u, cmd := m.anim.Update(msg)

internal/tui/components/chat/messages/tool.go 🔗

@@ -3,7 +3,6 @@ package messages
 import (
 	"fmt"
 
-	"github.com/charmbracelet/bubbles/v2/spinner"
 	tea "github.com/charmbracelet/bubbletea/v2"
 	"github.com/charmbracelet/crush/internal/message"
 	"github.com/charmbracelet/crush/internal/tui/components/anim"
@@ -91,9 +90,10 @@ func NewToolCallCmp(parentMessageID string, tc message.ToolCall, opts ...ToolCal
 	for _, opt := range opts {
 		opt(m)
 	}
-	m.anim = anim.New(15, "Working")
+	t := styles.CurrentTheme()
+	m.anim = anim.New(15, "Working", t)
 	if m.isNested {
-		m.anim = anim.New(10, "")
+		m.anim = anim.New(10, "", t)
 	}
 	return m
 }
@@ -112,7 +112,7 @@ func (m *toolCallCmp) Init() tea.Cmd {
 // Manages animation updates for pending tool calls.
 func (m *toolCallCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 	switch msg := msg.(type) {
-	case anim.ColorCycleMsg, anim.StepCharsMsg, spinner.TickMsg:
+	case anim.StepMsg:
 		var cmds []tea.Cmd
 		for i, nested := range m.nestedToolCalls {
 			if nested.Spinning() {

internal/tui/components/core/list/list.go 🔗

@@ -7,7 +7,6 @@ import (
 
 	"github.com/charmbracelet/bubbles/v2/help"
 	"github.com/charmbracelet/bubbles/v2/key"
-	"github.com/charmbracelet/bubbles/v2/spinner"
 	"github.com/charmbracelet/bubbles/v2/textinput"
 	tea "github.com/charmbracelet/bubbletea/v2"
 	"github.com/charmbracelet/crush/internal/tui/components/anim"
@@ -271,7 +270,7 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 	switch msg := msg.(type) {
 	case tea.KeyPressMsg:
 		return m.handleKeyPress(msg)
-	case anim.ColorCycleMsg, anim.StepCharsMsg, spinner.TickMsg:
+	case anim.StepMsg:
 		return m.handleAnimationMsg(msg)
 	}
 	if m.selectionState.isValidIndex(len(m.filteredItems)) {