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
- func ButtonLabel(d version.Descriptor) string
- func FailureToast(outcome version.InstallOutcome) string
- type Model
- func (m *Model) ApplyResult(outcome version.InstallOutcome)
- func (m *Model) Busy() bool
- func (m *Model) CanInstall() bool
- func (m *Model) DisplayCommand() string
- func (m *Model) HandleClick() tea.Cmd
- func (m *Model) HandleKey(msg tea.KeyMsg) tea.Cmd
- func (m *Model) RenderButton(focused, hover bool) string
- func (m *Model) RenderProblem() string
- func (m *Model) RenderProgress() string
- func (m *Model) Start() tea.Cmd
- func (m *Model) Tick()
- type Phase
- type ResultMsg
Constants ¶
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 ¶
func New(d version.Descriptor, env *version.Environment) *Model
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) CanInstall ¶
CanInstall reports that Sidecar has a command it is willing to run.
func (*Model) DisplayCommand ¶
DisplayCommand is the exact string confirmation and execution share.
func (*Model) HandleClick ¶
HandleClick confirms when the pointer is on the install button.
func (*Model) RenderButton ¶
RenderButton paints the padded install pill. focused is the keyboard highlight; hover is the pointer.
func (*Model) RenderProblem ¶
RenderProblem is the last failure, if any.
func (*Model) RenderProgress ¶
RenderProgress is the in-flight line: spinner plus the command that is running, so the user can still see what they confirmed.