dash

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package dash implements the persistent TUI dashboard.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cmds []command.Descriptor) error

Run starts the dashboard TUI with the given commands. It blocks until the user quits.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the top-level bubbletea model for the dashboard.

func NewModel

func NewModel(cmds []command.Descriptor, cwd string) Model

NewModel constructs the initial dashboard model.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type Output

type Output struct {
	// contains filtered or unexported fields
}

Output is the scrollable run buffer.

func NewOutput

func NewOutput() Output

NewOutput constructs an empty Output pane.

func (*Output) AppendLine

func (o *Output) AppendLine(line string)

AppendLine appends a line to the most recent run (which must be in-flight). If there's no in-flight run, the line is dropped.

func (*Output) AppendRun

func (o *Output) AppendRun(r RunRecord)

AppendRun adds a fully-finished run in one shot. Kept for cases where we don't need streaming (e.g., synthetic test runs).

func (Output) AtBottom

func (o Output) AtBottom() bool

func (*Output) Clear

func (o *Output) Clear()

Clear empties the output pane.

func (*Output) FinishRun

func (o *Output) FinishRun(exitCode int, duration time.Duration)

FinishRun finalizes the most recent in-flight run with its exit code and duration. Writes the footer.

func (*Output) GotoBottom

func (o *Output) GotoBottom()

func (*Output) ScrollDown

func (o *Output) ScrollDown(n int)

func (*Output) ScrollUp

func (o *Output) ScrollUp(n int)

func (*Output) SetSize

func (o *Output) SetSize(w, h int)

SetSize updates viewport dimensions.

func (*Output) StartRun

func (o *Output) StartRun(r RunRecord)

StartRun begins a new in-flight run. It renders the header immediately; the footer appears on FinishRun.

func (Output) Update

func (o Output) Update(msg tea.Msg) (Output, tea.Cmd)

Update delegates to the inner viewport.

func (Output) View

func (o Output) View() string

View renders the output pane.

type Picker

type Picker struct {
	// contains filtered or unexported fields
}

Picker owns the search box and filtered result list.

func NewPicker

func NewPicker(cmds []command.Descriptor) Picker

NewPicker builds a picker over the given commands.

func (Picker) Init

func (p Picker) Init() tea.Cmd

func (Picker) Selected

func (p Picker) Selected() (command.Descriptor, int, bool)

Selected returns the currently highlighted descriptor, if any.

func (*Picker) SetSize

func (p *Picker) SetSize(w, h int)

SetSize updates the picker's drawable size (total rows including the input line).

func (Picker) Update

func (p Picker) Update(msg tea.Msg) (Picker, tea.Cmd)

func (Picker) View

func (p Picker) View() string

type Prompt

type Prompt struct {
	// contains filtered or unexported fields
}

Prompt is the widget for one placeholder. It supports three kinds: plain text input, fuzzy-filtered source, and a file picker.

func (*Prompt) SetSize

func (p *Prompt) SetSize(w, h int)

SetSize updates the prompt's drawable area.

func (*Prompt) Update

func (p *Prompt) Update(msg tea.Msg) tea.Cmd

Update handles key events and emits promptConfirmedMsg / promptCanceledMsg.

func (Prompt) View

func (p Prompt) View() string

View renders the prompt for the current placeholder.

type PromptState

type PromptState struct {
	// contains filtered or unexported fields
}

PromptState tracks a chain of placeholder resolutions for a single command.

type RunRecord

type RunRecord struct {
	Descriptor command.Descriptor
	Args       []string // resolved args
	Lines      []string // stdout/stderr lines in arrival order
	StartedAt  time.Time
	Duration   time.Duration
	ExitCode   int
	Finished   bool
}

RunRecord is a single command execution rendered in the output pane. It may be in-flight (Finished=false, lines accumulating) or completed.

type RunRequestedMsg

type RunRequestedMsg struct {
	Index int // index into the full commands slice
}

RunRequestedMsg is emitted when the user picks a command with Enter.

Jump to

Keyboard shortcuts

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