tui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package tui provides Bubble Tea based TUI components for image compression progress display.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchCompleteMsg

type BatchCompleteMsg struct {
	Results []processor.BatchResult
}

BatchCompleteMsg notifies the TUI that batch processing has completed.

type BatchErrorMsg

type BatchErrorMsg struct {
	Err error
}

BatchErrorMsg notifies the TUI that an overall batch processing error occurred.

type BatchResultInfo

type BatchResultInfo struct {
	InputPath string
	Error     string
}

BatchResultInfo holds summary info about a failed batch result for display.

type BatchStartMsg

type BatchStartMsg struct {
	TotalFiles int
}

BatchStartMsg notifies the TUI that batch processing has started.

type Model

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

Model is the Bubble Tea model for the progress bar TUI.

func NewModel

func NewModel() Model

NewModel creates a new TUI model with default settings.

func (Model) Completed

func (m Model) Completed() int

Completed returns the number of successfully completed files.

func (Model) CurrentFile

func (m Model) CurrentFile() string

CurrentFile returns the currently processing file name.

func (Model) Err

func (m Model) Err() error

Err returns the error if the model is in error state.

func (Model) Failed

func (m Model) Failed() int

Failed returns the number of failed files.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) State

func (m Model) State() State

State returns the current state of the model.

func (Model) TotalFiles

func (m Model) TotalFiles() int

TotalFiles returns the total number of files to process.

func (Model) Update

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

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

type ProgressMsg

type ProgressMsg struct {
	Progress processor.Progress
}

ProgressMsg wraps processor.Progress for Bubble Tea message passing.

type State

type State int

State represents the TUI state.

const (
	// StateWaiting indicates the TUI is waiting for processing to start.
	StateWaiting State = iota
	// StateProcessing indicates batch processing is in progress.
	StateProcessing
	// StateCompleted indicates batch processing has completed.
	StateCompleted
	// StateError indicates an error occurred during batch processing.
	StateError
)

Jump to

Keyboard shortcuts

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