ui

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package ui renders the live terminal dashboard. It owns a flat view-model (Row/Event) so it never depends on the orchestrator's result/options types; the caller adapts its events into ui.Event. Everything here is presentation: the renderers are pure string functions over Row, and Renderer is the only piece that touches the terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyEvent

func ApplyEvent(row *Row, ev Event)

ApplyEvent folds an event into a row's display state.

func MethodLabel

func MethodLabel(method string) string

MethodLabel maps an update method kind to its short display label.

Types

type Event

type Event struct {
	Index    int
	Phase    string
	Status   string
	Reason   string
	Method   string
	Before   string
	After    string
	Duration time.Duration
	Time     time.Time
	Show     bool
}

Event is a flat update-lifecycle event the dashboard consumes. The caller adapts its richer event type into this view-model.

type Renderer

type Renderer struct {
	Out *os.File

	UseColor   bool
	UseUnicode bool
	Width      int
	// contains filtered or unexported fields
}

Renderer draws frames to a terminal, tracking how many lines the last frame occupied so it can redraw in place.

func NewRenderer

func NewRenderer(out *os.File) *Renderer

NewRenderer builds a Renderer with capabilities detected from the environment.

func (*Renderer) Draw

func (r *Renderer) Draw(content string)

Draw redraws the frame in place over the previous one.

func (*Renderer) HideCursor added in v0.8.0

func (r *Renderer) HideCursor()

HideCursor hides the terminal cursor for the duration of a live render.

func (*Renderer) RenderFrame

func (r *Renderer) RenderFrame(rows []Row, nameWidth int, start time.Time, explain bool, detected, total int) string

RenderFrame builds one dashboard frame: a boot line until the first visible row is detected, then the full dashboard.

func (*Renderer) ShowCursor added in v0.8.0

func (r *Renderer) ShowCursor()

ShowCursor restores the terminal cursor after a live render.

type Row

type Row struct {
	Name     string
	Status   string
	Before   string
	After    string
	Reason   string
	Method   string
	Start    time.Time
	Duration time.Duration
	Visible  bool
}

Row is one agent's line in the dashboard.

Jump to

Keyboard shortcuts

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