tui

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BranchActionNameList  = "branchList"
	BranchActionNameNew   = "branchNew"
	BranchActionNameMerge = "branchMerge"
	BranchActionNamePrune = "branchPrune"

	BranchTableHeaderColor = lipgloss.Color("63")
)
View Source
const (
	IssueActionNameStart = "issueStart"
	IssueActionNameList  = "issueList"
	IssueActionNameClose = "issueClose"
)

Variables

This section is empty.

Functions

func BranchActionSelect

func BranchActionSelect(action *string) *huh.Group

BranchActionSelect presents the list of available branch actions.

func BranchPruneConfirm

func BranchPruneConfirm(nDeleted, nMerged int, confirmed *bool) *huh.Group

BranchPruneConfirm asks whether to proceed with pruning nDeleted deleted and nMerged merged branch records.

func BranchStatusFilter

func BranchStatusFilter(status *string, selected string) *huh.Group

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 BranchTableModel(rows []store.BranchRow) (tea.Model, error)

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

func ConfigDestPicker(opts []huh.Option[string], dest *string) *huh.Group

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

func ConfigSectionPicker(keys []string, selected *[]string) *huh.Group

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

func IssueActionSelect(action *string) *huh.Group

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 IssueConfirm

func IssueConfirm(confirmTitle string, confirmed *bool) *huh.Group

func IssueDeleteBranch added in v0.4.2

func IssueDeleteBranch(branchName string, confirmed *bool) *huh.Group

IssueDeleteBranch asks whether to delete the local branch after closing.

func IssueInput

func IssueInput(issueID, title, branchType *string, allowedBranchTypes []string) *huh.Group

func IssueMergeAuthor added in v0.4.2

func IssueMergeAuthor(authors []string, author *string) *huh.Group

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

func IssueMergeConfirm(branchName, baseBranch, strategy, author string, confirmed *bool) *huh.Group

IssueMergeConfirm shows a merge summary and asks for final confirmation. author is empty for classic merges.

func IssueMergeStrategy added in v0.4.2

func IssueMergeStrategy(squash *bool) *huh.Group

IssueMergeStrategy lets the user choose between squash (default) and classic merge.

func IssueStatusPicker added in v0.2.0

func IssueStatusPicker(issueID, trackerType string, statuses []string, selected *string) *huh.Group

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 IssueTableModel(rows []store.IssueRow, initialStatus string) (tea.Model, error)

func IssueTrackerError

func IssueTrackerError(msg string) *huh.Group

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

func IssueTrackerToggle(useTracker *bool, trackerFirst bool, trackerType string) *huh.Group

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`).

Types

type CommitOption

type CommitOption struct {
	Authors    []string
	Author     string
	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.

Jump to

Keyboard shortcuts

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