tui

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSlowThreshold = 10 * time.Second

DefaultSlowThreshold is the fallback threshold used when none is specified.

View Source
const MaxOutputLines = 6

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {

	// Terminal state
	TerminalWidth  int
	TerminalHeight int

	SlowThreshold time.Duration

	// Replay state
	ReplayRate float64

	// OnInterrupt, if set, is invoked when the user presses ctrl+c (or
	// otherwise interrupts the TUI). It runs before tea.Quit is returned so
	// callers can forward the interrupt (e.g. to a child go test process)
	// while bubbletea still has control of the terminal and will restore it
	// cleanly. Must be safe to call from a bubbletea goroutine and may be
	// invoked more than once across a program's lifetime.
	OnInterrupt func()

	NonTestOutput []string
	// contains filtered or unexported fields
}

Model represents the TUI state for the enhanced hierarchical test output display.

The Model implements the Bubbletea Model interface. It is a passive view that renders the state from the collector.

func NewModel

func NewModel(replayMode bool, replayRate float64, collector *results.Collector) *Model

NewModel creates a new TUI model

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init initializes the model and returns the initial command

func (*Model) String

func (m *Model) String() string

String renders the TUI (for backward compatibility)

func (*Model) Update

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

Update handles messages

func (*Model) View

func (m *Model) View() tea.View

View renders the TUI

type QuitMsg

type QuitMsg struct{}

QuitMsg signals the TUI to quit cleanly, rendering an empty final frame so the terminal is left clean for summary output.

type RepaintMsg

type RepaintMsg struct{}

RepaintMsg forces a redraw

type TickMsg

type TickMsg struct{}

TickMsg is used for timer updates to refresh elapsed times

Jump to

Keyboard shortcuts

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