Documentation
¶
Overview ¶
Package components provides reusable TUI components built on Bubble Tea.
Index ¶
- func DetailsHints(hasWorkflow bool) []string
- func GlobalHints() []string
- func NavigationHints(inGroup bool) []string
- func RunsHints() []string
- func SidebarHints() []string
- type CmdPalette
- func (c *CmdPalette) Close()
- func (c *CmdPalette) IsActive() bool
- func (c *CmdPalette) Open()
- func (c *CmdPalette) SetCommands(cmds []Command)
- func (c *CmdPalette) SetSize(width, height int)
- func (c *CmdPalette) Update(msg tea.Msg) (selectedCmd *Command, cmd tea.Cmd)
- func (c *CmdPalette) View() string
- type Command
- type Details
- func (d *Details) Clear()
- func (d *Details) IsFocused() bool
- func (d *Details) SetError(err error)
- func (d *Details) SetFocused(focused bool)
- func (d *Details) SetLoading(loading bool)
- func (d *Details) SetRuns(runs []models.GHRun)
- func (d *Details) SetSize(width, height int)
- func (d *Details) SetWorkflow(name string)
- func (d *Details) View() string
- func (d *Details) WorkflowName() string
- type HelpBar
- type HelpOverlay
- type KeyBinding
- type KeySection
- type List
- func (l *List) ClearFilter()
- func (l *List) Cursor() int
- func (l *List) FilterInput() string
- func (l *List) FilteredItems() []ListItem
- func (l *List) HasFilter() bool
- func (l *List) IsFiltering() bool
- func (l *List) IsFocused() bool
- func (l *List) Items() []ListItem
- func (l *List) SelectedItem() *ListItem
- func (l *List) SetCursor(pos int)
- func (l *List) SetFocused(focused bool)
- func (l *List) SetItems(items []ListItem)
- func (l *List) SetSize(width, height int)
- func (l *List) SetTitle(title string)
- func (l *List) StartFilter()
- func (l *List) Update(msg tea.Msg) tea.Cmd
- func (l *List) View() string
- type ListItem
- type PinnedItem
- type RunsTable
- func (r *RunsTable) IsFocused() bool
- func (r *RunsTable) IsVisible() bool
- func (r *RunsTable) Runs() []models.GHRun
- func (r *RunsTable) SelectedRunID() int
- func (r *RunsTable) SetError(err error)
- func (r *RunsTable) SetFocused(focused bool)
- func (r *RunsTable) SetLoading(loading bool)
- func (r *RunsTable) SetRuns(runs []models.GHRun, workflowName string)
- func (r *RunsTable) SetSize(width, height int)
- func (r *RunsTable) SetVisible(visible bool)
- func (r *RunsTable) Toggle()
- func (r *RunsTable) Update(msg tea.Msg) tea.Cmd
- func (r *RunsTable) View() string
- func (r *RunsTable) WorkflowName() string
- type Search
- func (s *Search) Close()
- func (s *Search) IsActive() bool
- func (s *Search) Open()
- func (s *Search) SelectedResult() *SearchResult
- func (s *Search) SetSearchFunc(fn SearchFunc)
- func (s *Search) SetSize(width, height int)
- func (s *Search) Update(msg tea.Msg) (selected *SearchResult, cmd tea.Cmd)
- func (s *Search) View() string
- type SearchFunc
- type SearchResult
- type Sidebar
- func (s *Sidebar) ClearFilter()
- func (s *Sidebar) Cursor() int
- func (s *Sidebar) HasFilter() bool
- func (s *Sidebar) IsFiltering() bool
- func (s *Sidebar) IsFocused() bool
- func (s *Sidebar) IsVisible() bool
- func (s *Sidebar) Items() []PinnedItem
- func (s *Sidebar) SelectedItem() *PinnedItem
- func (s *Sidebar) SetFocused(focused bool)
- func (s *Sidebar) SetItems(items []PinnedItem)
- func (s *Sidebar) SetSize(width, height int)
- func (s *Sidebar) SetVisible(visible bool)
- func (s *Sidebar) StartFilter()
- func (s *Sidebar) Toggle()
- func (s *Sidebar) Update(msg tea.Msg) tea.Cmd
- func (s *Sidebar) View() string
- type Spinner
- type StatusBar
- func (s *StatusBar) SetGroupPath(path []string)
- func (s *StatusBar) SetLoading(loading bool)
- func (s *StatusBar) SetRefreshStatus(enabled bool, interval int)
- func (s *StatusBar) SetRepository(repo string)
- func (s *StatusBar) SetSize(width int)
- func (s *StatusBar) SetWorkflow(name string)
- func (s *StatusBar) View() string
- type Toast
- type ToastExpiredMsg
- type ToastLevel
- type Toaster
- func (t *Toaster) Error(message string) tea.Cmd
- func (t *Toaster) HasToasts() bool
- func (t *Toaster) Info(message string) tea.Cmd
- func (t *Toaster) SetWidth(width int)
- func (t *Toaster) Show(message string, level ToastLevel, duration time.Duration) tea.Cmd
- func (t *Toaster) Success(message string) tea.Cmd
- func (t *Toaster) Update(msg tea.Msg)
- func (t *Toaster) View() string
- func (t *Toaster) Warning(message string) tea.Cmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetailsHints ¶
DetailsHints returns details panel hints
func NavigationHints ¶
NavigationHints returns navigation panel 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) View ¶
func (c *CmdPalette) View() string
type Details ¶
type Details struct {
// contains filtered or unexported fields
}
Details displays workflow details and recent runs preview
func NewDetails ¶
NewDetails creates a new details component
func (*Details) SetLoading ¶
SetLoading sets loading state
func (*Details) SetWorkflow ¶
SetWorkflow sets the current workflow
func (*Details) WorkflowName ¶
WorkflowName returns current workflow
type HelpBar ¶
type HelpBar struct {
// contains filtered or unexported fields
}
HelpBar displays context-sensitive keybindings
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) View ¶
func (h *HelpOverlay) View() string
type KeyBinding ¶
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 (*List) FilterInput ¶
FilterInput returns the current filter text
func (*List) FilteredItems ¶
FilteredItems returns the currently visible (filtered) items
func (*List) IsFiltering ¶
IsFiltering returns whether filter mode is active
func (*List) SelectedItem ¶
SelectedItem returns the currently selected item, or nil if none
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 ¶
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 ¶
NewRunsTable creates a new runs table component
func NewRunsTablePtr ¶
NewRunsTablePtr creates a new runs table component as a pointer
func (*RunsTable) SelectedRunID ¶
SelectedRunID returns the ID of the selected run
func (*RunsTable) SetFocused ¶
SetFocused sets focus state
func (*RunsTable) SetLoading ¶
SetLoading sets loading state
func (*RunsTable) SetVisible ¶
SetVisible sets visibility
func (*RunsTable) WorkflowName ¶
WorkflowName returns the current workflow name
type Search ¶
type Search struct {
// contains filtered or unexported fields
}
Search is a global search overlay component
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
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 ¶
type Sidebar struct {
// contains filtered or unexported fields
}
Sidebar is the pinned workflows sidebar component
func NewSidebar ¶
NewSidebar creates a new sidebar component
func (*Sidebar) IsFiltering ¶
IsFiltering returns whether filter mode is active
func (*Sidebar) SelectedItem ¶
func (s *Sidebar) SelectedItem() *PinnedItem
SelectedItem returns the selected pinned item
func (*Sidebar) SetFocused ¶
SetFocused sets the focus state
func (*Sidebar) SetItems ¶
func (s *Sidebar) SetItems(items []PinnedItem)
SetItems sets the pinned items
type StatusBar ¶
type StatusBar struct {
// contains filtered or unexported fields
}
StatusBar displays the current location and status
func NewStatusBar ¶
NewStatusBar creates a new status bar
func (*StatusBar) SetGroupPath ¶
SetGroupPath sets the current group path
func (*StatusBar) SetLoading ¶
SetLoading sets the loading state
func (*StatusBar) SetRefreshStatus ¶
SetRefreshStatus sets the auto-refresh status
func (*StatusBar) SetRepository ¶
SetRepository sets the current repository
func (*StatusBar) SetWorkflow ¶
SetWorkflow sets the current workflow
type ToastExpiredMsg ¶
type ToastExpiredMsg struct {
ID int
}
type ToastLevel ¶
type ToastLevel int
const ( ToastInfo ToastLevel = iota ToastSuccess ToastWarning ToastError )