tui

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TargetFPS is the maximum frames per second we want to achieve
	TargetFPS = 60
	// FrameDuration is the minimum duration between frames
	FrameDuration = time.Second / TargetFPS

	// SpinnerFPS is the update rate for the spinner
	SpinnerFPS = 15
	// SpinnerDuration is the duration between spinner updates
	SpinnerDuration = time.Second / SpinnerFPS

	// JobCheckInterval is how often we check for running jobs status
	JobCheckInterval = 100 * time.Millisecond
)

Variables

View Source
var Version string

Version exposes the application version for use across the TUI.

Functions

func Run

func Run(mode string, directories []string) error

Run starts the TUI application

Types

type Mode

type Mode struct {
	ID            ModeID
	DisplayString string
	CommandString string
}

Mode represents the operation mode

type ModeID

type ModeID string

ModeID identifies the mode

const (
	PullMode   ModeID = "pull"
	MergeMode  ModeID = "merge"
	RebaseMode ModeID = "rebase"
	PushMode   ModeID = "push"
)

type Model

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

Model represents the main application state for Bubbletea

func New

func New(mode string, directories []string) *Model

New creates a new Model with the given configuration

func (*Model) Init

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

Init initializes the model

func (*Model) Update

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

Update handles all messages and updates the model

func (*Model) View

func (m *Model) View() string

View renders the UI

type SidePanelType

type SidePanelType int

SidePanelType represents which side panel is active

const (
	NonePanel SidePanelType = iota
	BranchPanel
	RemotePanel
	RemoteBranchPanel
	CommitPanel
	StashPanel
	StatusPanel
)

type Styles

type Styles struct {
	Title                   lipgloss.Style
	StatusBarPull           lipgloss.Style
	StatusBarMerge          lipgloss.Style
	StatusBarCredentials    lipgloss.Style
	StatusBarRebase         lipgloss.Style
	StatusBarPush           lipgloss.Style
	StatusBarDisabled       lipgloss.Style
	StatusBarError          lipgloss.Style
	Help                    lipgloss.Style
	List                    lipgloss.Style
	ListItem                lipgloss.Style
	CredentialsSelectedItem lipgloss.Style
	SelectedItem            lipgloss.Style
	DisabledSelectedItem    lipgloss.Style
	CommonSelectedItem      lipgloss.Style
	FailedSelectedItem      lipgloss.Style
	CredentialsItem         lipgloss.Style
	QueuedItem              lipgloss.Style
	PendingItem             lipgloss.Style
	WorkingItem             lipgloss.Style
	SuccessItem             lipgloss.Style
	FailedItem              lipgloss.Style
	DisabledItem            lipgloss.Style
	BranchInfo              lipgloss.Style
	KeyBinding              lipgloss.Style
	Panel                   lipgloss.Style
	PanelTitle              lipgloss.Style
	Error                   lipgloss.Style
	TableBorder             lipgloss.Style
}

Styles holds all lipgloss styles for the UI

func DefaultStyles

func DefaultStyles() *Styles

DefaultStyles returns the default style set

type ViewType

type ViewType int

ViewType represents the current view mode

const (
	OverviewView ViewType = iota
	FocusView
)

Jump to

Keyboard shortcuts

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