This repository is a collection of reusable TUI components for Bubble Tea.
Current primary component:
Pipelinecomponent (tui.PipelineModel), which renders and controls a dependency graph of pipeline steps.
- Single public package:
tui(import path:tui/tui). - Domain types and UI model live in the same package.
type StepID stringtype StepVisualStatus stringtype StepSpec struct { ID StepID; Status StepVisualStatus; JobName string; DependsOn []StepID }type PipelineSpec struct { ID string; Steps []StepSpec }type PipelineModel struct(Bubble Tea model)
StatusBlackStatusGrayStatusGreenStatusRedStatusYellowStatusBlueStatusOrangeStatusPurple
NewPipelineSpec(id string, steps []StepSpec) PipelineSpec
NewPipelineModel(spec PipelineSpec) PipelineModel
SetStepStatus(stepID StepID, status StepVisualStatus) errorSetStepSpinner(stepID StepID, spinning bool) errorSetStepSelected(stepID StepID) error(""clears selection)
SetStepStatusMsgSetStepSpinnerMsgSetStepSelectedMsg
- Full-screen Bubble Tea-friendly rendering.
- Graph is padded by 1 line top and bottom.
- Left/right padding is 1 char when width allows.
- Horizontal/vertical scrolling supported via viewport offsets.
- Label format:
" <job-name> "(2 spaces on each side). - Spinner replaces last rune in the label when enabled.
- Width = rune count of
job-name+ 4. - No border.
- Selected step uses
SelectedBg/SelectedFgtheme colors. - Selection also highlights upstream and downstream edges.
- Connectors are drawn directly with box-drawing glyphs on a canvas.
- Highlighted edges use
ArrowSelectedColor, non-highlighted useArrowColor.
q/ctrl+c: quit.h,j,k,lor arrows: scroll.
ContentBackground,ContentForegroundStatusBlackBg/FgStatusGrayBg/FgStatusGreenBg/FgStatusRedBg/FgStatusYellowBg/FgStatusBlueBg/FgStatusOrangeBg/FgStatusPurpleBg/FgSelectedBg,SelectedFgArrowColor,ArrowSelectedColor