tui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package tui is the bubbletea terminal UI behind `capysquash tui` and the --tui flags.

Index

Constants

View Source
const (
	ViewDashboard       = viewtypes.ViewDashboard
	ViewAnalysis        = viewtypes.ViewAnalysis
	ViewConfig          = viewtypes.ViewConfig
	ViewDependencyGraph = viewtypes.ViewDependencyGraph
	ViewProgress        = viewtypes.ViewProgress
	ViewHelp            = viewtypes.ViewHelp
	ViewValidation      = viewtypes.ViewValidation
)

Variables

This section is empty.

Functions

func Launch

func Launch(migrationDir, configPath string) error

Launch is a convenience function that creates and runs a TUI in one step. This is the simplest way to start the TUI with default settings.

Example:

if err := tui.Launch("./migrations", "capysquash.config.json"); err != nil {
	log.Fatal(err)
}

func LaunchWithView

func LaunchWithView(migrationDir, configPath string, view ViewType) error

LaunchWithView is a convenience function that creates and runs a TUI, immediately navigating to the specified view.

Example:

// Launch directly into analysis view
if err := tui.LaunchWithView("./migrations", "", tui.ViewAnalysis); err != nil {
	log.Fatal(err)
}

Types

type AnalysisCompleteMsg

type AnalysisCompleteMsg = viewtypes.AnalysisCompleteMsg

Re-export message types for convenience

type AnalysisStats

type AnalysisStats = viewtypes.AnalysisStats

Re-export message types for convenience

type ConfigSavedMsg

type ConfigSavedMsg = viewtypes.ConfigSavedMsg

Re-export message types for convenience

type DependencyInfo

type DependencyInfo = viewtypes.DependencyInfo

Re-export message types for convenience

type ErrorMsg

type ErrorMsg = viewtypes.ErrorMsg

Re-export message types for convenience

type LifecyclePattern

type LifecyclePattern = viewtypes.LifecyclePattern

Re-export message types for convenience

type LoadedMsg

type LoadedMsg = viewtypes.LoadedMsg

Re-export message types for convenience

type LoadingMsg

type LoadingMsg = viewtypes.LoadingMsg

Re-export message types for convenience

type Model

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

Model is the main TUI application model

func NewModel

func NewModel(migrationDir, configPath string) *Model

NewModel creates a new TUI model

func (*Model) Init

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

Init initializes the TUI

func (*Model) Update

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

Update handles messages

func (*Model) View

func (m *Model) View() string

View renders the TUI

type NavigateMsg = viewtypes.NavigateMsg

Re-export message types for convenience

type SquashCompleteMsg

type SquashCompleteMsg = viewtypes.SquashCompleteMsg

Re-export message types for convenience

type SquashStats

type SquashStats = viewtypes.SquashStats

Re-export message types for convenience

type SuccessMsg

type SuccessMsg = viewtypes.SuccessMsg

Re-export message types for convenience

type View

type View = viewtypes.View

Re-export View for convenience

type ViewType

type ViewType = viewtypes.ViewType

Re-export types for convenience

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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