Documentation
¶
Overview ¶
Package tui provides terminal UI components for interactive displays.
This package contains reusable terminal UI elements for displaying repository status, progress, and interactive selections.
Components ¶
- Status tables for bulk operations
- Progress indicators
- Interactive selection menus
- Color-coded output formatters
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // HeaderStyle is used for the main header bar. HeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(lipgloss.Color("15")). Background(lipgloss.Color("62")). Padding(0, 1) // CursorStyle highlights the currently selected line. CursorStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("0")). Background(lipgloss.Color("6")). Bold(true) // UnhealthyStyle is used for repositories with health issues. UnhealthyStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("9")) // DirtyStyle is used for repositories with uncommitted changes. DirtyStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("11")) // SubtleStyle is used for less important information (footer, scroll indicators). SubtleStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("240")) )
Pre-defined styles for consistent UI appearance.
Functions ¶
func FormatHealthIcon ¶
func FormatHealthIcon(status reposync.HealthStatus) string
FormatHealthIcon returns an icon representing the health status.
func FormatRepoName ¶
FormatRepoName extracts a display name from a RepoSpec.
func FormatStatusText ¶
func FormatStatusText(health reposync.RepoHealth) string
FormatStatusText returns a textual description of repository status.
Types ¶
type FilterType ¶
type FilterType string
FilterType represents the type of filter applied.
const ( FilterNone FilterType = "" FilterDirty FilterType = "dirty" // Show only dirty repos FilterClean FilterType = "clean" // Show only clean repos FilterAhead FilterType = "ahead" // Show only repos ahead of remote FilterAll FilterType = "all" // Show all (reset filter) )
FilterType values control which repositories are shown in the status TUI.
type StatusModel ¶
type StatusModel struct {
// contains filtered or unexported fields
}
StatusModel represents the TUI state for repository status display.
func NewStatusModel ¶
func NewStatusModel(repos []reposync.RepoHealth) StatusModel
NewStatusModel creates a new status TUI model.
func (StatusModel) GetAction ¶
func (m StatusModel) GetAction() string
GetAction returns the pending action (sync, pull, fetch) or empty string.
func (StatusModel) GetSelectedPaths ¶
func (m StatusModel) GetSelectedPaths() []string
GetSelectedPaths returns the list of selected repository paths.
func (StatusModel) Init ¶
func (m StatusModel) Init() tea.Cmd
Init initializes the model (required by Bubble Tea).