tui

package
v0.0.0-...-a0ca902 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package tui provides Bubble Tea models for the interactive TUI.

Index

Constants

This section is empty.

Variables

View Source
var (
	// TitleStyle is used for screen titles.
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(lipgloss.Color("62")).
				MarginBottom(1)

	// SelectedItemStyle is used for highlighted/selected items.
	SelectedItemStyle = lipgloss.NewStyle().
						Foreground(lipgloss.Color("170")).
						Bold(true)

	// NormalItemStyle is used for non-selected items.
	NormalItemStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("252")) // Light gray

	// ErrorStyle is used for error messages.
	ErrorStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("196")).
				Bold(true)

	// PromptStyle is used for prompt text.
	PromptStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("99")).
				MarginBottom(1)

	// HelpStyle is used for help text.
	HelpStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("241")).
				MarginTop(1)
)
View Source
var (
	// HelpOverlayStyle defines the style for the help overlay container.
	HelpOverlayStyle = lipgloss.NewStyle().
		Border(lipgloss.RoundedBorder()).
		BorderForeground(lipgloss.Color("62")).
		Padding(1, 2).
		MarginTop(2)
)

Functions

This section is empty.

Types

type AppModel

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

AppModel is the root Bubble Tea model that manages screen transitions. It orchestrates the flow from owner selection -> project selection -> field selection -> board view.

func NewAppModel

func NewAppModel(client *gh.Client, store *store.Store, ctx context.Context, ownerFlag string, projectFlag int, groupFieldFlag string) AppModel

NewAppModel creates a new app model with optional CLI flag values. Pass empty string or 0 to skip pre-filling.

func (AppModel) Init

func (m AppModel) Init() tea.Cmd

Init initializes the app model.

func (AppModel) Update

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

Update handles messages and transitions between screens.

func (AppModel) View

func (m AppModel) View() string

View renders the current screen.

type AppScreen

type AppScreen int

AppScreen represents the different screens in the application flow.

const (
	ScreenLoading AppScreen = iota
	ScreenOwner
	ScreenProjectPicker
	ScreenFieldPicker
	ScreenBoard
	ScreenDetail
)

type BoardModel

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

BoardModel represents the main kanban board view

func NewBoardModel

func NewBoardModel(s *store.Store, client *gh.Client, ctx context.Context) BoardModel

NewBoardModel creates a new board model

func (BoardModel) Init

func (m BoardModel) Init() tea.Cmd

Init initializes the board and starts background loading

func (BoardModel) Update

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

Update handles messages

func (BoardModel) View

func (m BoardModel) View() string

View renders the board - fills entire terminal exactly

type DetailModel

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

DetailModel represents the card detail view with split-screen layout

func NewDetailModel

func NewDetailModel(card *domain.Card, client *gh.Client, ctx context.Context) DetailModel

NewDetailModel creates a new detail view model

func (DetailModel) Init

func (m DetailModel) Init() tea.Cmd

Init initializes the detail model

func (DetailModel) Update

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

Update handles messages

func (DetailModel) View

func (m DetailModel) View() string

View renders the split-screen detail view

type ErrorMsg

type ErrorMsg struct {
	Err error
}

ErrorMsg is emitted when an error occurs.

type FieldSelectedMsg

type FieldSelectedMsg struct {
	Field domain.FieldDef
}

FieldSelectedMsg is emitted when the user selects a grouping field.

type GroupFieldPickerModel

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

GroupFieldPickerModel displays a list of SINGLE_SELECT fields for the user to select. This model is auto-skipped if a "Status" field exists or only one option is available.

func NewGroupFieldPickerModel

func NewGroupFieldPickerModel(fields []domain.FieldDef) GroupFieldPickerModel

NewGroupFieldPickerModel creates a new GroupFieldPickerModel.

func (GroupFieldPickerModel) Init

func (m GroupFieldPickerModel) Init() tea.Cmd

Init initializes the model.

func (GroupFieldPickerModel) Update

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

Update handles messages and updates the model state.

func (GroupFieldPickerModel) View

func (m GroupFieldPickerModel) View() string

View renders the model.

type HelpModel

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

HelpModel wraps the bubbles help component.

func NewHelpModel

func NewHelpModel(keymap KeyMap) HelpModel

NewHelpModel creates a new help overlay model.

func (HelpModel) View

func (m HelpModel) View(width int) string

View renders the help overlay.

type KeyMap

type KeyMap struct {
	// Navigation
	Left  key.Binding
	Right key.Binding
	Up    key.Binding
	Down  key.Binding

	// Actions
	Move         key.Binding
	Open         key.Binding
	Filter       key.Binding
	Refresh      key.Binding
	LoadMore     key.Binding
	ChangeGroup  key.Binding
	Help         key.Binding
	Quit         key.Binding
	ConfirmQuit  key.Binding
	CancelQuit   key.Binding
	ApplyFilter  key.Binding
	CancelFilter key.Binding
}

KeyMap defines all key bindings for the board view.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default key bindings.

func (KeyMap) FullHelp

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

FullHelp returns key bindings for the expanded help view.

func (KeyMap) ShortHelp

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

ShortHelp returns key bindings to be shown in the mini help view.

type OwnerPickerModel

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

OwnerPickerModel lets the user select from available owners.

func NewOwnerPickerModel

func NewOwnerPickerModel(owners []gh.Owner) OwnerPickerModel

NewOwnerPickerModel creates a new owner picker with the given owners.

func (OwnerPickerModel) Init

func (m OwnerPickerModel) Init() tea.Cmd

Init initializes the model.

func (OwnerPickerModel) Update

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

Update handles messages.

func (OwnerPickerModel) View

func (m OwnerPickerModel) View() string

View renders the model.

type OwnerSelectedMsg

type OwnerSelectedMsg struct {
	Owner     string
	OwnerType gh.OwnerType // Pre-resolved owner type (if available)
	OwnerID   string       // Pre-resolved owner ID (if available)
}

OwnerSelectedMsg is emitted when the user selects an owner.

type ProjectPickerModel

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

ProjectPickerModel displays a list of projects for the user to select.

func NewProjectPickerModel

func NewProjectPickerModel(projects []domain.Project) ProjectPickerModel

NewProjectPickerModel creates a new ProjectPickerModel.

func (ProjectPickerModel) Init

func (m ProjectPickerModel) Init() tea.Cmd

Init initializes the model.

func (ProjectPickerModel) Update

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

Update handles messages and updates the model state.

func (ProjectPickerModel) View

func (m ProjectPickerModel) View() string

View renders the model.

type ProjectSelectedMsg

type ProjectSelectedMsg struct {
	Project domain.Project
}

ProjectSelectedMsg is emitted when the user selects a project.

type QuitMsg

type QuitMsg struct{}

QuitMsg is emitted when the user requests to quit.

Jump to

Keyboard shortcuts

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