Help us shape the future of Go! Take the 2026 Go Developer Survey

components

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package components provides reusable TUI components built on Bubble Tea.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetailsHints

func DetailsHints(hasWorkflow bool) []string

DetailsHints returns details panel hints

func GlobalHints

func GlobalHints() []string

GlobalHints returns the global keybinding hints

func NavigationHints(inGroup bool) []string

NavigationHints returns navigation panel hints

func RunsHints

func RunsHints() []string

RunsHints returns runs panel hints

func SidebarHints

func SidebarHints() []string

SidebarHints returns sidebar-specific hints

Types

type CmdPalette

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

func NewCmdPalette

func NewCmdPalette(t *theme.Theme) CmdPalette

func (*CmdPalette) Close

func (c *CmdPalette) Close()

func (*CmdPalette) IsActive

func (c *CmdPalette) IsActive() bool

func (*CmdPalette) Open

func (c *CmdPalette) Open()

func (*CmdPalette) SetCommands

func (c *CmdPalette) SetCommands(cmds []Command)

func (*CmdPalette) SetSize

func (c *CmdPalette) SetSize(width, height int)

func (*CmdPalette) Update

func (c *CmdPalette) Update(msg tea.Msg) (selectedCmd *Command, cmd tea.Cmd)

func (*CmdPalette) View

func (c *CmdPalette) View() string

type Command

type Command struct {
	Name        string
	Aliases     []string
	Description string
	Action      func() tea.Cmd
}

func DefaultCommands

func DefaultCommands(actions map[string]func() tea.Cmd) []Command

type Details

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

Details displays workflow details and recent runs preview

func NewDetails

func NewDetails(t *theme.Theme) Details

NewDetails creates a new details component

func (*Details) Clear

func (d *Details) Clear()

Clear clears the details panel

func (*Details) IsFocused

func (d *Details) IsFocused() bool

IsFocused returns focus state

func (*Details) SetError

func (d *Details) SetError(err error)

SetError sets error state

func (*Details) SetFocused

func (d *Details) SetFocused(focused bool)

SetFocused sets focus state

func (*Details) SetLoading

func (d *Details) SetLoading(loading bool)

SetLoading sets loading state

func (*Details) SetRuns

func (d *Details) SetRuns(runs []models.GHRun)

SetRuns sets the workflow runs

func (*Details) SetSize

func (d *Details) SetSize(width, height int)

SetSize sets dimensions

func (*Details) SetWorkflow

func (d *Details) SetWorkflow(name string)

SetWorkflow sets the current workflow

func (*Details) View

func (d *Details) View() string

View renders the details panel

func (*Details) WorkflowName

func (d *Details) WorkflowName() string

WorkflowName returns current workflow

type HelpBar

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

HelpBar displays context-sensitive keybindings

func NewHelpBar

func NewHelpBar(t *theme.Theme) HelpBar

NewHelpBar creates a new help bar

func (*HelpBar) SetHints

func (h *HelpBar) SetHints(hints []string)

SetHints sets the keybinding hints

func (*HelpBar) SetSize

func (h *HelpBar) SetSize(width int)

SetSize sets the width

func (*HelpBar) View

func (h *HelpBar) View() string

View renders the help bar

type HelpOverlay

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

func NewHelpOverlay

func NewHelpOverlay(t *theme.Theme) HelpOverlay

func (*HelpOverlay) Close

func (h *HelpOverlay) Close()

func (*HelpOverlay) IsActive

func (h *HelpOverlay) IsActive() bool

func (*HelpOverlay) SetSize

func (h *HelpOverlay) SetSize(width, height int)

func (*HelpOverlay) Toggle

func (h *HelpOverlay) Toggle()

func (*HelpOverlay) Update

func (h *HelpOverlay) Update(msg tea.Msg) tea.Cmd

func (*HelpOverlay) View

func (h *HelpOverlay) View() string

type KeyBinding

type KeyBinding struct {
	Key         string
	Description string
}

type KeySection

type KeySection struct {
	Title    string
	Bindings []KeyBinding
}

func DefaultKeySections

func DefaultKeySections() []KeySection

type List

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

List is a filterable, navigable list component

func NewList

func NewList(t *theme.Theme, title string) List

NewList creates a new list component

func (*List) ClearFilter

func (l *List) ClearFilter()

ClearFilter clears the filter

func (*List) Cursor

func (l *List) Cursor() int

Cursor returns the current cursor position

func (*List) FilterInput

func (l *List) FilterInput() string

FilterInput returns the current filter text

func (*List) FilteredItems

func (l *List) FilteredItems() []ListItem

FilteredItems returns the currently visible (filtered) items

func (*List) HasFilter

func (l *List) HasFilter() bool

HasFilter returns whether a filter is applied

func (*List) IsFiltering

func (l *List) IsFiltering() bool

IsFiltering returns whether filter mode is active

func (*List) IsFocused

func (l *List) IsFocused() bool

IsFocused returns the focus state

func (*List) Items

func (l *List) Items() []ListItem

Items returns all items

func (*List) SelectedItem

func (l *List) SelectedItem() *ListItem

SelectedItem returns the currently selected item, or nil if none

func (*List) SetCursor

func (l *List) SetCursor(pos int)

SetCursor sets the cursor position

func (*List) SetFocused

func (l *List) SetFocused(focused bool)

SetFocused sets the focus state

func (*List) SetItems

func (l *List) SetItems(items []ListItem)

SetItems sets the list items

func (*List) SetSize

func (l *List) SetSize(width, height int)

SetSize sets the dimensions

func (*List) SetTitle

func (l *List) SetTitle(title string)

SetTitle sets the list title

func (*List) StartFilter

func (l *List) StartFilter()

StartFilter begins filter input mode

func (*List) Update

func (l *List) Update(msg tea.Msg) tea.Cmd

Update handles input messages

func (*List) View

func (l *List) View() string

View renders the list

type ListItem

type ListItem struct {
	ID          string
	Title       string
	Description string
	Icon        string
	Data        interface{} // Arbitrary data attached to the item
}

ListItem represents an item in the list

func (ListItem) FilterValue

func (i ListItem) FilterValue() string

FilterValue implements fuzzy.Source

type PinnedItem

type PinnedItem struct {
	WorkflowName string
	GroupName    string
	GroupID      string
	Data         interface{} // Reference to the group for actions
}

PinnedItem represents a pinned workflow in the sidebar

type RunsTable

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

RunsTable displays workflow runs in a table

func NewRunsTable

func NewRunsTable(t *theme.Theme) RunsTable

NewRunsTable creates a new runs table component

func NewRunsTablePtr

func NewRunsTablePtr(t *theme.Theme) *RunsTable

NewRunsTablePtr creates a new runs table component as a pointer

func (*RunsTable) IsFocused

func (r *RunsTable) IsFocused() bool

IsFocused returns focus state

func (*RunsTable) IsVisible

func (r *RunsTable) IsVisible() bool

IsVisible returns visibility

func (*RunsTable) Runs

func (r *RunsTable) Runs() []models.GHRun

Runs returns the current runs

func (*RunsTable) SelectedRunID

func (r *RunsTable) SelectedRunID() int

SelectedRunID returns the ID of the selected run

func (*RunsTable) SetError

func (r *RunsTable) SetError(err error)

SetError sets error state

func (*RunsTable) SetFocused

func (r *RunsTable) SetFocused(focused bool)

SetFocused sets focus state

func (*RunsTable) SetLoading

func (r *RunsTable) SetLoading(loading bool)

SetLoading sets loading state

func (*RunsTable) SetRuns

func (r *RunsTable) SetRuns(runs []models.GHRun, workflowName string)

SetRuns sets the workflow runs data

func (*RunsTable) SetSize

func (r *RunsTable) SetSize(width, height int)

SetSize sets dimensions

func (*RunsTable) SetVisible

func (r *RunsTable) SetVisible(visible bool)

SetVisible sets visibility

func (*RunsTable) Toggle

func (r *RunsTable) Toggle()

Toggle toggles visibility

func (*RunsTable) Update

func (r *RunsTable) Update(msg tea.Msg) tea.Cmd

func (*RunsTable) View

func (r *RunsTable) View() string

func (*RunsTable) WorkflowName

func (r *RunsTable) WorkflowName() string

WorkflowName returns the current workflow name

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

Search is a global search overlay component

func NewSearch

func NewSearch(t *theme.Theme) Search

NewSearch creates a new search component

func (*Search) Close

func (s *Search) Close()

Close closes the search overlay

func (*Search) IsActive

func (s *Search) IsActive() bool

IsActive returns whether search is active

func (*Search) Open

func (s *Search) Open()

Open opens the search overlay

func (*Search) SelectedResult

func (s *Search) SelectedResult() *SearchResult

SelectedResult returns the currently selected result

func (*Search) SetSearchFunc

func (s *Search) SetSearchFunc(fn SearchFunc)

SetSearchFunc sets the function used to perform searches

func (*Search) SetSize

func (s *Search) SetSize(width, height int)

SetSize sets dimensions

func (*Search) Update

func (s *Search) Update(msg tea.Msg) (selected *SearchResult, cmd tea.Cmd)

Update handles input

func (*Search) View

func (s *Search) View() string

View renders the search overlay

type SearchFunc

type SearchFunc func(query string) []SearchResult

SearchFunc is a function that returns search results for a query

type SearchResult

type SearchResult struct {
	Type         string   // "group" or "workflow"
	Name         string   // Display name
	Description  string   // Additional info
	GroupPath    []string // Path to parent groups
	WorkflowName string   // Actual workflow filename (for workflows)
	Data         interface{}
}

SearchResult represents a search result

func FuzzySearchItems

func FuzzySearchItems(items []SearchResult, query string) []SearchResult

FuzzySearchItems performs fuzzy search on a list of SearchResults

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

Sidebar is the pinned workflows sidebar component

func NewSidebar

func NewSidebar(t *theme.Theme) Sidebar

NewSidebar creates a new sidebar component

func (*Sidebar) ClearFilter

func (s *Sidebar) ClearFilter()

ClearFilter clears the filter

func (*Sidebar) Cursor

func (s *Sidebar) Cursor() int

Cursor returns current cursor position

func (*Sidebar) HasFilter

func (s *Sidebar) HasFilter() bool

HasFilter returns whether a filter is applied

func (*Sidebar) IsFiltering

func (s *Sidebar) IsFiltering() bool

IsFiltering returns whether filter mode is active

func (*Sidebar) IsFocused

func (s *Sidebar) IsFocused() bool

IsFocused returns the focus state

func (*Sidebar) IsVisible

func (s *Sidebar) IsVisible() bool

IsVisible returns visibility

func (*Sidebar) Items

func (s *Sidebar) Items() []PinnedItem

Items returns all items

func (*Sidebar) SelectedItem

func (s *Sidebar) SelectedItem() *PinnedItem

SelectedItem returns the selected pinned item

func (*Sidebar) SetFocused

func (s *Sidebar) SetFocused(focused bool)

SetFocused sets the focus state

func (*Sidebar) SetItems

func (s *Sidebar) SetItems(items []PinnedItem)

SetItems sets the pinned items

func (*Sidebar) SetSize

func (s *Sidebar) SetSize(width, height int)

SetSize sets the dimensions

func (*Sidebar) SetVisible

func (s *Sidebar) SetVisible(visible bool)

SetVisible sets visibility

func (*Sidebar) StartFilter

func (s *Sidebar) StartFilter()

StartFilter begins filter input mode

func (*Sidebar) Toggle

func (s *Sidebar) Toggle()

Toggle toggles visibility

func (*Sidebar) Update

func (s *Sidebar) Update(msg tea.Msg) tea.Cmd

Update handles input

func (*Sidebar) View

func (s *Sidebar) View() string

View renders the sidebar

type Spinner

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

func NewSpinner

func NewSpinner(t *theme.Theme) Spinner

func (*Spinner) IsActive

func (s *Spinner) IsActive() bool

func (*Spinner) Start

func (s *Spinner) Start(label string) tea.Cmd

func (*Spinner) Stop

func (s *Spinner) Stop()

func (*Spinner) Update

func (s *Spinner) Update(msg tea.Msg) tea.Cmd

func (*Spinner) View

func (s *Spinner) View() string

type StatusBar

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

StatusBar displays the current location and status

func NewStatusBar

func NewStatusBar(t *theme.Theme) StatusBar

NewStatusBar creates a new status bar

func (*StatusBar) SetGroupPath

func (s *StatusBar) SetGroupPath(path []string)

SetGroupPath sets the current group path

func (*StatusBar) SetLoading

func (s *StatusBar) SetLoading(loading bool)

SetLoading sets the loading state

func (*StatusBar) SetRefreshStatus

func (s *StatusBar) SetRefreshStatus(enabled bool, interval int)

SetRefreshStatus sets the auto-refresh status

func (*StatusBar) SetRepository

func (s *StatusBar) SetRepository(repo string)

SetRepository sets the current repository

func (*StatusBar) SetSize

func (s *StatusBar) SetSize(width int)

SetSize sets the width

func (*StatusBar) SetWorkflow

func (s *StatusBar) SetWorkflow(name string)

SetWorkflow sets the current workflow

func (*StatusBar) View

func (s *StatusBar) View() string

View renders the status bar

type Toast

type Toast struct {
	Message   string
	Level     ToastLevel
	ExpiresAt time.Time
}

type ToastExpiredMsg

type ToastExpiredMsg struct {
	ID int
}

type ToastLevel

type ToastLevel int
const (
	ToastInfo ToastLevel = iota
	ToastSuccess
	ToastWarning
	ToastError
)

type Toaster

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

func NewToaster

func NewToaster(t *theme.Theme) Toaster

func (*Toaster) Error

func (t *Toaster) Error(message string) tea.Cmd

func (*Toaster) HasToasts

func (t *Toaster) HasToasts() bool

func (*Toaster) Info

func (t *Toaster) Info(message string) tea.Cmd

func (*Toaster) SetWidth

func (t *Toaster) SetWidth(width int)

func (*Toaster) Show

func (t *Toaster) Show(message string, level ToastLevel, duration time.Duration) tea.Cmd

func (*Toaster) Success

func (t *Toaster) Success(message string) tea.Cmd

func (*Toaster) Update

func (t *Toaster) Update(msg tea.Msg)

func (*Toaster) View

func (t *Toaster) View() string

func (*Toaster) Warning

func (t *Toaster) Warning(message string) tea.Cmd

Jump to

Keyboard shortcuts

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