Documentation
¶
Index ¶
- Constants
- func BranchActionSelect(action *string) *huh.Group
- func BranchPruneConfirm(nDeleted, nMerged int, confirmed *bool) *huh.Group
- func BranchStatusFilter(status *string, selected string) *huh.Group
- func BranchTableModel(rows []store.BranchRow) (tea.Model, error)
- func CommitMessageGroup(commitTypes []config.CommitTypeOption, items []config.CommitItem, ...) *huh.Group
- func CommitOptionsGroup(opt *CommitOption) *huh.Group
- func ConfigDestPicker(opts []huh.Option[string], dest *string) *huh.Group
- func ConfigSectionPicker(keys []string, selected *[]string) *huh.Group
- func IssueActionSelect(action *string) *huh.Group
- func IssueBranchPicker(rows []store.BranchRow, currentBranch string, selected *store.BranchRow) *huh.Group
- func IssueConfirm(confirmTitle string, confirmed *bool) *huh.Group
- func IssueDeleteBranch(branchName string, confirmed *bool) *huh.Group
- func IssueInput(issueID, title, branchType *string, allowedBranchTypes []string) *huh.Group
- func IssueMergeAuthor(authors []string, author *string) *huh.Group
- func IssueMergeConfirm(branchName, baseBranch, strategy string, confirmed *bool) *huh.Group
- func IssueMergeStrategy(selected *string, options []StrategyOption) *huh.Group
- func IssueStatusPicker(issueID, trackerType string, statuses []string, selected *string) *huh.Group
- func IssueTableModel(rows []store.IssueRow, initialStatus string) (tea.Model, error)
- func IssueTrackerError(msg string) *huh.Group
- func IssueTrackerPicker(issues []tracker.Issue, selected *tracker.Issue, branchTypes []string, ...) *huh.Group
- func IssueTrackerToggle(useTracker *bool, trackerFirst bool, trackerType string) *huh.Group
- func WorktreeToggle(useWorktree *bool) *huh.Group
- type CommitOption
- type FormRunner
- type StrategyOption
Constants ¶
const ( BranchActionNameList = "branchList" BranchActionNameNew = "branchNew" BranchActionNameMerge = "branchMerge" BranchActionNamePrune = "branchPrune" BranchTableHeaderColor = lipgloss.Color("63") )
const ( IssueActionNameStart = "issueStart" IssueActionNameList = "issueList" IssueActionNameClose = "issueClose" )
Variables ¶
This section is empty.
Functions ¶
func BranchActionSelect ¶
BranchActionSelect presents the list of available branch actions.
func BranchPruneConfirm ¶
BranchPruneConfirm asks whether to proceed with pruning nDeleted deleted and nMerged merged branch records.
func BranchStatusFilter ¶
BranchStatusFilter presents a status filter for the branch list. selected is the pre-selected value ("in_progress", "merged", or "all"); defaults to "in_progress" when empty.
func BranchTableModel ¶ added in v0.3.0
func CommitMessageGroup ¶
func CommitMessageGroup(commitTypes []config.CommitTypeOption, items []config.CommitItem, selectedType *string) *huh.Group
CommitMessageGroup builds the first commit form group. The type select is always first, populated from commitTypes and writing into selectedType. Remaining fields come from items (scope, subject, body, footer).
func CommitOptionsGroup ¶
func CommitOptionsGroup(opt *CommitOption) *huh.Group
CommitOptionsGroup builds the second commit form group (author + commit flags). opt is written directly by the form fields.
func ConfigDestPicker ¶ added in v0.5.0
ConfigDestPicker presents a select form for choosing where to write the config file. opts is built by the caller based on which paths already exist.
func ConfigSectionPicker ¶ added in v0.7.0
ConfigSectionPicker returns a huh.Group with a MultiSelect that lets the user choose which config sections to write to the repo-local TOML file. keys is the ordered list of section names from the config map. selected is the pointer where chosen keys are written after the form runs.
func IssueActionSelect ¶
IssueActionSelect presents the list of available issue actions.
func IssueBranchPicker ¶ added in v0.4.2
func IssueBranchPicker(rows []store.BranchRow, currentBranch string, selected *store.BranchRow) *huh.Group
IssueBranchPicker presents in-progress branches for the close flow. The branch matching currentBranch is pre-selected; falls back to the first row.
func IssueDeleteBranch ¶ added in v0.4.2
IssueDeleteBranch asks whether to delete the local branch after closing.
func IssueInput ¶
func IssueMergeAuthor ¶ added in v0.4.2
IssueMergeAuthor lets the user pick the squash commit author. authors[0] is expected to be the git config identity (pre-filled by the caller).
func IssueMergeConfirm ¶ added in v0.4.2
IssueMergeConfirm shows a merge summary and asks for final confirmation.
func IssueMergeStrategy ¶ added in v0.4.2
func IssueMergeStrategy(selected *string, options []StrategyOption) *huh.Group
IssueMergeStrategy renders a single-select picker from the given options and writes the chosen Value to *selected. *selected is pre-populated with the first option's Value as the default.
func IssueStatusPicker ¶ added in v0.2.0
IssueStatusPicker lets the user pick a new status from the live list, or skip the update entirely. selected is set to the chosen status name, or to issueStatusSkip ("") when the user chooses to skip.
func IssueTableModel ¶ added in v0.3.0
func IssueTrackerError ¶
IssueTrackerError shows an error note with a "Continue with manual input" button.
func IssueTrackerPicker ¶
func IssueTrackerPicker( issues []tracker.Issue, selected *tracker.Issue, branchTypes []string, branchType *string) *huh.Group
IssueTrackerPicker shows the live issue list and branch type selector.
func IssueTrackerToggle ¶
IssueTrackerToggle asks whether to fetch issues from the tracker. trackerFirst=true pre-selects YES (used for `issue start`); trackerFirst=false pre-selects NO (used for `branch new`).
func WorktreeToggle ¶ added in v0.9.0
WorktreeToggle asks whether to create a git worktree or a plain branch. Pre-selected default is false (plain branch).
Types ¶
type CommitOption ¶
type CommitOption struct {
Authors []string
Author string
AssumeYes bool
All bool
Amend bool
NoVerify bool
Signoff bool
AllowEmpty bool
}
CommitOption holds commit option values for the commit options group of the TUI. Used both as flag-derived defaults (input) and as user selections (output).
func (CommitOption) AnyOptionSet ¶
func (o CommitOption) AnyOptionSet() bool
AnyOptionSet reports true if any commit-option flag was passed. When true, the CommitOptionsGroup of the TUI should be skipped.
type FormRunner ¶ added in v0.8.0
type FormRunner struct {
// contains filtered or unexported fields
}
FormRunner wraps a *huh.Form as a tea.Model to intercept ctrl+r before huh sees it.
func RunForm ¶ added in v0.8.0
func RunForm(form *huh.Form) (*FormRunner, error)
RunForm runs form inside a bubbletea program. Returns (runner, nil) on normal completion or ctrl+r; call runner.WantHistory() to distinguish. Returns (runner, huh.ErrUserAborted) on ctrl+c / esc.
func (*FormRunner) Init ¶ added in v0.8.0
func (r *FormRunner) Init() tea.Cmd
Init implements tea.Model.
func (*FormRunner) View ¶ added in v0.8.0
func (r *FormRunner) View() string
View implements tea.Model.
func (*FormRunner) WantHistory ¶ added in v0.8.0
func (r *FormRunner) WantHistory() bool
WantHistory reports whether the user pressed ctrl+r during the form.
type StrategyOption ¶ added in v0.8.0
StrategyOption is one entry rendered by IssueMergeStrategy. The picker does not know what the strategies mean — callers own the option list.