app

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package app provides the main application UI and logic using Bubble Tea.

Index

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 CommandRunner added in v1.30.0

type CommandRunner func(ctx context.Context, name string, args ...string) *exec.Cmd

CommandRunner is a function type for creating exec.Cmd instances.

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 ITermLauncher added in v1.32.0

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

ITermLauncher implements TerminalTabLauncher for iTerm.

func (*ITermLauncher) IsAvailable added in v1.32.0

func (i *ITermLauncher) IsAvailable() bool

IsAvailable checks if running inside iTerm.

func (*ITermLauncher) Launch added in v1.32.0

func (i *ITermLauncher) Launch(ctx context.Context, cmd, cwd, title string, env map[string]string) (string, error)

Launch opens a new iTerm tab with the given command.

func (*ITermLauncher) Name added in v1.32.0

func (i *ITermLauncher) Name() string

Name returns "iTerm".

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 KittyLauncher added in v1.30.0

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

KittyLauncher implements TerminalTabLauncher for Kitty terminal.

func (*KittyLauncher) IsAvailable added in v1.30.0

func (k *KittyLauncher) IsAvailable() bool

IsAvailable checks if running inside Kitty terminal.

func (*KittyLauncher) Launch added in v1.30.0

func (k *KittyLauncher) Launch(ctx context.Context, cmd, cwd, title string, env map[string]string) (string, error)

Launch opens a new Kitty tab with the given command.

func (*KittyLauncher) Name added in v1.30.0

func (k *KittyLauncher) Name() string

Name returns "Kitty".

type Model

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

Model represents the main application model

func NewModel

func NewModel(cfg *config.AppConfig, initialFilter string) *Model

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

func (m *Model) GetSelectedPath() string

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) Init

func (m *Model) Init() tea.Cmd

Init satisfies the tea.Model interface and starts with no command.

func (*Model) Update

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

Update processes Bubble Tea messages and routes them through the app model.

func (*Model) UpdateTheme added in v1.22.0

func (m *Model) UpdateTheme(themeName string)

UpdateTheme refreshes UI styles for the selected theme.

func (*Model) View

func (m *Model) View() string

View renders the active screen for the Bubble Tea program.

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 StatusFile added in v1.15.0

type StatusFile = models.StatusFile

StatusFile represents a file entry from git status.

type StatusTreeNode added in v1.17.0

type StatusTreeNode = services.StatusTreeNode

StatusTreeNode represents a node in the status file tree (directory or file).

type TerminalTabLauncher added in v1.30.0

type TerminalTabLauncher interface {
	// Name returns the terminal name for display.
	Name() string
	// IsAvailable checks if running inside this terminal.
	IsAvailable() bool
	// Launch opens a new tab with the given command.
	// Returns the tab title on success.
	Launch(ctx context.Context, cmd, cwd, title string, env map[string]string) (string, error)
}

TerminalTabLauncher launches commands in new terminal tabs.

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 UIIcon added in v1.27.0

type UIIcon int

UIIcon identifies UI-specific icons that follow the selected icon set.

const (
	UIIconHelpTitle UIIcon = iota
	UIIconNavigation
	UIIconStatusPane
	UIIconLogPane
	UIIconCommitTree
	UIIconWorktreeActions
	UIIconBranchNaming
	UIIconViewingTools
	UIIconRepoOps
	UIIconBackgroundRefresh
	UIIconFilterSearch
	UIIconStatusIndicators
	UIIconHelpNavigation
	UIIconShellCompletion
	UIIconConfiguration
	UIIconIconConfiguration
	UIIconTip
	UIIconSearch
	UIIconFilter
	UIIconZoom
	UIIconBot
	UIIconThemeSelect
	UIIconPRSelect
	UIIconIssueSelect
	UIIconCICheck
	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 WezTermLauncher added in v1.32.0

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

WezTermLauncher implements TerminalTabLauncher for WezTerm terminal.

func (*WezTermLauncher) IsAvailable added in v1.32.0

func (w *WezTermLauncher) IsAvailable() bool

IsAvailable checks if running inside WezTerm.

func (*WezTermLauncher) Launch added in v1.32.0

func (w *WezTermLauncher) Launch(ctx context.Context, cmd, cwd, title string, env map[string]string) (string, error)

Launch opens a new WezTerm tab with the given command.

func (*WezTermLauncher) Name added in v1.32.0

func (w *WezTermLauncher) Name() string

Name returns "WezTerm".

Directories

Path Synopsis
Package screen provides a unified screen management system for modal overlays.
Package screen provides a unified screen management system for modal overlays.

Jump to

Keyboard shortcuts

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