tui

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package tui provides a terminal UI for Queen migrations.

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().
				Background(subtleBg).
				Foreground(textColor).
				Padding(0, 2)

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

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

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

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

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

	// Footer
	FooterStyle = lipgloss.NewStyle().
				Background(subtleBg).
				Foreground(dimColor).
				Padding(0, 2)

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

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

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

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

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

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

	// List items
	SelectedStyle = lipgloss.NewStyle().
					Background(selectedBg).
					Bold(true)

	NormalStyle = lipgloss.NewStyle()

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

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

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

	// Progress bar
	ProgressFilledStyle = lipgloss.NewStyle().
						Foreground(successColor)

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

	// Scroll indicators
	ScrollIndicatorStyle = lipgloss.NewStyle().
							Foreground(dimColor).
							Italic(true)

	// Messages
	SuccessMsgStyle = lipgloss.NewStyle().
					Foreground(successColor).
					Bold(true)

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

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

	// Info box (used in help view)
	InfoBoxStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(borderColor).
					Padding(1, 3)

	// Gap type badges
	GapTypeBadgeStyle = lipgloss.NewStyle().
						Foreground(dimColor)

	// Destructive badge
	DestructiveBadgeStyle = lipgloss.NewStyle().
							Foreground(errorColor).
							Bold(true)

	// Rollback badge
	RollbackBadgeStyle = lipgloss.NewStyle().
						Foreground(successColor)

	// Separator
	SeparatorStyle = lipgloss.NewStyle().
					Foreground(borderColor)

	// Help key style
	HelpKeyStyle = lipgloss.NewStyle().
					Foreground(accentColor).
					Bold(true)

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

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

Functions

This section is empty.

Types

type InitModel added in v0.5.0

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

func NewInitModel added in v0.5.0

func NewInitModel() *InitModel

func (*InitModel) Init added in v0.5.0

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

func (*InitModel) Result added in v0.5.0

func (m *InitModel) Result() *InitResult

func (*InitModel) Update added in v0.5.0

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

func (*InitModel) View added in v0.5.0

func (m *InitModel) View() string

type InitResult added in v0.5.0

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)

Update handles messages and updates the model.

func (*Model) View

func (m *Model) View() string

View renders the UI.

type ViewMode

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

Jump to

Keyboard shortcuts

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