Documentation
¶
Index ¶
- Variables
- func GetBranchIcon() string
- func GetPathIcon() string
- func GetStatusIcon(isCurrent bool) string
- func GetTTYFiles(capability TTYCapability) (*os.File, *os.File, func(), error)
- func InitializeTheme(cfg *config.Config)
- func SimpleSelectWorktree(worktrees []git.Worktree, output *os.File, input *os.File) (*git.Worktree, error)
- func SmartSelectWorktree(worktrees []git.Worktree) (*git.Worktree, error)
- type ConfirmModel
- type ConfirmResult
- type FieldDependency
- type FileInterface
- type InputModel
- type InputResult
- type KeyboardSelector
- type SelectionResult
- type SelectorModel
- type TTYCapability
Constants ¶
This section is empty.
Variables ¶
var ( Primary = lipgloss.Color("#7C3AED") // Purple Secondary = lipgloss.Color("#06B6D4") // Cyan Success = lipgloss.Color("#10B981") // Green Warning = lipgloss.Color("#F59E0B") // Yellow Error = lipgloss.Color("#EF4444") // Red Muted = lipgloss.Color("#6B7280") // Gray Text = lipgloss.Color("#F9FAFB") // Light )
Color palette (default values, can be overridden by config)
var ( TitleStyle = lipgloss.NewStyle(). Foreground(Primary). Bold(true). Padding(0, 1) SubtitleStyle = lipgloss.NewStyle(). Foreground(Secondary). Italic(true) SelectedItemStyle = lipgloss.NewStyle(). Foreground(Text). Background(Primary). Bold(true). Padding(0, 1) NormalItemStyle = lipgloss.NewStyle(). Foreground(Text). Padding(0, 1) CurrentItemStyle = lipgloss.NewStyle(). Foreground(Success). Bold(true). Padding(0, 1) HelpStyle = lipgloss.NewStyle(). Foreground(Muted). Italic(true). Margin(1, 0) ErrorStyle = lipgloss.NewStyle(). Foreground(Error). Bold(true). Padding(0, 1) SuccessStyle = lipgloss.NewStyle(). Foreground(Success). Bold(true). Padding(0, 1) WarningStyle = lipgloss.NewStyle(). Foreground(Warning). Bold(true). Padding(0, 1) NormalStyle = lipgloss.NewStyle(). Foreground(Text) BorderStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(Primary). Padding(1, 2) InputStyle = lipgloss.NewStyle(). Foreground(Text). Background(lipgloss.Color("#374151")). Padding(0, 1). Margin(0, 1) )
Base styles
Functions ¶
func GetStatusIcon ¶
GetStatusIcon returns an icon based on status
func GetTTYFiles ¶
GetTTYFiles returns appropriate input/output files based on capability
func InitializeTheme ¶
InitializeTheme initializes the theme from config
Types ¶
type ConfirmModel ¶
type ConfirmModel struct {
// contains filtered or unexported fields
}
func NewConfirm ¶
func NewConfirm(title, message string) ConfirmModel
func (ConfirmModel) GetResult ¶
func (m ConfirmModel) GetResult() ConfirmResult
func (ConfirmModel) Init ¶
func (m ConfirmModel) Init() tea.Cmd
func (ConfirmModel) View ¶
func (m ConfirmModel) View() string
type ConfirmResult ¶
type FieldDependency ¶
type FieldDependency struct {
SourceIndex int // Index of the source field
TargetIndex int // Index of the target field
UpdateFunc func(sourceValue string) string // Function to compute target value from source
}
FieldDependency defines a dependency relationship between input fields
type FileInterface ¶
type FileInterface interface {
io.ReadWriter
Fd() uintptr
}
FileInterface defines the interface for file operations needed by the selector
type InputModel ¶
type InputModel struct {
// contains filtered or unexported fields
}
func NewInputWithDependencies ¶
func NewInputWithDependencies(title string, prompts []string, defaults []string, dependencies []FieldDependency) InputModel
func NewWorktreeInput ¶
func NewWorktreeInput(title string, worktreePathPrefix string) InputModel
NewWorktreeInput creates an input dialog for new worktree with auto-path generation
func (InputModel) GetResult ¶
func (m InputModel) GetResult() InputResult
func (InputModel) Init ¶
func (m InputModel) Init() tea.Cmd
func (InputModel) View ¶
func (m InputModel) View() string
type InputResult ¶
type KeyboardSelector ¶
type KeyboardSelector struct {
// contains filtered or unexported fields
}
KeyboardSelector provides arrow key navigation without full TUI
func NewKeyboardSelector ¶
func NewKeyboardSelector(worktrees []git.Worktree, input, output *os.File) *KeyboardSelector
NewKeyboardSelector creates a new keyboard-based selector
type SelectionResult ¶
type SelectorModel ¶
type SelectorModel struct {
// contains filtered or unexported fields
}
func NewSelector ¶
func NewSelector(worktrees []git.Worktree, title, action string, allowDelete bool) SelectorModel
func (SelectorModel) GetResult ¶
func (m SelectorModel) GetResult() SelectionResult
func (SelectorModel) Init ¶
func (m SelectorModel) Init() tea.Cmd
func (SelectorModel) View ¶
func (m SelectorModel) View() string
type TTYCapability ¶
type TTYCapability int
TTYCapability represents the level of TTY control available
const ( NoTTYControl TTYCapability = iota BasicTTYControl FullTTYControl )
func DetectTTYCapability ¶
func DetectTTYCapability() TTYCapability
DetectTTYCapability determines what level of TTY control is available