Documentation
¶
Overview ¶
Package ui provides bubbletea TUI prompts for destructive migration operations.
Package ui provides bubbletea TUI prompts for destructive migration operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBubbleteaPromptFunc ¶
func NewBubbleteaPromptFunc() yamlpkg.PromptFunc
NewBubbleteaPromptFunc returns a yamlpkg.PromptFunc that wraps the bubbletea TUI prompt. It tracks scope state (all remaining / all of type) across calls so that a single "All remaining" or "All of this type" selection applies to subsequent destructive operations automatically.
Types ¶
type PromptScope ¶
type PromptScope int
PromptScope controls how a prompt response is applied to subsequent operations.
const ( ScopeOne PromptScope = iota // apply to this operation only ScopeAll // apply to all remaining destructive ops ScopeType // apply to all remaining ops of the same ChangeType )
PromptScope constants define how broadly a prompt response is applied.
func ParsePromptInput ¶
func ParsePromptInput(input string) (yamlpkg.PromptResponse, PromptScope)
ParsePromptInput parses a prompt input like "1", "3a", "5t" into a PromptResponse and a scope. Used as fallback for non-interactive environments.
func RunDestructivePrompt ¶
func RunDestructivePrompt(title string, changeType yamlpkg.ChangeType) (yamlpkg.PromptResponse, PromptScope, error)
RunDestructivePrompt shows a bubbletea prompt for a single destructive operation and returns the user's chosen response and scope.