app

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 26 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

This section is empty.

Types

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) *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) Update

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

Update handles updates for the command palette

func (*CommandPaletteScreen) View

func (s *CommandPaletteScreen) View() string

View displays the palette items and current filter text.

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) *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.

func (*CommitScreen) Update

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

Update handles scrolling and closing events for the commit screen.

func (*CommitScreen) View

func (s *CommitScreen) View() string

View renders the commit screen

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) *ConfirmScreen

NewConfirmScreen creates a confirm screen preloaded with a message.

func (*ConfirmScreen) Init

func (s *ConfirmScreen) Init() tea.Cmd

Init implements the tea.Model Init stage for ConfirmScreen.

func (*ConfirmScreen) Update

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

Update processes keyboard events for the confirmation dialog.

func (*ConfirmScreen) View

func (s *ConfirmScreen) View() string

View renders the confirmation UI box with focused button highlighting.

type DiffScreen

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

DiffScreen renders a full commit diff inside a viewport.

func NewDiffScreen

func NewDiffScreen(title, diff string) *DiffScreen

NewDiffScreen displays a commit diff title and body inside a viewport.

func (*DiffScreen) Init

func (s *DiffScreen) Init() tea.Cmd

Init sets up the diff viewport state before rendering.

func (*DiffScreen) Update

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

Update processes navigation keys while the diff is visible.

func (*DiffScreen) View

func (s *DiffScreen) View() string

View renders the diff text inside a scrollable viewport.

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) *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) Update

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

Update handles scrolling and search input for the help screen.

func (*HelpScreen) View

func (s *HelpScreen) View() string

View renders the help content and search input inside the viewport.

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) *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) SetValidation

func (s *InputScreen) SetValidation(fn func(string) string)

SetValidation adds an optional validation callback for input submission.

func (*InputScreen) Update

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

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

func (*Model) Close

func (m *Model) Close()

Close releases background resources (cancel contexts, timers)

func (*Model) GetSelectedPath

func (m *Model) GetSelectedPath() string

GetSelectedPath returns the selected worktree path (for shell integration)

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

func (m *Model) View() string

View renders the active screen for the Bubble Tea program.

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

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

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 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) *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) Update

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

Update handles trust decisions and delegates viewport input updates.

func (*TrustScreen) View

func (s *TrustScreen) View() string

View renders the trust warning content inside a styled box.

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) *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) Update

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

Update listens for retry or quit keys on the welcome screen.

func (*WelcomeScreen) View

func (s *WelcomeScreen) View() string

View renders the welcome dialog with guidance and action buttons.

Jump to

Keyboard shortcuts

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