Documentation
¶
Overview ¶
ui/simplemenu/fixpr_prompt.go
ui/simplemenu/list.go
ui/simplemenu/menu.go
ui/simplemenu/stack_prompt.go
ui/simplemenu/sync_prompt.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunFixPrPrompt ¶
RunFixPrPrompt shows a prompt for the fix-pr command
func RunMenu ¶
func RunMenu() string
RunMenu shows a simple command selection menu and returns the selected command
func RunStackPrompt ¶
RunStackPrompt shows a prompt for the stack command
func RunSyncPrompt ¶
RunSyncPrompt shows a prompt for the sync command and returns selected branches
Types ¶
type BasePrompt ¶
BasePrompt provides common functionality for all prompts
func (*BasePrompt) ClearError ¶
func (b *BasePrompt) ClearError()
ClearError clears the error message
func (*BasePrompt) IsCancelled ¶
func (b *BasePrompt) IsCancelled() bool
IsCancelled returns true if the prompt was cancelled
func (*BasePrompt) RenderError ¶
func (b *BasePrompt) RenderError() string
RenderError renders error message if present
func (*BasePrompt) RenderHelpText ¶
func (b *BasePrompt) RenderHelpText(text string) string
RenderHelpText renders help text with consistent styling
func (*BasePrompt) RenderTitle ¶
func (b *BasePrompt) RenderTitle() string
RenderTitle renders the title with consistent styling
func (*BasePrompt) SetError ¶
func (b *BasePrompt) SetError(msg string)
SetError sets an error message
type FixPrPromptModel ¶
type FixPrPromptModel struct {
BasePrompt
BranchList *SelectableList
TargetList *SelectableList
SelectedBranch string
TargetBranch string
State branchSelectionState
Git *core.GitExecutor
}
FixPrPromptModel handles user input for the fix-pr command
func NewFixPrPromptModel ¶
func NewFixPrPromptModel(branches []string, git *core.GitExecutor) FixPrPromptModel
NewFixPrPromptModel creates a new fix-pr prompt model
func (FixPrPromptModel) Init ¶
func (m FixPrPromptModel) Init() tea.Cmd
func (FixPrPromptModel) View ¶
func (m FixPrPromptModel) View() string
type SelectableList ¶
type SelectableList struct {
Items []string
Cursor int
Selected map[int]bool
OrderMap map[string]int // Maps item value to selection order
NextOrder int // Next order index to assign
}
SelectableList provides a reusable list component
func NewSelectableList ¶
func NewSelectableList(items []string) *SelectableList
NewSelectableList creates a new selectable list
func (*SelectableList) GetSelectedCount ¶
func (l *SelectableList) GetSelectedCount() int
GetSelectedCount returns the number of selected items
func (*SelectableList) GetSelectedItems ¶
func (l *SelectableList) GetSelectedItems() []string
GetSelectedItems returns selected items in order of selection
func (*SelectableList) MoveDown ¶
func (l *SelectableList) MoveDown()
MoveDown moves the cursor down
func (*SelectableList) Render ¶
func (l *SelectableList) Render(showCheckboxes bool, showOrder bool) string
Render renders the list with selection indicators
func (*SelectableList) ToggleSelected ¶
func (l *SelectableList) ToggleSelected()
ToggleSelected toggles selection for current item
type StackPromptModel ¶
type StackPromptModel struct {
BasePrompt
NewBranch string
ParentBranch string
CurrentField int
CursorPos int
}
StackPromptModel handles user input for the stack command
func NewStackPromptModel ¶
func NewStackPromptModel() StackPromptModel
NewStackPromptModel creates a new stack prompt model
func (StackPromptModel) Init ¶
func (m StackPromptModel) Init() tea.Cmd
func (StackPromptModel) View ¶
func (m StackPromptModel) View() string
type SyncPromptModel ¶
type SyncPromptModel struct {
BasePrompt
BranchList *SelectableList
Step syncStep
Git *core.GitExecutor
}
SyncPromptModel handles branch selection for the sync command
func NewSyncPromptModel ¶
func NewSyncPromptModel(branches []string, git *core.GitExecutor) SyncPromptModel
NewSyncPromptModel creates a new sync prompt model
func (SyncPromptModel) Init ¶
func (m SyncPromptModel) Init() tea.Cmd
func (SyncPromptModel) View ¶
func (m SyncPromptModel) View() string