@@ -50,16 +50,16 @@ type Compactable interface {
50 SetCompact(compact bool)
50 SetCompact(compact bool)
53−// IsSpinningState contains the state passed to IsSpinningFn for custom spinning logic.
53+// SpinningState contains the state passed to SpinningFunc for custom spinning logic.
54−type IsSpinningState struct {
54+type SpinningState struct {
55 ToolCall message.ToolCall
55 ToolCall message.ToolCall
56 Result *message.ToolResult
56 Result *message.ToolResult
57 Canceled bool
57 Canceled bool
60−// IsSpinningFn is a function type for custom spinning logic.
60+// SpinningFunc is a function type for custom spinning logic.
61// Returns true if the tool should show the spinning animation.
61// Returns true if the tool should show the spinning animation.
62−type IsSpinningFn func(state IsSpinningState) bool
62+type SpinningFunc func(state SpinningState) bool
64// DefaultToolRenderContext implements the default [ToolRenderer] interface.
64// DefaultToolRenderContext implements the default [ToolRenderer] interface.
65type DefaultToolRenderContext struct{}
65type DefaultToolRenderContext struct{}
@@ -130,9 +130,9 @@ type baseToolMessageItem struct {
130 hasCappedWidth bool
130 hasCappedWidth bool
131 // isCompact indicates this tool should render in compact mode.
131 // isCompact indicates this tool should render in compact mode.
132 isCompact bool
132 isCompact bool
133− // isSpinningFn allows tools to override the default spinning logic.
133+ // spinningFunc allows tools to override the default spinning logic.
134 // If nil, uses the default: !toolCall.Finished && !canceled.
134 // If nil, uses the default: !toolCall.Finished && !canceled.
135− isSpinningFn IsSpinningFn
135+ spinningFunc SpinningFunc
137 sty *styles.Styles
137 sty *styles.Styles
138 anim *anim.Anim
138 anim *anim.Anim
@@ -349,8 +349,8 @@ func (t *baseToolMessageItem) SetPermissionGranted(granted bool) {
350// isSpinning returns true if the tool should show animation.
350// isSpinning returns true if the tool should show animation.
351func (t *baseToolMessageItem) isSpinning() bool {
351func (t *baseToolMessageItem) isSpinning() bool {
352− if t.isSpinningFn != nil {
352+ if t.spinningFunc != nil {
353− return t.isSpinningFn(IsSpinningState{
353+ return t.spinningFunc(SpinningState{
354 ToolCall: t.toolCall,
354 ToolCall: t.toolCall,
355 Result: t.result,
355 Result: t.result,
356 Canceled: t.canceled,
356 Canceled: t.canceled,
@@ -359,9 +359,9 @@ func (t *baseToolMessageItem) isSpinning() bool {
359 return !t.toolCall.Finished && !t.canceled
359 return !t.toolCall.Finished && !t.canceled
362−// SetIsSpinningFn sets a custom function to determine if the tool should spin.
362+// SetSpinningFunc sets a custom function to determine if the tool should spin.
363−func (t *baseToolMessageItem) SetIsSpinningFn(fn IsSpinningFn) {
363+func (t *baseToolMessageItem) SetSpinningFunc(fn SpinningFunc) {
364− t.isSpinningFn = fn
364+ t.spinningFunc = fn
367// ToggleExpanded toggles the expanded state of the thinking box.
367// ToggleExpanded toggles the expanded state of the thinking box.