Documentation
¶
Index ¶
- Variables
- func Divider(width int) string
- func FileIcon(code string) string
- func FileTagStyle(code string) lipgloss.Style
- func IsTypeable(key string) bool
- func LoadBranches() tea.Cmd
- func LoadCommitFiles() tea.Cmd
- func LoadStatus() tea.Cmd
- func SanitizeInput(s string) string
- type App
- type BranchesModel
- type CommitModel
- type ConfigModel
- type InitModel
- type MenuItem
- type MenuModel
- type PushPullModel
- type Scene
- type StatusModel
- type TextInput
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ColorPrimary = lipgloss.Color("#7C6AF7") // soft purple ColorSecondary = lipgloss.Color("#5DD8A4") // mint green ColorMuted = lipgloss.Color("#6B7280") // gray ColorDanger = lipgloss.Color("#F87171") // soft red ColorWarning = lipgloss.Color("#FBBF24") // amber ColorSuccess = lipgloss.Color("#34D399") // green ColorText = lipgloss.Color("#F3F4F6") // near white ColorSubtext = lipgloss.Color("#9CA3AF") // light gray ColorBorder = lipgloss.Color("#374151") // dark gray ColorHighlight = lipgloss.Color("#1F2937") // dark bg highlight )
View Source
var ( // App container AppStyle = lipgloss.NewStyle(). Padding(1, 2) // Title banner TitleStyle = lipgloss.NewStyle(). Foreground(ColorPrimary). Bold(true). PaddingBottom(0) SubtitleStyle = lipgloss.NewStyle(). Foreground(ColorSubtext). PaddingBottom(1) // Section headers inside views SectionTitleStyle = lipgloss.NewStyle(). Foreground(ColorSecondary). Bold(true). PaddingTop(1). PaddingBottom(0) // Normal menu item MenuItemStyle = lipgloss.NewStyle(). Foreground(ColorText). PaddingLeft(2) // Selected menu item MenuItemSelectedStyle = lipgloss.NewStyle(). Foreground(ColorPrimary). Bold(true). PaddingLeft(0) // Cursor indicator CursorStyle = lipgloss.NewStyle(). Foreground(ColorPrimary). Bold(true) // Dimmed / muted text MutedStyle = lipgloss.NewStyle(). Foreground(ColorMuted) // Success message SuccessStyle = lipgloss.NewStyle(). Foreground(ColorSuccess). Bold(true) // Error / warning message ErrorStyle = lipgloss.NewStyle(). Foreground(ColorDanger). Bold(true) WarningStyle = lipgloss.NewStyle(). Foreground(ColorWarning) // Help bar at the bottom HelpStyle = lipgloss.NewStyle(). Foreground(ColorMuted). PaddingTop(1) // Box / panel PanelStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorBorder). Padding(0, 1). MarginTop(1) // Active panel PanelActiveStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorPrimary). Padding(0, 1). MarginTop(1) // File in the status list FileNameStyle = lipgloss.NewStyle(). Foreground(ColorText) FileTagStagedStyle = lipgloss.NewStyle(). Foreground(ColorSuccess). Bold(true) FileTagModifiedStyle = lipgloss.NewStyle(). Foreground(ColorWarning). Bold(true) FileTagNewStyle = lipgloss.NewStyle(). Foreground(ColorSecondary). Bold(true) FileTagDeletedStyle = lipgloss.NewStyle(). Foreground(ColorDanger). Bold(true) // Badge: current branch label BranchBadgeStyle = lipgloss.NewStyle(). Background(ColorPrimary). Foreground(lipgloss.Color("#FFFFFF")). Bold(true). Padding(0, 1). MarginRight(1) // Checkbox styles CheckboxChecked = lipgloss.NewStyle(). Foreground(ColorSuccess).Bold(true) CheckboxUnchecked = lipgloss.NewStyle(). Foreground(ColorMuted) // Text input prompt InputPromptStyle = lipgloss.NewStyle(). Foreground(ColorPrimary). Bold(true) InputHintStyle = lipgloss.NewStyle(). Foreground(ColorMuted). Italic(true) // Step indicator StepStyle = lipgloss.NewStyle(). Foreground(ColorSecondary). Bold(true) // Divider DividerStyle = lipgloss.NewStyle(). Foreground(ColorBorder) )
Functions ¶
func FileTagStyle ¶
FileTagStyle returns the appropriate style for a status code
func IsTypeable ¶
IsTypeable returns true if the key message is printable text (including paste). Rejects control keys like arrows, ctrl combos, function keys, etc.
func LoadBranches ¶
func LoadCommitFiles ¶
func LoadStatus ¶
func SanitizeInput ¶
SanitizeInput cleans pasted text by removing bracketed paste escape sequences and other terminal artifacts. Handles all forms:
- \x1b[200~text\x1b[201~ (full sequence)
- [text] (bubbletea strips the escapes, leaves brackets)
- [text (only leading bracket)
- text] (only trailing bracket)
Types ¶
type BranchesModel ¶
type BranchesModel struct {
// contains filtered or unexported fields
}
func NewBranchesModel ¶
func NewBranchesModel() BranchesModel
func (BranchesModel) Update ¶
func (m BranchesModel) Update(msg tea.Msg) (BranchesModel, tea.Cmd, bool)
func (BranchesModel) View ¶
func (m BranchesModel) View() string
type CommitModel ¶
type CommitModel struct {
// contains filtered or unexported fields
}
func NewCommitModel ¶
func NewCommitModel() CommitModel
func (CommitModel) Update ¶
func (m CommitModel) Update(msg tea.Msg) (CommitModel, tea.Cmd, bool)
func (CommitModel) View ¶
func (m CommitModel) View() string
type ConfigModel ¶
type ConfigModel struct {
// contains filtered or unexported fields
}
func NewConfigModel ¶
func NewConfigModel() ConfigModel
func (ConfigModel) Update ¶
func (m ConfigModel) Update(msg tea.Msg) (ConfigModel, tea.Cmd, bool)
func (ConfigModel) View ¶
func (m ConfigModel) View() string
type InitModel ¶
type InitModel struct {
// contains filtered or unexported fields
}
func NewInitModel ¶
func NewInitModel() InitModel
type MenuModel ¶
type MenuModel struct {
// contains filtered or unexported fields
}
func NewMenuModel ¶
func NewMenuModel() MenuModel
type PushPullModel ¶
type PushPullModel struct {
// contains filtered or unexported fields
}
func NewPushPullModel ¶
func NewPushPullModel() PushPullModel
func (PushPullModel) Update ¶
func (m PushPullModel) Update(msg tea.Msg) (PushPullModel, tea.Cmd, bool)
func (PushPullModel) View ¶
func (m PushPullModel) View() string
type StatusModel ¶
type StatusModel struct {
// contains filtered or unexported fields
}
func NewStatusModel ¶
func NewStatusModel() StatusModel
func (StatusModel) Update ¶
func (m StatusModel) Update(msg tea.Msg) (StatusModel, tea.Cmd, bool)
func (StatusModel) View ¶
func (m StatusModel) View() string
type TextInput ¶
TextInput is a reusable single-line text input with cursor movement support. Supports: typing, backspace, delete, left/right arrows, home/end, paste.
func NewTextInput ¶
func (TextInput) Update ¶
Update handles key messages. Returns updated TextInput and whether Enter was pressed.
func (TextInput) ViewWithLabel ¶
ViewWithLabel renders label + input + hint
Click to show internal directories.
Click to hide internal directories.