Documentation
¶
Overview ¶
Package app provides the main application UI and logic using Bubble Tea.
Index ¶
- func SetIconProvider(p IconProvider)
- type ChecklistItem
- type ChecklistScreen
- type CommandPaletteScreen
- type CommitFileTreeNode
- type CommitFilesScreen
- type CommitScreen
- type ConfirmScreen
- type EmojiProvider
- type HelpScreen
- type IconProvider
- type InfoScreen
- type InputScreen
- func (s *InputScreen) Init() tea.Cmd
- func (s *InputScreen) SetCheckbox(label string, defaultChecked bool)
- func (s *InputScreen) SetFuzzyFinder(enabled bool, suggestions []string)
- func (s *InputScreen) SetHistory(history []string)
- func (s *InputScreen) SetValidation(fn func(string) string)
- func (s *InputScreen) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (s *InputScreen) View() string
- type IssueSelectionScreen
- type ListSelectionScreen
- type LoadingScreen
- type Model
- type NerdFontV3Provider
- type PRSelectionScreen
- type StatusFile
- type StatusTreeNode
- type TextProvider
- type TrustScreen
- type UIIcon
- type WelcomeScreen
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetIconProvider ¶ added in v1.27.0
func SetIconProvider(p IconProvider)
SetIconProvider sets the current icon provider.
Types ¶
type ChecklistItem ¶ added in v1.22.0
ChecklistItem represents a single item with a checkbox state.
type ChecklistScreen ¶ added in v1.22.0
type ChecklistScreen struct {
// contains filtered or unexported fields
}
ChecklistScreen lets the user select multiple items from a list via checkboxes.
func NewChecklistScreen ¶ added in v1.22.0
func NewChecklistScreen(items []ChecklistItem, title, placeholder, noResults string, maxWidth, maxHeight int, thm *theme.Theme) *ChecklistScreen
NewChecklistScreen creates a multi-select checklist screen.
func (*ChecklistScreen) Init ¶ added in v1.22.0
func (s *ChecklistScreen) Init() tea.Cmd
Init configures the checklist input before Bubble Tea updates begin.
func (*ChecklistScreen) SelectedItems ¶ added in v1.22.0
func (s *ChecklistScreen) SelectedItems() []ChecklistItem
SelectedItems returns all checked items.
func (*ChecklistScreen) Update ¶ added in v1.22.0
Update handles keyboard events for the checklist screen.
func (*ChecklistScreen) View ¶ added in v1.22.0
func (s *ChecklistScreen) View() string
View renders the checklist screen.
type CommandPaletteScreen ¶
type CommandPaletteScreen struct {
// contains filtered or unexported fields
}
CommandPaletteScreen lets the user pick a command from a filtered list.
func NewCommandPaletteScreen ¶
func NewCommandPaletteScreen(items []paletteItem, maxWidth, maxHeight int, thm *theme.Theme) *CommandPaletteScreen
NewCommandPaletteScreen builds a palette populated with candidate commands.
func (*CommandPaletteScreen) Init ¶
func (s *CommandPaletteScreen) Init() tea.Cmd
Init configures the palette input before Bubble Tea updates begin.
func (*CommandPaletteScreen) Selected ¶
func (s *CommandPaletteScreen) Selected() (string, bool)
Selected reports the current palette selection if one exists.
func (*CommandPaletteScreen) View ¶
func (s *CommandPaletteScreen) View() string
View displays the palette items and current filter text.
type CommitFileTreeNode ¶ added in v1.17.0
type CommitFileTreeNode struct {
Path string
File *models.CommitFile // nil for directories
Children []*CommitFileTreeNode
Compression int // Number of compressed path segments
// contains filtered or unexported fields
}
CommitFileTreeNode represents a node in the commit file tree.
func (*CommitFileTreeNode) IsDir ¶ added in v1.17.0
func (n *CommitFileTreeNode) IsDir() bool
IsDir returns true if this node is a directory.
type CommitFilesScreen ¶ added in v1.17.0
type CommitFilesScreen struct {
// contains filtered or unexported fields
}
CommitFilesScreen displays files changed in a commit as a collapsible tree.
func NewCommitFilesScreen ¶ added in v1.17.0
func NewCommitFilesScreen(sha, wtPath string, files []models.CommitFile, meta commitMeta, maxWidth, maxHeight int, thm *theme.Theme, showIcons bool) *CommitFilesScreen
NewCommitFilesScreen creates a commit files tree screen.
func (*CommitFilesScreen) GetSelectedNode ¶ added in v1.17.0
func (s *CommitFilesScreen) GetSelectedNode() *CommitFileTreeNode
GetSelectedNode returns the currently selected node.
func (*CommitFilesScreen) Init ¶ added in v1.17.0
func (s *CommitFilesScreen) Init() tea.Cmd
Init implements tea.Model.
func (*CommitFilesScreen) ToggleCollapse ¶ added in v1.17.0
func (s *CommitFilesScreen) ToggleCollapse(path string)
ToggleCollapse toggles the collapse state of a directory.
func (*CommitFilesScreen) Update ¶ added in v1.17.0
Update handles key events for the commit files screen.
func (*CommitFilesScreen) View ¶ added in v1.17.0
func (s *CommitFilesScreen) View() string
View renders the commit files screen.
type CommitScreen ¶
type CommitScreen struct {
// contains filtered or unexported fields
}
CommitScreen displays metadata, stats, and diff details for a single commit.
func NewCommitScreen ¶
func NewCommitScreen(meta commitMeta, stat, diff string, useDelta bool, thm *theme.Theme) *CommitScreen
NewCommitScreen configures the commit detail viewer for the selected SHA.
func (*CommitScreen) Init ¶
func (s *CommitScreen) Init() tea.Cmd
Init satisfies tea.Model.Init for the commit detail view.
type ConfirmScreen ¶
type ConfirmScreen struct {
// contains filtered or unexported fields
}
ConfirmScreen displays a modal confirmation prompt with Accept/Cancel buttons.
func NewConfirmScreen ¶
func NewConfirmScreen(message string, thm *theme.Theme) *ConfirmScreen
NewConfirmScreen creates a confirm screen preloaded with a message.
func NewConfirmScreenWithDefault ¶ added in v1.22.0
func NewConfirmScreenWithDefault(message string, defaultButton int, thm *theme.Theme) *ConfirmScreen
NewConfirmScreenWithDefault creates a confirmation modal with a specified default button.
func (*ConfirmScreen) Init ¶
func (s *ConfirmScreen) Init() tea.Cmd
Init implements the tea.Model Init stage for ConfirmScreen.
func (*ConfirmScreen) View ¶
func (s *ConfirmScreen) View() string
View renders the confirmation UI box with focused button highlighting.
type EmojiProvider ¶ added in v1.27.0
type EmojiProvider struct{}
EmojiProvider implements IconProvider using emojis.
func (*EmojiProvider) GetCIIcon ¶ added in v1.27.0
func (p *EmojiProvider) GetCIIcon(conclusion string) string
GetCIIcon returns the CI status icon for the given conclusion.
func (*EmojiProvider) GetFileIcon ¶ added in v1.27.0
func (p *EmojiProvider) GetFileIcon(name string, isDir bool) string
GetFileIcon returns the file icon for the given name and type.
func (*EmojiProvider) GetIssueIcon ¶ added in v1.27.0
func (p *EmojiProvider) GetIssueIcon() string
GetIssueIcon returns the issue icon.
func (*EmojiProvider) GetPRIcon ¶ added in v1.27.0
func (p *EmojiProvider) GetPRIcon() string
GetPRIcon returns the PR icon.
func (*EmojiProvider) GetUIIcon ¶ added in v1.27.0
func (p *EmojiProvider) GetUIIcon(icon UIIcon) string
GetUIIcon returns the UI icon for the given identifier.
type HelpScreen ¶
type HelpScreen struct {
// contains filtered or unexported fields
}
HelpScreen renders searchable documentation for the app controls.
func NewHelpScreen ¶
func NewHelpScreen(maxWidth, maxHeight int, customCommands map[string]*config.CustomCommand, thm *theme.Theme, showIcons bool) *HelpScreen
NewHelpScreen initializes help content with the available screen size.
func (*HelpScreen) Init ¶
func (s *HelpScreen) Init() tea.Cmd
Init prepares the help screen before it starts handling updates.
func (*HelpScreen) SetSize ¶
func (s *HelpScreen) SetSize(maxWidth, maxHeight int)
SetSize updates the help screen dimensions (useful on terminal resize)
func (*HelpScreen) View ¶
func (s *HelpScreen) View() string
View renders the help content and search input inside the viewport.
type IconProvider ¶ added in v1.27.0
type IconProvider interface {
GetFileIcon(name string, isDir bool) string
GetPRIcon() string
GetIssueIcon() string
GetCIIcon(conclusion string) string
GetUIIcon(icon UIIcon) string
}
IconProvider defines the interface for providing icons.
type InfoScreen ¶ added in v1.7.0
type InfoScreen struct {
// contains filtered or unexported fields
}
InfoScreen displays a modal message with an OK button.
func NewInfoScreen ¶ added in v1.7.0
func NewInfoScreen(message string, thm *theme.Theme) *InfoScreen
NewInfoScreen creates an informational modal with an OK button.
func (*InfoScreen) Init ¶ added in v1.7.0
func (s *InfoScreen) Init() tea.Cmd
Init implements the tea.Model Init stage for InfoScreen.
func (*InfoScreen) View ¶ added in v1.7.0
func (s *InfoScreen) View() string
View renders the informational UI box with a single OK button.
type InputScreen ¶
type InputScreen struct {
// contains filtered or unexported fields
}
InputScreen provides a prompt along with a text input and inline validation.
func NewInputScreen ¶
func NewInputScreen(prompt, placeholder, value string, thm *theme.Theme, showIcons bool) *InputScreen
NewInputScreen builds an input modal with prompt, placeholder, and initial value.
func (*InputScreen) Init ¶
func (s *InputScreen) Init() tea.Cmd
Init satisfies tea.Model.Init for the input modal.
func (*InputScreen) SetCheckbox ¶ added in v1.22.0
func (s *InputScreen) SetCheckbox(label string, defaultChecked bool)
SetCheckbox enables a checkbox in the input screen with the given label and default state.
func (*InputScreen) SetFuzzyFinder ¶ added in v1.10.0
func (s *InputScreen) SetFuzzyFinder(enabled bool, suggestions []string)
SetFuzzyFinder enables fuzzy finder with the provided suggestions.
func (*InputScreen) SetHistory ¶ added in v1.13.0
func (s *InputScreen) SetHistory(history []string)
SetHistory enables bash-style history navigation with up/down arrows.
func (*InputScreen) SetValidation ¶
func (s *InputScreen) SetValidation(fn func(string) string)
SetValidation adds an optional validation callback for input submission.
func (*InputScreen) Update ¶
Update handles keystrokes for the input modal and returns commands on submit.
func (*InputScreen) View ¶
func (s *InputScreen) View() string
View renders the prompt, input field, and error message inside a styled box.
type IssueSelectionScreen ¶ added in v1.20.0
type IssueSelectionScreen struct {
// contains filtered or unexported fields
}
IssueSelectionScreen lets the user pick an issue from a filtered list.
func NewIssueSelectionScreen ¶ added in v1.20.0
func NewIssueSelectionScreen(issues []*models.IssueInfo, maxWidth, maxHeight int, thm *theme.Theme, showIcons bool) *IssueSelectionScreen
NewIssueSelectionScreen builds an issue selection screen with 80% of screen size.
func (*IssueSelectionScreen) Init ¶ added in v1.20.0
func (s *IssueSelectionScreen) Init() tea.Cmd
Init configures the issue selection input before Bubble Tea updates begin.
func (*IssueSelectionScreen) Selected ¶ added in v1.20.0
func (s *IssueSelectionScreen) Selected() (*models.IssueInfo, bool)
Selected returns the currently selected issue, if any.
func (*IssueSelectionScreen) Update ¶ added in v1.20.0
Update handles updates for the issue selection screen.
func (*IssueSelectionScreen) View ¶ added in v1.20.0
func (s *IssueSelectionScreen) View() string
View renders the issue selection screen.
type ListSelectionScreen ¶ added in v1.6.0
type ListSelectionScreen struct {
// contains filtered or unexported fields
}
ListSelectionScreen lets the user pick from a list of options.
func NewListSelectionScreen ¶ added in v1.6.0
func NewListSelectionScreen(items []selectionItem, title, placeholder, noResults string, maxWidth, maxHeight int, initialID string, thm *theme.Theme) *ListSelectionScreen
NewListSelectionScreen builds a list selection screen with 80% of screen size.
func (*ListSelectionScreen) Init ¶ added in v1.6.0
func (s *ListSelectionScreen) Init() tea.Cmd
Init configures the list selection input before Bubble Tea updates begin.
func (*ListSelectionScreen) Selected ¶ added in v1.6.0
func (s *ListSelectionScreen) Selected() (selectionItem, bool)
Selected returns the currently selected item, if any.
func (*ListSelectionScreen) Update ¶ added in v1.6.0
Update handles updates for the list selection screen.
func (*ListSelectionScreen) View ¶ added in v1.6.0
func (s *ListSelectionScreen) View() string
View renders the list selection screen.
type LoadingScreen ¶ added in v1.15.0
type LoadingScreen struct {
// contains filtered or unexported fields
}
LoadingScreen displays a modal with a spinner and a random tip.
func NewLoadingScreen ¶ added in v1.15.0
func NewLoadingScreen(message string, thm *theme.Theme, showIcons bool) *LoadingScreen
NewLoadingScreen creates a loading modal with the given message.
func (*LoadingScreen) Tick ¶ added in v1.15.0
func (s *LoadingScreen) Tick()
Tick advances the loading animation (spinner frame and border colour).
func (*LoadingScreen) View ¶ added in v1.15.0
func (s *LoadingScreen) View() string
View renders the loading modal with spinner, message, and a random tip.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the main application model
func NewModel ¶
NewModel creates a new application model with the given configuration. initialFilter is an optional filter string to apply on startup.
func (*Model) Close ¶
func (m *Model) Close()
Close releases background resources including canceling contexts and timers. It also persists the current selection for the next session.
func (*Model) GetSelectedPath ¶
GetSelectedPath returns the selected worktree path for shell integration. This is used when the application exits to allow the shell to cd into the selected worktree.
func (*Model) UpdateTheme ¶ added in v1.22.0
UpdateTheme updates the application theme and refreshes component styles.
type NerdFontV3Provider ¶ added in v1.27.0
type NerdFontV3Provider struct{}
NerdFontV3Provider implements IconProvider for Nerd Font v3.
func (*NerdFontV3Provider) GetCIIcon ¶ added in v1.27.0
func (p *NerdFontV3Provider) GetCIIcon(conclusion string) string
GetCIIcon returns the CI status icon for the given conclusion.
func (*NerdFontV3Provider) GetFileIcon ¶ added in v1.27.0
func (p *NerdFontV3Provider) GetFileIcon(name string, isDir bool) string
GetFileIcon returns the file icon for the given name and type.
func (*NerdFontV3Provider) GetIssueIcon ¶ added in v1.27.0
func (p *NerdFontV3Provider) GetIssueIcon() string
GetIssueIcon returns the issue icon.
func (*NerdFontV3Provider) GetPRIcon ¶ added in v1.27.0
func (p *NerdFontV3Provider) GetPRIcon() string
GetPRIcon returns the PR icon.
func (*NerdFontV3Provider) GetUIIcon ¶ added in v1.27.0
func (p *NerdFontV3Provider) GetUIIcon(icon UIIcon) string
GetUIIcon returns the UI icon for the given identifier.
type PRSelectionScreen ¶ added in v1.2.0
type PRSelectionScreen struct {
// contains filtered or unexported fields
}
PRSelectionScreen lets the user pick a PR from a filtered list.
func NewPRSelectionScreen ¶ added in v1.2.0
func NewPRSelectionScreen(prs []*models.PRInfo, maxWidth, maxHeight int, thm *theme.Theme, showIcons bool) *PRSelectionScreen
NewPRSelectionScreen builds a PR selection screen with 80% of screen size.
func (*PRSelectionScreen) Init ¶ added in v1.2.0
func (s *PRSelectionScreen) Init() tea.Cmd
Init configures the PR selection input before Bubble Tea updates begin.
func (*PRSelectionScreen) Selected ¶ added in v1.2.0
func (s *PRSelectionScreen) Selected() (*models.PRInfo, bool)
Selected returns the currently selected PR, if any.
func (*PRSelectionScreen) Update ¶ added in v1.2.0
Update handles updates for the PR selection screen.
func (*PRSelectionScreen) View ¶ added in v1.2.0
func (s *PRSelectionScreen) View() string
View renders the PR selection screen.
type StatusFile ¶ added in v1.15.0
type StatusFile struct {
Filename string
Status string // XY status code (e.g., ".M", "M.", " ?")
IsUntracked bool
}
StatusFile represents a file entry from git status.
type StatusTreeNode ¶ added in v1.17.0
type StatusTreeNode struct {
Path string // Full path (e.g., "internal/app" or "internal/app/app.go")
File *StatusFile // nil for directories
Children []*StatusTreeNode // nil for files
Compression int // Number of compressed path segments (e.g., "a/b" = 1)
// contains filtered or unexported fields
}
StatusTreeNode represents a node in the status file tree (directory or file).
func (*StatusTreeNode) CollectFiles ¶ added in v1.19.0
func (n *StatusTreeNode) CollectFiles() []*StatusFile
CollectFiles recursively collects all StatusFile pointers from this node and its children.
func (*StatusTreeNode) IsDir ¶ added in v1.17.0
func (n *StatusTreeNode) IsDir() bool
IsDir returns true if this node is a directory.
func (*StatusTreeNode) Name ¶ added in v1.17.0
func (n *StatusTreeNode) Name() string
Name returns the display name for this node.
type TextProvider ¶ added in v1.27.0
type TextProvider struct{}
TextProvider implements IconProvider using simple Unicode-safe characters.
func (*TextProvider) GetCIIcon ¶ added in v1.27.0
func (p *TextProvider) GetCIIcon(conclusion string) string
GetCIIcon returns the CI status icon for the given conclusion.
func (*TextProvider) GetFileIcon ¶ added in v1.27.0
func (p *TextProvider) GetFileIcon(name string, isDir bool) string
GetFileIcon returns the file icon for the given name and type.
func (*TextProvider) GetIssueIcon ¶ added in v1.27.0
func (p *TextProvider) GetIssueIcon() string
GetIssueIcon returns the issue icon.
func (*TextProvider) GetPRIcon ¶ added in v1.27.0
func (p *TextProvider) GetPRIcon() string
GetPRIcon returns the PR icon.
func (*TextProvider) GetUIIcon ¶ added in v1.27.0
func (p *TextProvider) GetUIIcon(icon UIIcon) string
GetUIIcon returns the UI icon for the given identifier.
type TrustScreen ¶
type TrustScreen struct {
// contains filtered or unexported fields
}
TrustScreen surfaces trust warnings and records commands for a path.
func NewTrustScreen ¶
func NewTrustScreen(filePath string, commands []string, thm *theme.Theme) *TrustScreen
NewTrustScreen warns the user when a repo config has changed or is untrusted.
func (*TrustScreen) Init ¶
func (s *TrustScreen) Init() tea.Cmd
Init satisfies tea.Model.Init for the trust confirmation screen.
func (*TrustScreen) View ¶
func (s *TrustScreen) View() string
View renders the trust warning content inside a styled box.
type UIIcon ¶ added in v1.27.0
type UIIcon int
UIIcon identifies UI-specific icons that follow the selected icon set.
const ( UIIconHelpTitle UIIcon = iota UIIconStatusPane UIIconLogPane UIIconCommitTree UIIconWorktreeActions UIIconBranchNaming UIIconViewingTools UIIconRepoOps UIIconBackgroundRefresh UIIconFilterSearch UIIconStatusIndicators UIIconShellCompletion UIIconConfiguration UIIconIconConfiguration UIIconTip UIIconSearch UIIconFilter UIIconZoom UIIconBot UIIconThemeSelect UIIconPRSelect UIIconIssueSelect UIIconWorktreeMain UIIconWorktree UIIconStatusClean UIIconStatusDirty UIIconSyncClean UIIconAhead UIIconBehind UIIconArrowLeft UIIconArrowRight UIIconDisclosureOpen UIIconDisclosureClosed UIIconSpinnerFilled UIIconSpinnerEmpty UIIconPRStateOpen UIIconPRStateMerged UIIconPRStateClosed UIIconPRStateUnknown )
UIIcon values map UI elements to icon set glyphs.
type WelcomeScreen ¶
type WelcomeScreen struct {
// contains filtered or unexported fields
}
WelcomeScreen shows the initial instructions when no worktrees are open.
func NewWelcomeScreen ¶
func NewWelcomeScreen(currentDir, worktreeDir string, thm *theme.Theme) *WelcomeScreen
NewWelcomeScreen builds the greeting screen shown when no worktrees exist.
func (*WelcomeScreen) Init ¶
func (s *WelcomeScreen) Init() tea.Cmd
Init is part of the tea.Model interface for the welcome screen.
func (*WelcomeScreen) View ¶
func (s *WelcomeScreen) View() string
View renders the welcome dialog with guidance and action buttons.