installui

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package installui is the shared first-install surface used by td's not-installed view and by Configuration's integration enable route.

The version package owns detection and execution. This package owns the tea.Cmd, the padded button label, the spinner, and the result message the host uses to re-probe PATH. Nothing here runs a package manager from Init or a render path.

Index

Constants

View Source
const RegionInstall = "install-product"

RegionInstall is the mouse hit-region ID for the install button.

Variables

This section is empty.

Functions

func ButtonLabel

func ButtonLabel(d version.Descriptor) string

ButtonLabel is the padded pill the user confirms. Spaces are part of the label so the hit box matches what is painted.

func FailureToast

func FailureToast(outcome version.InstallOutcome) string

FailureToast is the error line a host should surface without leaving this view. Empty when the attempt succeeded.

Types

type Model

type Model struct {
	Descriptor version.Descriptor
	Env        *version.Environment
	Plan       version.InstallPlan
	PlanErr    error
	Phase      Phase
	Problem    string
	Hover      bool
	Spinner    ui.BrailleSpinner
}

Model is the interactive install control: one padded button, the exact command it will run, and a spinner while that command is in flight.

func New

New builds an install control for d. PlanInstall runs here, not during sidecar startup: callers construct this after the not-installed view is already on screen.

func (*Model) ApplyResult

func (m *Model) ApplyResult(outcome version.InstallOutcome)

ApplyResult settles a finished attempt. Success is the host's to act on; failure stays on this control so the user can retry.

func (*Model) Busy

func (m *Model) Busy() bool

Busy reports that a confirmed install is still running.

func (*Model) CanInstall

func (m *Model) CanInstall() bool

CanInstall reports that Sidecar has a command it is willing to run.

func (*Model) DisplayCommand

func (m *Model) DisplayCommand() string

DisplayCommand is the exact string confirmation and execution share.

func (*Model) HandleClick

func (m *Model) HandleClick() tea.Cmd

HandleClick confirms when the pointer is on the install button.

func (*Model) HandleKey

func (m *Model) HandleKey(msg tea.KeyMsg) tea.Cmd

HandleKey treats Enter and i as confirmation of the focused button.

func (*Model) RenderButton

func (m *Model) RenderButton(focused, hover bool) string

RenderButton paints the padded install pill. focused is the keyboard highlight; hover is the pointer.

func (*Model) RenderProblem

func (m *Model) RenderProblem() string

RenderProblem is the last failure, if any.

func (*Model) RenderProgress

func (m *Model) RenderProgress() string

RenderProgress is the in-flight line: spinner plus the command that is running, so the user can still see what they confirmed.

func (*Model) Start

func (m *Model) Start() tea.Cmd

Start runs the displayed command. It is a no-op when there is nothing to run or an attempt is already in flight.

func (*Model) Tick

func (m *Model) Tick()

Tick advances the spinner. Call it from an existing animation tick so this control does not start a second ticker.

type Phase

type Phase uint8

Phase is where a confirmed install has got to.

const (
	PhaseIdle Phase = iota
	PhaseRunning
	PhaseFailed
)

type ResultMsg

type ResultMsg struct {
	Product version.ProductID
	Outcome version.InstallOutcome
}

ResultMsg is a finished first-install attempt. The host re-probes PATH on success and toasts on failure; this package does not.

Jump to

Keyboard shortcuts

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