Skip to content

feat(ui): installer-style terminal UX package (internal/ui) #26

Description

@aptracebloc

Goal

Give every command the look-and-feel of the tracebloc/client one-line installer — colored step output, //· feedback, dim hints, a branded banner — via a small shared package. TTY-aware so piped/CI output stays clean.

Scope

  • New internal/ui package porting the installer vocabulary from tracebloc/client/scripts/lib/common.sh:
    • Step(n, total, label), Success, Warn, Info, Error, Hint, PromptHeader, Banner.
    • Palette via fatih/color matching the installer (cyan/green/yellow/red/dim/bold).
  • TTY + color gating: reuse the isTTY approach from internal/push/progress.go; honor NO_COLOR (https://no-color.org) and a global --plain flag; color only when stdout is a real terminal.
  • Refactor the ad-hoc fmt.Fprintf output in cluster info and dataset push pre-flight onto the new helpers (presentation only — no behavior change).

Acceptance criteria

  • internal/ui with the helper set + unit tests (color-on vs plain via an injectable writer / force-color toggle).
  • --plain and NO_COLOR both force plain; non-TTY auto-plains.
  • cluster info + dataset push pre-flight render via ui; existing tests pass/updated.
  • make ci green.

Go concepts we'll cover

  • A UX interface with TTY-aware implementations (same shape as the existing Progress interface in internal/push/progress.go).
  • ANSI/SGR escape basics + the NO_COLOR convention.
  • Adding a dependency cleanly (fatih/color, go.mod/go.sum discipline).

Notes

  • Decision locked: fatih/color (not lipgloss/bubbletea). Branch off develop; conventional commits; one PR.

Part of the UX/interactive epic.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions