Documentation
¶
Overview ¶
Package components provides reusable TUI widgets for revoco.
Package components contains reusable Bubble Tea UI widgets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilePicker ¶
type FilePicker struct {
Mode PickerMode
Selected string // Single selection (ModeDir/ModeFile)
MultiSelected []string // Multiple selections (ModeMultiFile)
Done bool
Err error
// AllowedExts filters selectable files in ModeFile/ModeMultiFile (e.g. []string{".zip"}).
// Empty means all files are allowed.
AllowedExts []string
// contains filtered or unexported fields
}
FilePicker is a keyboard-driven file/directory picker.
In ModeDir the user navigates with Enter and confirms the current directory with Space. In ModeFile the user navigates into directories with Enter and selects a file with Enter. In ModeMultiFile, Space toggles selection and Enter confirms all selected files.
func NewFilePicker ¶
func NewFilePicker(mode PickerMode) FilePicker
NewFilePicker creates a FilePicker starting in the user's home directory.
func (FilePicker) Init ¶
func (p FilePicker) Init() tea.Cmd
Init returns the command that reads the initial directory.
func (*FilePicker) SetHeight ¶
func (p *FilePicker) SetHeight(h int)
SetHeight sets the visible row count.
func (FilePicker) Update ¶
func (p FilePicker) Update(msg tea.Msg) (FilePicker, tea.Cmd)
Update processes messages.
type LogPanel ¶
type LogPanel struct {
Width int
Height int
MaxLines int
// contains filtered or unexported fields
}
LogPanel is a scrollable log view backed by bubbles/viewport with auto-follow when at the bottom.
func NewLogPanel ¶
NewLogPanel creates a LogPanel with the given dimensions and max line capacity.
func (*LogPanel) Append ¶
Append adds a line, evicting the oldest if over capacity, and refreshes content.
type PhaseBar ¶
type PhaseBar struct {
Label string
Done int
Total int
Width int
Active bool
Finished bool
// contains filtered or unexported fields
}
PhaseBar renders a progress bar for a single pipeline phase using bubbles/progress.ViewAs for smooth animated fills.
func (*PhaseBar) Init ¶
func (p *PhaseBar) Init() tea.Cmd
Init should be called once on the PhaseBar when it becomes active. Returns a tea.Cmd that drives the spinner animation.
func (*PhaseBar) UpdateSpinner ¶
func (p *PhaseBar) UpdateSpinner(msg tea.Msg) tea.Cmd
UpdateSpinner advances the spinner state. Call from the parent Update on spinner.TickMsg.
type PickerMode ¶
type PickerMode int
PickerMode controls what the filepicker allows the user to select.
const ( // ModeDir allows directory selection. Enter navigates into directories, // Space confirms the current directory as the selection. ModeDir PickerMode = iota // ModeFile allows file selection. Enter navigates into directories or // selects the highlighted file. ModeFile // ModeMultiFile allows selecting multiple files. Space toggles selection, // Enter confirms all selections. ModeMultiFile )
type Sparkline ¶
type Sparkline struct {
// Width is the number of columns the sparkline should fill.
Width int
// Label is displayed after the graph (e.g. "MB/s").
Label string
// contains filtered or unexported fields
}
Sparkline tracks a rolling window of float64 samples and renders an ASCII throughput graph using Unicode block characters.
func NewSparkline ¶
NewSparkline creates a Sparkline with the given width and label.