Documentation
¶
Overview ¶
Package animation provides centralized animation tick management for the TUI. All animated components (spinners, fades, etc.) share a single tick stream to avoid tick storms and ensure synchronized animations.
Thread safety: All exported functions are safe for concurrent use, though the typical usage pattern is single-threaded via Bubble Tea's Update loop.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasActive ¶
func HasActive() bool
HasActive returns true if any animations are currently active.
func Register ¶
func Register()
Register increments the active animation count. Call this when an animation starts.
func StartTick ¶
StartTick starts the global animation tick if any animations are active. Call this after processing a TickMsg to continue the tick stream.
func StartTickIfFirst ¶
StartTickIfFirst registers an animation and starts the tick if this is the first. This is atomic: no race between checking and registering. Returns the tick command if the tick stream was started, nil otherwise.
func Unregister ¶
func Unregister()
Unregister decrements the active animation count. Call this when an animation stops.
Types ¶
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
Coordinator manages a single tick stream for all animations. It tracks active animations and only generates ticks when at least one is active.