tui

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package tui provides a terminal UI for Queen migrations.

Package tui provides a terminal UI for Queen migrations.

Index

Constants

This section is empty.

Variables

View Source
var (

	// Header
	HeaderStyle = lipgloss.NewStyle().
				Foreground(colorText).
				Padding(0, 2)

	AppTitleStyle = lipgloss.NewStyle().
					Foreground(colorYellow).
					Bold(true)

	AppSubtitleStyle = lipgloss.NewStyle().
						Foreground(colorYellowDim)

	StatusInfoStyle = lipgloss.NewStyle().
					Foreground(colorYellowWarm)

	StatusPillStyle = lipgloss.NewStyle().
					Background(colorAmber).
					Foreground(colorBg).
					Bold(true).
					Padding(0, 1)

	StatusDarkPillStyle = lipgloss.NewStyle().
						Background(selectedBg).
						Foreground(colorYellow).
						Bold(true).
						Padding(0, 1)

	HelpHintStyle = lipgloss.NewStyle().
					Foreground(colorMuted)

	// Tab bar
	ActiveTabStyle = lipgloss.NewStyle().
					Background(colorPrimary).
					Foreground(colorBg).
					Bold(true).
					Padding(0, 1)

	InactiveTabStyle = lipgloss.NewStyle().
						Foreground(colorMuted).
						Padding(0, 1)

	TabBadgeStyle = lipgloss.NewStyle().
					Foreground(colorRed).
					Bold(true)

	// Footer
	FooterStyle = lipgloss.NewStyle().
				Foreground(colorYellowDim).
				Padding(0, 2)

	FooterKeyStyle = lipgloss.NewStyle().
					Foreground(colorYellowWarm).
					Bold(true)

	FooterDescStyle = lipgloss.NewStyle().
					Foreground(colorMuted)

	// Content
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(colorYellow).
				MarginBottom(1)

	AppliedStyle = lipgloss.NewStyle().
					Foreground(colorGreen).
					Bold(true)

	PendingStyle = lipgloss.NewStyle().
					Foreground(colorAmber).
					Bold(true)

	ErrorStyle = lipgloss.NewStyle().
				Foreground(colorRed).
				Bold(true)

	SelectedStyle = lipgloss.NewStyle().
					Background(selectedBg).
					Foreground(colorText).
					Bold(true)

	SelectedMarkerStyle = lipgloss.NewStyle().
						Foreground(colorAmber).
						Bold(true)

	NormalStyle = lipgloss.NewStyle()

	VersionStyle = lipgloss.NewStyle().
					Foreground(colorYellowWarm)

	NameStyle = lipgloss.NewStyle().
				Foreground(colorText)

	DetailStyle = lipgloss.NewStyle().
				Foreground(colorMuted)

	ProgressFilledStyle = lipgloss.NewStyle().
						Foreground(colorYellow)

	ProgressEmptyStyle = lipgloss.NewStyle().
						Foreground(colorYellowDim)

	ScrollIndicatorStyle = lipgloss.NewStyle().
							Foreground(colorMuted).
							Italic(true)

	SuccessMsgStyle = lipgloss.NewStyle().
					Foreground(colorGreen).
					Bold(true)

	WarningMsgStyle = lipgloss.NewStyle().
					Foreground(colorAmber)

	ErrorMsgStyle = lipgloss.NewStyle().
					Foreground(colorRed).
					Bold(true)

	InfoBoxStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(colorYellowWarm).
					Padding(1, 3)

	DetailPanelStyle = lipgloss.NewStyle().
						Border(lipgloss.RoundedBorder()).
						BorderForeground(colorYellowDim).
						Padding(0, 1)

	PanelStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(colorYellowDim).
				Foreground(colorText)

	PanelActiveStyle = lipgloss.NewStyle().
						Border(lipgloss.RoundedBorder()).
						BorderForeground(colorYellow).
						Foreground(colorText)

	PanelTitleStyle = lipgloss.NewStyle().
					Foreground(colorYellow).
					Bold(true).
					Padding(0, 1)

	PanelSubtitleStyle = lipgloss.NewStyle().
						Foreground(colorMuted)

	GapTypeBadgeStyle = lipgloss.NewStyle().
						Foreground(colorMuted)

	DestructiveBadgeStyle = lipgloss.NewStyle().
							Foreground(colorRed).
							Bold(true)

	RollbackBadgeStyle = lipgloss.NewStyle().
						Foreground(colorGreen)

	SeparatorStyle = lipgloss.NewStyle().
					Foreground(colorYellowDim)

	HelpKeyStyle = lipgloss.NewStyle().
					Foreground(colorYellowWarm).
					Bold(true)

	HelpDescStyle = lipgloss.NewStyle().
					Foreground(colorText)

	HelpSectionStyle = lipgloss.NewStyle().
						Foreground(colorYellow).
						Bold(true)
)

Neutral terminal palette with amber reserved for warnings and pending work.

Functions

func RenderBanner

func RenderBanner() string

RenderBanner returns the wide QUEEN banner.

Types

type Focus

type Focus int

Focus represents which panel currently captures j/k input.

const (
	FocusList Focus = iota
	FocusDetail
	FocusTap
)

type InitModel

type InitModel struct {
	// contains filtered or unexported fields
}

func NewInitModel

func NewInitModel() *InitModel

func (*InitModel) Init

func (m *InitModel) Init() tea.Cmd

func (*InitModel) Result

func (m *InitModel) Result() *InitResult

func (*InitModel) Update

func (m *InitModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*InitModel) View

func (m *InitModel) View() string

type InitResult

type InitResult struct {
	Driver        string
	MigrationsDir string
	WithConfig    bool
	Confirmed     bool
}

type MessageType

type MessageType int
const (
	MessageInfo MessageType = iota
	MessageSuccess
	MessageWarning
	MessageError
)

type Model

type Model struct {
	// contains filtered or unexported fields
}

func NewModel

func NewModel(q *queen.Queen, ctx context.Context) *Model

func (*Model) Init

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

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Model) View

func (m *Model) View() string

View renders the main cockpit. The layout is intentionally component based: list, detail, and tap/explain each own their screen area.

type ViewMode

type ViewMode int
const (
	ViewMigrations ViewMode = iota
	ViewGaps
	ViewHelp
)

Directories

Path Synopsis
Package live renders a Bubble Tea live-view of queen migration tap events.
Package live renders a Bubble Tea live-view of queen migration tap events.

Jump to

Keyboard shortcuts

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