Documentation
¶
Index ¶
- Variables
- func Confirm(prompt string, defaultYes bool) bool
- func ConfirmOrDie(prompt string, defaultYes bool)
- func FormatBranchCommits(branchCommits []templates.GitLog, padding string) string
- func GetBranchSelectionWithFilter(branches []string, prompt string, rowEnabled func(row int) bool) ([]string, error)
- func GetCommitSelection(options CommitSelectionOptions) ([]templates.GitLog, error)
- func GetLogNumberPrefix(i int, numLogs int) string
- func GetWorktreeSelection(worktrees []WorktreeOption, prompt string) (int, error)
- func InteractiveEnabled() bool
- func NewMessageKey(keyType tea.KeyType) tea.KeyMsg
- func NewMessageRune(r rune) tea.KeyMsg
- func PromptForString(prompt string, placeholder string, suggestions []string) string
- func PromptForStringOrDie(prompt string, placeholder string, suggestions []string) string
- func RequireInput(t *testing.T)
- func SendErrorOnPanic(program *tea.Program)
- func SendToProgram(programIndex int, messages ...tea.Msg)
- func ShowLogStatus(logs []templates.GitLog, checkedBranches []string, pollInterval time.Duration, ...)
- func UserSelection() string
- type CommitSelectionOptions
- type CommitSelector
- type CommitType
- type LogDataFunc
- type ProgressIndicator
- type WorktreeLogSection
- type WorktreeOption
Constants ¶
This section is empty.
Variables ¶
var ReviewersHistory = util.NewHistoricalData("reviewers.history", 30)
Functions ¶
func ConfirmOrDie ¶
func FormatBranchCommits ¶ added in v2.1.0
FormatBranchCommits formats the additional commits on a branch for display. It copies the slice, reverses to chronological order, skips the first (which matches the main log entry), and truncates with a hiding message if needed.
func GetBranchSelectionWithFilter ¶
func GetBranchSelectionWithFilter(branches []string, prompt string, rowEnabled func(row int) bool) ([]string, error)
GetBranchSelectionWithFilter displays an interactive selector for branches with optional filtering. The rowEnabled function can be used to disable certain rows (branches) from selection. If rowEnabled is nil, all rows are enabled. Returns an empty array if user cancelled.
func GetCommitSelection ¶
func GetCommitSelection(options CommitSelectionOptions) ([]templates.GitLog, error)
Returns an empty array if user cancelled.
func GetLogNumberPrefix ¶ added in v2.1.0
func GetWorktreeSelection ¶ added in v2.1.1
func GetWorktreeSelection(worktrees []WorktreeOption, prompt string) (int, error)
GetWorktreeSelection displays an interactive single-select table for worktrees, showing branch and directory columns. Returns the selected index, or -1 if cancelled.
func InteractiveEnabled ¶
func InteractiveEnabled() bool
func NewMessageKey ¶
Convenience method for creating a message for when user hits a non-rune key like enter or up/down.
func NewMessageRune ¶
Convenience method for creating a message for when user typed a key.
func PromptForString ¶
func PromptForStringOrDie ¶
func RequireInput ¶
func SendErrorOnPanic ¶
Returns a function that send error to the program instead of printing and calling os.Exit, as otherwise the console can be left in state where new lines are only displayed as line feeds (on Mac).
func SendToProgram ¶
Sends messages to the program. Each time [NewProgram] is called after SendToProgram programIndex is incremented. This is used instead of using stdin to avoid having to (somehow?) fake keyboard scan codes. programIndex is 0 based.
func ShowLogStatus ¶ added in v2.1.0
func ShowLogStatus(logs []templates.GitLog, checkedBranches []string, pollInterval time.Duration, refreshFunc LogDataFunc, worktreeSections []WorktreeLogSection)
func UserSelection ¶
func UserSelection() string
Types ¶
type CommitSelectionOptions ¶
type CommitSelector ¶
type CommitSelector struct {
SelectedRows []int
// contains filtered or unexported fields
}
func NewCommitSelector ¶
func (CommitSelector) Init ¶
func (m CommitSelector) Init() tea.Cmd
func (CommitSelector) View ¶
func (m CommitSelector) View() string
type CommitType ¶
type CommitType int
const ( CommitTypePr CommitType = iota CommitTypeNoPr CommitTypeBoth )
type LogDataFunc ¶ added in v2.1.0
type LogDataFunc func() ([]templates.GitLog, []string, []WorktreeLogSection)
LogDataFunc returns the current logs, checked branches, and worktree sections. It is called to refresh the log data on each poll iteration.
type ProgressIndicator ¶
type ProgressIndicator struct {
// contains filtered or unexported fields
}
func NewProgressIndicator ¶
func NewProgressIndicator(titles []string) *ProgressIndicator
* Creates one progress bar for each message.
func (*ProgressIndicator) Quit ¶
func (p *ProgressIndicator) Quit()
func (*ProgressIndicator) SendErrorOnPanic ¶
func (p *ProgressIndicator) SendErrorOnPanic()
func (*ProgressIndicator) SetLogLine ¶
func (p *ProgressIndicator) SetLogLine(index int, logLine string)
func (*ProgressIndicator) SetProgress ¶
func (p *ProgressIndicator) SetProgress(index int, progress float64)
type WorktreeLogSection ¶ added in v2.1.1
WorktreeLogSection represents commits from another worktree directory.
type WorktreeOption ¶ added in v2.1.1
WorktreeOption represents a worktree that can be selected.