Documentation
¶
Index ¶
- type Breadcrumb
- func (b *Breadcrumb) SetCount(n int)
- func (b *Breadcrumb) SetSearchAnnotation(s string)
- func (b *Breadcrumb) SetSegment(s *BreadcrumbSegment)
- func (b *Breadcrumb) SetSegments(segments []string)
- func (b *Breadcrumb) SetTail(tail bool)
- func (b *Breadcrumb) SetTheme(t theme.Theme)
- func (b Breadcrumb) View() string
- type BreadcrumbPart
- type BreadcrumbSegment
- type Column
- type Field
- type FieldKind
- type Header
- func (h *Header) SetConnected(connected bool)
- func (h *Header) SetDebugCounters(renderMs, updateMs int64, cacheTotal int, updateCount int64, viewType string)
- func (h *Header) SetMineFilter(mine bool)
- func (h *Header) SetRunningBuilds(count int, key string)
- func (h *Header) SetTheme(t theme.Theme)
- func (h *Header) SetURL(url string)
- func (h *Header) SetUser(user string)
- func (h *Header) SetViewShortcuts(shortcuts []Shortcut)
- func (h *Header) SetWidth(w int)
- func (h Header) View() string
- type InputMode
- type NavTags
- type ParamForm
- type ParamFormResult
- type ParamFormStatus
- type PopupForm
- func (pf PopupForm) ContentWidth() int
- func (pf PopupForm) Cursor() int
- func (pf *PopupForm) FocusKey(key string)
- func (pf *PopupForm) RegisterCustomKey(key, id, hint string)
- func (pf *PopupForm) ReserveStatusLines(n int)
- func (pf *PopupForm) SetSize(termW, termH int)
- func (pf *PopupForm) SetStatus(kind StatusKind, text string)
- func (pf *PopupForm) SetTheme(t theme.Theme)
- func (pf *PopupForm) Update(msg tea.KeyMsg) PopupResult
- func (pf PopupForm) Values() map[string]string
- func (pf PopupForm) View() string
- type PopupResult
- type PopupStatus
- type ProgressBar
- func (pb ProgressBar) DualRenderWithText(width int, elapsed, estimated time.Duration) string
- func (pb ProgressBar) Render(width int, elapsed, estimated time.Duration) string
- func (pb ProgressBar) RenderComplete(width int, text string, style lipgloss.Style) string
- func (pb ProgressBar) RenderCompleteTall(width int, text string, style lipgloss.Style) string
- func (pb ProgressBar) RenderPendingTall(width int, text string) string
- func (pb ProgressBar) RenderWithText(width int, elapsed, estimated time.Duration) string
- func (pb ProgressBar) RenderWithTextTall(width int, elapsed, estimated time.Duration) string
- func (pb *ProgressBar) SetTheme(t theme.Theme)
- type Row
- type Shortcut
- type StatusBar
- func (s *StatusBar) ClearError()
- func (s StatusBar) CommandView() string
- func (s *StatusBar) HasError() bool
- func (s *StatusBar) Mode() InputMode
- func (s *StatusBar) SetError(err string)
- func (s *StatusBar) SetInput(input string)
- func (s *StatusBar) SetMode(mode InputMode)
- func (s *StatusBar) SetSuggestion(suggestion string)
- func (s *StatusBar) SetTheme(t theme.Theme)
- func (s *StatusBar) SetWidth(w int)
- type StatusKind
- type Table
- func (t *Table) ContentHeight() int
- func (t *Table) Cursor() int
- func (t *Table) End()
- func (t *Table) Home()
- func (t *Table) IsDisabled(idx int) bool
- func (t *Table) MoveDown()
- func (t *Table) MoveUp()
- func (t *Table) PageDown()
- func (t *Table) PageUp()
- func (t *Table) ScrollOffset() int
- func (t *Table) SelectedRow() Row
- func (t *Table) SetColumnWidth(i, w int)
- func (t *Table) SetCursor(idx int)
- func (t *Table) SetDisabled(indices map[int]bool)
- func (t *Table) SetRows(rows []Row)
- func (t *Table) SetSize(w, h int)
- func (t *Table) SetTheme(th theme.Theme)
- func (t *Table) TotalRows() int
- func (t Table) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Breadcrumb ¶
type Breadcrumb struct {
// contains filtered or unexported fields
}
Breadcrumb renders the navigation path as the panel title.
func NewBreadcrumb ¶
func NewBreadcrumb(t theme.Theme) Breadcrumb
NewBreadcrumb creates a new breadcrumb component.
func (*Breadcrumb) SetCount ¶
func (b *Breadcrumb) SetCount(n int)
SetCount sets the item count shown next to the title.
func (*Breadcrumb) SetSearchAnnotation ¶
func (b *Breadcrumb) SetSearchAnnotation(s string)
SetSearchAnnotation sets the search badge shown after the breadcrumb.
func (*Breadcrumb) SetSegment ¶
func (b *Breadcrumb) SetSegment(s *BreadcrumbSegment)
SetSegment sets the k9s-style breadcrumb segment.
func (*Breadcrumb) SetSegments ¶
func (b *Breadcrumb) SetSegments(segments []string)
SetSegments updates the breadcrumb path (legacy).
func (*Breadcrumb) SetTail ¶
func (b *Breadcrumb) SetTail(tail bool)
SetTail enables [tail] badge instead of [count].
func (*Breadcrumb) SetTheme ¶
func (b *Breadcrumb) SetTheme(t theme.Theme)
SetTheme updates the theme used for rendering.
func (Breadcrumb) View ¶
func (b Breadcrumb) View() string
View renders the breadcrumb as a title string (used inside bordered content panel).
type BreadcrumbPart ¶
type BreadcrumbPart struct {
Text string
IsBuildNum bool
Separator string // ":" instead of "/" before this part; empty = default "/"
}
BreadcrumbPart is one piece of the context portion of a breadcrumb segment.
type BreadcrumbSegment ¶
type BreadcrumbSegment struct {
ViewType string
Context []BreadcrumbPart
Running bool // filter active — rendered as "running " prefix
Mine bool // filter active — rendered as "my " prefix
ResolvedParts []BreadcrumbPart // resolved #last info, shown after " → " arrow
}
BreadcrumbSegment mirrors view.BreadcrumbSegment so the component package doesn't import the view package.
type Field ¶
type Field struct {
Key string
Label string
Kind FieldKind
Description string
Required bool
Choices []string
Default string
Validator func(string) error
}
Field describes one input in a PopupForm.
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header renders the top panel with connection info and shortcuts.
func (*Header) SetConnected ¶
SetConnected updates the connection status.
func (*Header) SetDebugCounters ¶
func (h *Header) SetDebugCounters(renderMs, updateMs int64, cacheTotal int, updateCount int64, viewType string)
SetDebugCounters updates the debug overlay values shown in the header.
func (*Header) SetMineFilter ¶
SetMineFilter updates whether the mine filter is active (shown inline with username).
func (*Header) SetRunningBuilds ¶
SetRunningBuilds updates the running builds count and the key hint shown when > 0.
func (*Header) SetViewShortcuts ¶
SetViewShortcuts updates the context-sensitive shortcuts from the active view. Called on every render to reflect the current view state.
type NavTags ¶
type NavTags struct {
// contains filtered or unexported fields
}
NavTags renders k9s-style navigation tags at the bottom of the TUI.
func NewNavTags ¶
NewNavTags creates a new NavTags component.
func (*NavTags) SetRooted ¶
SetRooted marks whether the current view is root-scoped (e.g. builds(*)). Root-scoped views show only the active tag, no ancestors.
func (*NavTags) SetViewType ¶
SetViewType sets the current view's ViewType (e.g. "builds+running").
type ParamForm ¶
type ParamForm struct {
// contains filtered or unexported fields
}
ParamForm is a self-contained form component for entering Jenkins build parameters. It is a thin adapter on top of PopupForm.
func NewParamForm ¶
func NewParamForm(t theme.Theme, params []jenkins.ParameterDefinition) ParamForm
NewParamForm creates a form from parameter definitions.
func (*ParamForm) SetSize ¶
SetSize updates both the popup content width and visible row count from the host's terminal dimensions.
type ParamFormResult ¶
type ParamFormResult struct {
Status ParamFormStatus
Values map[string]string
}
ParamFormResult is returned by Update after each key press.
type ParamFormStatus ¶
type ParamFormStatus int
ParamFormStatus represents the outcome of a form interaction.
const ( ParamFormActive ParamFormStatus = iota ParamFormDone ParamFormCancelled )
type PopupForm ¶
type PopupForm struct {
// contains filtered or unexported fields
}
PopupForm is a reusable modal form with shared key bindings, validation and rendering. Hosts wrap it to expose domain-specific APIs.
func NewPopupForm ¶
NewPopupForm constructs a popup form with the given fields and a default content width of 60 columns. Hosts should call SetSize once they know the terminal dimensions.
func (PopupForm) ContentWidth ¶
ContentWidth reports the current inner width (before border + padding).
func (*PopupForm) RegisterCustomKey ¶
RegisterCustomKey associates a key binding with an id surfaced via PopupResult.Custom and a footer hint.
func (*PopupForm) ReserveStatusLines ¶
ReserveStatusLines reserves a fixed number of rows for the status section so the popup's overall height does not change when status text appears or disappears. n=0 disables reservation (status renders only when set).
func (*PopupForm) SetSize ¶
SetSize updates content width (clamped 50..80) from the terminal dimensions. Width snaps once and remains stable until called again, so typing into a field cannot grow the popup. termH is accepted for future use but currently ignored — all fields are rendered without scrolling.
func (*PopupForm) SetStatus ¶
func (pf *PopupForm) SetStatus(kind StatusKind, text string)
SetStatus sets the optional status line. Pass StatusNone to clear.
func (*PopupForm) Update ¶
func (pf *PopupForm) Update(msg tea.KeyMsg) PopupResult
Update processes a key event and returns the resulting popup state.
type PopupResult ¶
type PopupResult struct {
Status PopupStatus
Custom string // populated when Status == PopupCustom
}
PopupResult is returned by PopupForm.Update.
type PopupStatus ¶
type PopupStatus int
PopupStatus is the outcome of a PopupForm.Update call.
const ( PopupActive PopupStatus = iota PopupSubmitted PopupCancelled PopupCustom )
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar renders a styled progress bar string of exact visible width.
func NewProgressBar ¶
func NewProgressBar(t theme.Theme) ProgressBar
NewProgressBar creates a new progress bar with the given theme.
func (ProgressBar) DualRenderWithText ¶
func (pb ProgressBar) DualRenderWithText(width int, elapsed, estimated time.Duration) string
DualRenderWithText returns both normal and selected renderings of an inline progress bar, joined by \x1f. The table uses this to pick the right variant.
func (ProgressBar) Render ¶
func (pb ProgressBar) Render(width int, elapsed, estimated time.Duration) string
Render returns a styled progress bar string of exactly `width` visible characters. When estimated is 0, returns a "● Running" fallback.
func (ProgressBar) RenderComplete ¶
RenderComplete renders a fully filled bar with centered text in the given style.
func (ProgressBar) RenderCompleteTall ¶
RenderCompleteTall renders a 3-line tall fully filled bar with centered text on the middle line.
func (ProgressBar) RenderPendingTall ¶
func (pb ProgressBar) RenderPendingTall(width int, text string) string
RenderPendingTall renders a 3-line tall bar filled with a uniform shade character, with centered text on the middle line. Uses the same colors as the unfilled progress bar portion for a subtle "waiting" appearance.
func (ProgressBar) RenderWithText ¶
func (pb ProgressBar) RenderWithText(width int, elapsed, estimated time.Duration) string
RenderWithText returns a styled progress bar with time-remaining text centered inside.
func (ProgressBar) RenderWithTextTall ¶
func (pb ProgressBar) RenderWithTextTall(width int, elapsed, estimated time.Duration) string
RenderWithTextTall returns a 3-line tall progress bar with text centered on the middle line. Top and bottom lines show a solid filled/empty bar without text.
func (*ProgressBar) SetTheme ¶
func (pb *ProgressBar) SetTheme(t theme.Theme)
SetTheme updates the theme used for rendering.
type Shortcut ¶
type Shortcut struct {
Key string
Action string
Active bool // when true, action text is highlighted with the search match style
}
Shortcut is a key/action pair.
type StatusBar ¶
type StatusBar struct {
// contains filtered or unexported fields
}
StatusBar manages command/search input and error display.
func NewStatusBar ¶
NewStatusBar creates a new status bar.
func (*StatusBar) ClearError ¶
func (s *StatusBar) ClearError()
ClearError clears the error message.
func (StatusBar) CommandView ¶
CommandView renders the command input panel (shown at top when active).
func (*StatusBar) SetSuggestion ¶
SetSuggestion updates the inline autocomplete suggestion.
type StatusKind ¶
type StatusKind int
StatusKind selects the styling of the optional status line.
const ( StatusNone StatusKind = iota StatusInfo StatusOK StatusError )
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table renders a selectable, scrollable table.
func (*Table) ContentHeight ¶
ContentHeight returns the number of visible content rows (excluding header).
func (*Table) IsDisabled ¶
IsDisabled returns true if the row at idx is disabled.
func (*Table) MoveDown ¶
func (t *Table) MoveDown()
MoveDown moves the cursor down, skipping disabled rows.
func (*Table) PageDown ¶
func (t *Table) PageDown()
PageDown moves the cursor down by one page, snapping to a non-disabled row.
func (*Table) PageUp ¶
func (t *Table) PageUp()
PageUp moves the cursor up by one page, snapping to a non-disabled row.
func (*Table) ScrollOffset ¶
ScrollOffset returns the index of the first visible row.
func (*Table) SelectedRow ¶
SelectedRow returns the currently selected row, or nil if empty.
func (*Table) SetColumnWidth ¶
SetColumnWidth updates the width of the column at index i.
func (*Table) SetCursor ¶
SetCursor moves the cursor to the given index, adjusting scroll offset. If the target row is disabled, it snaps to the nearest non-disabled row (preferring forward, then backward).
func (*Table) SetDisabled ¶
SetDisabled stores the set of disabled row indices. Pass nil to clear.
func (*Table) SetSize ¶
SetSize updates the table dimensions and clamps the scroll offset so that rows aren't needlessly scrolled out of view (e.g. after a height increase).