mark

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TickCmd

func TickCmd() tea.Cmd

TickCmd returns the next-tick command. One interval for every state: waiting goes slower by dividing its frame index, not its clock, so all marks on screen share one ticker.

Types

type Model

type Model struct {
	Theme theme.Theme
	Tier  theme.Tier
	// contains filtered or unexported fields
}

Model is the mark plus its tick. The tick only runs while the state animates, mirroring statusline's Start/Stop bracketing.

func New

func New(t theme.Theme, tier theme.Tier, s State) Model

New returns a Model in state s. A static state needs no ticker.

func (Model) Glyph

func (m Model) Glyph() rune

Glyph is the mark's lead cell, unstyled.

func (*Model) SetState

func (m *Model) SetState(s State)

SetState changes the state, resetting the frame so a rotation never resumes mid-cycle from a stale position.

func (Model) State

func (m Model) State() State

State reports the current state.

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

Update advances the frame on a tick. Static states ignore ticks: their glyph never changes, so no clock runs for them.

func (Model) View

func (m Model) View() string

View renders the mark: single brand glyph for idle/done/failed, and an animated 3-cell colorful aurora wave for active states.

type State

type State int

State is what the mark says about the turn.

const (
	Idle State = iota
	Waiting
	Thinking
	Streaming
	Running
	Pending
	Failed
	Done
)

func (State) Animated

func (s State) Animated() bool

Animated reports whether the state moves. Static means "not working".

func (State) Word

func (s State) Word() string

Word is the state as a word, for screen-reader output: the mock's rule is that a screen reader gets the state word only, never the glyph or the animation ("thinking, 4.2 seconds, escape to cancel").

type TickMsg

type TickMsg struct{}

TickMsg advances an animated mark's frame.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL