Documentation
¶
Overview ¶
Package navigation implements the stackit top/bottom commands for navigating stacked branches.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SwitchBranchAction ¶
func SwitchBranchAction(direction Direction, ctx *app.Context, handler Handler) (actions.CheckoutResult, error)
SwitchBranchAction switches to a branch based on the given direction
Types ¶
type Handler ¶
type Handler interface {
// PromptSelectBranch prompts user to select a branch when multiple children exist
// Returns the selected branch name
PromptSelectBranch(message string, branches []string) (string, error)
// Cleanup restores terminal state (may be no-op)
Cleanup()
// IsInteractive returns true if the handler supports interactive prompts
IsInteractive() bool
}
Handler receives events from navigation action
type NullHandler ¶
NullHandler is a no-op handler for when nil is passed. It embeds handler.NullBase for Cleanup() and IsInteractive().
func (*NullHandler) PromptSelectBranch ¶
func (h *NullHandler) PromptSelectBranch(string, []string) (string, error)
PromptSelectBranch implements Handler. Returns empty string for null handler.
Click to show internal directories.
Click to hide internal directories.