statusline

package
v0.1.2 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: 8 Imported by: 0

Documentation

Overview

Package statusline renders the permanent status row above the composer: the brand mark in the turn's state, the activity label, and the elapsed time while a turn is in flight, and the row is reserved (and shows the keymap hint) when it is not. The earlier inline-first "no permanent bar" decision was reversed for the cockpit: a fixed row costs nothing that moves and never reflows the transcript when it changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model owns no timer of its own beyond the spinner tick, and that tick only runs while a turn is active (Start/Stop bracket it).

func New

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

New returns an inactive Model.

func (Model) Active

func (m Model) Active() bool

Active reports whether the line draws anything.

func (*Model) ClearNotice

func (m *Model) ClearNotice()

ClearNotice removes any pending notice.

func (*Model) Notice

func (m *Model) Notice(text string)

Notice shows a one-line message until the next turn starts.

A clipboard write is the case that needs it. tea.SetClipboard emits OSC 52, which VTE and Terminal.app ignore silently, so the line states what was ATTEMPTED. It never claims the paste buffer now holds the text, because this process cannot find that out.

func (*Model) SetCost

func (m *Model) SetCost(costUSD float64)

SetCost updates the session spend displayed in the status line.

func (*Model) SetDetail

func (m *Model) SetDetail(detail string)

SetDetail sets the specific activity detail shown beside the label - wireframes-panes.md section 9's "- running <detail> 12s" shape, e.g. a tool's name and arguments. Call it after SetLabel: SetLabel itself clears detail, so a label change with no new detail (back to "thinking" once a tool call ends) never keeps showing the PREVIOUS tool's detail.

func (*Model) SetLabel

func (m *Model) SetLabel(label string)

SetLabel updates the label of an already-active turn without resetting the elapsed-time clock. The mark follows, restarting its cycle, because a new activity is a new animation even mid-turn.

func (*Model) SetSafetyMode

func (m *Model) SetSafetyMode(mode string)

SetSafetyMode updates the active safety policy label ("safe" | "auto").

func (*Model) SetTheme

func (m *Model) SetTheme(t theme.Theme, tier theme.Tier)

SetTheme re-resolves the mark's colours after a theme change.

func (*Model) Start

func (m *Model) Start(label string, now time.Time) tea.Cmd

Start arms the status line for a new turn with the given state label (e.g. "thinking", "running tool") and returns the Cmd that starts the spinner clock.

func (*Model) Stop

func (m *Model) Stop()

Stop clears the status line (turn ended or was cancelled).

func (Model) Update

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

func (Model) View

func (m Model) View(now time.Time) string

View renders the line as of now. now is a parameter rather than time.Now() so the render stays deterministic for golden tests.

type TickMsg

type TickMsg struct{}

TickMsg advances the spinner frame.

Jump to

Keyboard shortcuts

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