ui

package
v1.0.112 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package ui provides interactive CLI menus, progress checklists, visual detection summaries, and actionable error guidance for gamux.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanBBCode added in v1.0.108

func CleanBBCode(input string) string

CleanBBCode strips Steam community BBCode tags for clean terminal rendering.

func ClearProgress added in v1.0.108

func ClearProgress()

ClearProgress clears the current progress bar line in the terminal.

func FormatBytes added in v1.0.107

func FormatBytes(b int64) string

FormatBytes formats byte counts into human-readable strings (e.g. 1.29 GiB).

func NotifyIssue added in v1.0.109

func NotifyIssue(ctx context.Context, title, message string) error

NotifyIssue presents an alert on the console (stderr) and sends a non-intrusive desktop notification via notify-send if available.

func PromptSelectPlatform added in v1.0.107

func PromptSelectPlatform(gameTitle string, availablePlatforms []string) (string, error)

PromptSelectPlatform presents an interactive choice for target platform/depot selection.

func PromptString

func PromptString(promptText string, defaultValue string) string

PromptString asks for text input with a default value.

func PromptYesNoWithExplanation

func PromptYesNoWithExplanation(question string, explanation string, defaultYes bool) bool

PromptYesNoWithExplanation asks a yes/no question with an explanatory hint.

func RenderAppHelp added in v1.0.105

func RenderAppHelp(app *cli.App, version string)

RenderAppHelp displays a clean, concise, single-source workflow guide from cli.App.

func RenderCommandHelp added in v1.0.109

func RenderCommandHelp(cmd *cli.Command, version string)

RenderCommandHelp displays clean formatted help for a specific subcommand.

func RenderConfigSummary added in v1.0.109

func RenderConfigSummary(cfg *config.Config, configPath string)

RenderConfigSummary displays a formatted dashboard of all configuration fields.

func RenderDetectionSummary

func RenderDetectionSummary(info DetectionInfoSummary)

RenderDetectionSummary prints a visual preview of detected game metadata.

func RenderErrorHelp

func RenderErrorHelp(err error, suggestedActions []string)

RenderErrorHelp displays a formatted error diagnostic box with suggested actions.

func RenderHeader

func RenderHeader(version string)

RenderHeader displays the application banner and version.

func RenderNewsItem added in v1.0.107

func RenderNewsItem(gameTitle string, index int, title, feedLabel, contents, url string, date int64)

RenderNewsItem prints a full, clean formatted patch note item.

func RenderProgress added in v1.0.108

func RenderProgress(current, total int, item string)

RenderProgress renders a clean single-line progress bar with current/total count and item label.

func RenderStep

func RenderStep(stepNum, totalSteps int, title string)

RenderStep prints a progress step indicator.

func RenderSubStep

func RenderSubStep(symbol, message string)

RenderSubStep prints a detail item under the current step.

func RenderSuccess

func RenderSuccess(title, details string, nextSteps []string)

RenderSuccess prints a final success summary box.

func RenderTerseHeader added in v1.0.108

func RenderTerseHeader(parentDir string, totalGames int)

RenderTerseHeader outputs a clean section header for batch/terse inspection.

func RenderTerseStatus added in v1.0.108

func RenderTerseStatus(info DetectionInfoSummary)

RenderTerseStatus prints a crisp 2-line card for a game directory.

func RenderTerseSummary added in v1.0.108

func RenderTerseSummary(total, loaderCount, cleanCount, updatesAvail, lutrisCount int)

RenderTerseSummary prints summary stats after batch inspection.

func RunConfigWizard added in v1.0.109

func RunConfigWizard(cfg *config.Config, configPath string) error

RunConfigWizard guides the user interactively through updating their configuration.

Types

type CandidateItem added in v1.0.107

type CandidateItem struct {
	AppID uint32
	Name  string
}

CandidateItem holds metadata for presenting an AppID selection prompt.

func PromptSelectCandidate added in v1.0.107

func PromptSelectCandidate(query string, candidates []CandidateItem) (CandidateItem, error)

PromptSelectCandidate presents an interactive menu to disambiguate game title search matches.

type DetectionInfoSummary

type DetectionInfoSummary struct {
	Name     string
	AppID    string
	Store    string
	Platform string

	GameDir           string
	ExePath           string
	LaunchCandidates  []LaunchCandidateSummary
	State             string
	OriginalBackups   int
	ManifestID        string
	BuildID           string
	DiskSizeBytes     int64
	FileCount         int
	OfficialFileCount int
	ModifiedFiles     []string
	MissingFiles      []string
	UntrackedFiles    []string
	HasUpdate         bool
	RemoteManifestID  string
	DLCCount          int
	AchievementCount  int
	LutrisRegistered  bool
	RecentPatchNote   string
	NewsItems         []NewsItemSummary
}

DetectionInfoSummary holds metadata for displaying a rich game status dashboard.

type LaunchCandidateSummary added in v1.0.112

type LaunchCandidateSummary struct {
	Name        string
	Executable  string
	Arguments   string
	Description string
}

LaunchCandidateSummary holds information about an executable launch option.

func PromptSelectLaunchOption added in v1.0.107

func PromptSelectLaunchOption(gameTitle string, candidates []LaunchCandidateSummary) (LaunchCandidateSummary, error)

PromptSelectLaunchOption presents an interactive choice for executable / launch option selection.

type NewsItemSummary added in v1.0.107

type NewsItemSummary struct {
	Title     string
	FeedLabel string
	Date      int64
	URL       string
}

NewsItemSummary holds metadata for rendering patch notes.

Jump to

Keyboard shortcuts

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