tui

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package tui provides Bubble Tea commands for the terminal user interface.

Package tui provides keybindings for the terminal user interface.

Package tui provides the Bubble Tea model for the terminal user interface.

Package tui provides styling for the terminal user interface.

Package tui provides types for the terminal user interface.

Index

Constants

This section is empty.

Variables

View Source
var (
	// TitleStyle is the style for the application title
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(lipgloss.Color("#FAFAFA")).
				Background(lipgloss.Color("#7D56F4")).
				Padding(0, 1).
				MarginBottom(1)

	// NormalRowStyle is the style for a normal row in the list
	NormalRowStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#EEEEEE"))

	// SelectedRowStyle is the style for the currently selected row
	SelectedRowStyle = lipgloss.NewStyle().
						Bold(true).
						Foreground(lipgloss.Color("#7D56F4"))

	// MarkedRowStyle is the style for a row marked for deletion
	MarkedRowStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#FF5F87"))

	// MarkedSelectedRowStyle is the style for a marked row that is also selected
	MarkedSelectedRowStyle = lipgloss.NewStyle().
							Bold(true).
							Foreground(lipgloss.Color("#FF5F87")).
							Underline(true)

	// DeletedRowStyle is the style for a row that has been deleted
	DeletedRowStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#4A4A4A")).
					Strikethrough(true)

	// ColumnHeaderStyle is the style for table column headers
	ColumnHeaderStyle = lipgloss.NewStyle().
						Bold(true).
						Foreground(lipgloss.Color("#7D56F4")).
						Border(lipgloss.NormalBorder(), false, false, true, false)

	// StatusBarStyle is the style for the status bar at the bottom
	StatusBarStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#FAFAFA")).
					Background(lipgloss.Color("#3C3C3C")).
					Padding(0, 1)

	// SearchStyle is the style for the search prompt and input
	SearchStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("#00D7FF")).
				Bold(true)

	// ConfirmStyle is the style for confirmation prompts
	ConfirmStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#FFAF00")).
					Bold(true)

	// ProgressStyle is the style for progress bars
	ProgressStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#00D700"))

	// ErrorStyle is the style for error messages
	ErrorStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("#FF0000")).
				Bold(true)

	// SuccessStyle is the style for success messages
	SuccessStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#00FF00")).
					Bold(true)

	// StarStyle is the style for repository stars
	StarStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("#FFFF00"))
)

Functions

This section is empty.

Types

type AppState

type AppState int

AppState represents the current state of the TUI application.

const (
	StateLoading AppState = iota
	StateList
	StateSearch
	StateConfirm
	StateDeleting
	StateError
)

type Config

type Config struct {
	Owner         string
	FilterOptions filter.FilterOptions
	SortOptions   filter.SortOptions
}

Config holds the application configuration.

type KeyMap

type KeyMap struct {
	Up            key.Binding
	Down          key.Binding
	ToggleMark    key.Binding
	ConfirmDelete key.Binding
	Search        key.Binding
	SelectAll     key.Binding
	Quit          key.Binding
	PageUp        key.Binding
	PageDown      key.Binding
	Home          key.Binding
	End           key.Binding
	Help          key.Binding
	Esc           key.Binding
}

KeyMap defines the keybindings for the TUI

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default keybindings

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

FullHelp returns a slice of keybindings for the full help view

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

ShortHelp returns a slice of keybindings for the short help view

type Model

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

Model represents the TUI application state.

func New

func New(client *github.Client, filterOpts filter.FilterOptions, sortOpts filter.SortOptions) Model

New 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 and updates the model.

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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