ui

package
v0.0.0-...-13ba34a Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(message string) (bool, error)

Confirm shows a simple confirmation prompt Press enter to confirm, any other key to cancel

func PickWorktreeSimple

func PickWorktreeSimple(worktrees []*db.Worktree) (*db.Worktree, error)

PickWorktreeSimple shows a simple worktree picker without Tab functionality Used by remove command where we don't need the add workflow

Types

type PickerAction

type PickerAction int

PickerAction represents what action the user wants to take

const (
	ActionNone PickerAction = iota
	ActionSwitch
	ActionAdd
	ActionBack   // Return from add mode to worktree list
	ActionDelete // Delete the selected worktree
)

func InputBranch

func InputBranch(placeholder, sourceRepo, sourceBranch string) (string, PickerAction, error)

InputBranch prompts for a branch name sourceRepo and sourceBranch are displayed to show where the worktree will be created from Returns the branch name and action (ActionBack if user wants to go back)

type PickerResult

type PickerResult struct {
	Action   PickerAction
	Worktree *db.Worktree
}

PickerResult contains the result of the picker

func PickWorktree

func PickWorktree(worktrees []*db.Worktree) (*PickerResult, error)

PickWorktree shows an interactive picker for worktrees Returns the selected worktree and the action (switch or add)

Jump to

Keyboard shortcuts

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