Documentation
¶
Overview ¶
Package ui provides terminal UI components for the work CLI. All visual output targets stderr to keep stdout clean for shell eval.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner provides an animated terminal spinner that writes to stderr. A nil *Spinner is safe to call methods on — all methods are no-ops, which makes it easy to suppress spinners for sh- commands.
func NewSpinner ¶
NewSpinner creates a spinner that animates on stderr. If suppressed is true, returns nil (all methods become no-ops). Use suppressed=true for sh- commands where stdout must stay clean.
func (*Spinner) ProgressFunc ¶
ProgressFunc returns a function compatible with cache.ProgressFunc that updates the spinner's message. Returns nil if the spinner is nil.
func (*Spinner) Start ¶
func (s *Spinner) Start()
Start begins the spinner animation. It blocks until Stop is called, so launch it in a goroutine:
go spinner.Start()
func (*Spinner) Stop ¶
func (s *Spinner) Stop()
Stop halts the spinner and waits for the animation loop to exit. The spinner clears itself from the terminal on stop.
func (*Spinner) UpdateMessage ¶
UpdateMessage changes the spinner's status text. Safe for concurrent use from multiple goroutines.