ui

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Colors for different message types
	Success = color.New(color.FgGreen, color.Bold)
	Error   = color.New(color.FgRed, color.Bold)
	Warning = color.New(color.FgYellow, color.Bold)
	Info    = color.New(color.FgCyan, color.Bold)
	Accent  = color.New(color.FgMagenta, color.Bold)
	Dim     = color.New(color.FgHiBlack)

	// Emojis with colors
	MateEmoji    = "🧉"
	SuccessEmoji = Success.Sprint("✅")
	WarningEmoji = Warning.Sprint("⚠️")
	InfoEmoji    = Info.Sprint("ℹ️")
	RocketEmoji  = Accent.Sprint("🚀")
	StatsEmoji   = Accent.Sprint("📊")
)

Functions

func AskConfirmation

func AskConfirmation(question string) bool

func EditCommitMessage

func EditCommitMessage(initialMessage string, editorErrorMsg string) (string, error)

EditCommitMessage opens an editor for the user to edit the message

func HandleAppError

func HandleAppError(err error, translations ...*i18n.Translations)

HandleAppError handles an application error and displays it in a friendly way. If translations is nil, it will use English defaults.

func PrintDuration

func PrintDuration(msg string, duration time.Duration)

func PrintError

func PrintError(w io.Writer, msg string)

func PrintInfo

func PrintInfo(msg string)

func PrintKeyValue

func PrintKeyValue(key, value string)

func PrintSectionBanner

func PrintSectionBanner(title string)

func PrintSectionHeader added in v1.7.0

func PrintSectionHeader(title string)

PrintSectionHeader prints a visually distinct section header

func PrintSuccess

func PrintSuccess(w io.Writer, msg string)

func PrintTokenUsage

func PrintTokenUsage(usage *models.TokenUsage, t *i18n.Translations)

func PrintWarning

func PrintWarning(msg string)

func PromptMultiSelect added in v1.8.0

func PromptMultiSelect(t *i18n.Translations, message string, options []string) ([]string, error)

PromptMultiSelect presents a numbered list of options and asks the user to input comma-separated choices (e.g. "1,3"). Hitting enter without choices defaults to all.

func ResumeSuspendedSpinner

func ResumeSuspendedSpinner()

ResumeSuspendedSpinner resumes the previously suspended spinner.

func ShowDiff

func ShowDiff(files []string) error

func ShowDiffStats

func ShowDiffStats(files []string, headerMessage string) error

ShowDiffStats shows change statistics (like git diff --stat)

func ShowFilesTree

func ShowFilesTree(files []string, headerMessage string) error

ShowFilesTree shows modified files in tree format

func SuspendActiveSpinner

func SuspendActiveSpinner()

SuspendActiveSpinner temporarily stops the active spinner without deleting its reference, allowing it to be resumed after user interaction.

Types

type FileChange

type FileChange struct {
	Path      string
	Additions int
	Deletions int
}

FileChange represents a modified file with its statistics

type SmartSpinner

type SmartSpinner struct {
	// contains filtered or unexported fields
}

SmartSpinner is a spinner with enhanced capabilities

func NewSmartSpinner

func NewSmartSpinner(initialMessage string) *SmartSpinner

NewSmartSpinner creates a new spinner with an initial message

func (*SmartSpinner) Error

func (s *SmartSpinner) Error(msg string)

func (*SmartSpinner) Log

func (s *SmartSpinner) Log(msg string)

func (*SmartSpinner) Start

func (s *SmartSpinner) Start()

Start starts the spinner and registers it as the globally active spinner.

func (*SmartSpinner) Stop

func (s *SmartSpinner) Stop()

Stop stops the spinner and clears the active spinner record.

func (*SmartSpinner) Success

func (s *SmartSpinner) Success(msg string)

func (*SmartSpinner) UpdateMessage

func (s *SmartSpinner) UpdateMessage(msg string)

func (*SmartSpinner) Warning

func (s *SmartSpinner) Warning(msg string)

Jump to

Keyboard shortcuts

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