ui

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Border colors
	FocusedBorderColor   = theme.Accent
	UnfocusedBorderColor = theme.Muted

	// Borders
	FocusedBorderStyle   = lipgloss.NewStyle().BorderStyle(lipgloss.RoundedBorder()).BorderForeground(FocusedBorderColor)
	UnfocusedBorderStyle = lipgloss.NewStyle().BorderStyle(lipgloss.RoundedBorder()).BorderForeground(UnfocusedBorderColor)

	// Namespace badge in status bar
	NamespaceStyle = lipgloss.NewStyle().Foreground(theme.TextOnAccent).Background(theme.Accent).Bold(true).Padding(0, 1)

	// Status bar
	StatusBarStyle     = lipgloss.NewStyle().Foreground(theme.Muted).Padding(0, 1)
	StatusKeyStyle     = lipgloss.NewStyle().Bold(true).Foreground(theme.Highlight)
	StatusHelpStyle    = lipgloss.NewStyle().Foreground(theme.Muted)
	StatusErrorStyle   = lipgloss.NewStyle().Foreground(theme.Error).Bold(true)
	StatusWarningStyle = lipgloss.NewStyle().Foreground(theme.Warning).Bold(true)
	// Context badge in status bar
	ContextBadgeOnlineStyle  = lipgloss.NewStyle().Foreground(theme.TextOnAccent).Background(theme.StatusRunning).Bold(true).Padding(0, 1)
	ContextBadgeOfflineStyle = lipgloss.NewStyle().Foreground(theme.TextOnAccent).Background(theme.Error).Bold(true).Padding(0, 1)

	// Zoom indicator
	ZoomIndicatorStyle = lipgloss.NewStyle().
						Foreground(theme.TextOnAccent).
						Background(theme.Accent).
						Bold(true)

	// Port-forward indicator
	PortForwardIndicatorStyle = lipgloss.NewStyle().
								Foreground(theme.TextOnAccent).
								Background(theme.Highlight).
								Bold(true)

	// Table
	TableHeaderStyle      = lipgloss.NewStyle().Bold(true).Foreground(theme.Highlight).Padding(0, 1)
	TableSelectedStyle    = lipgloss.NewStyle().Background(theme.Accent).Foreground(theme.TextOnAccent).Bold(true)
	TableSelectedDimStyle = lipgloss.NewStyle()

	// Table multi-select
	TableMarkedStyle         = lipgloss.NewStyle().Foreground(theme.Selection).Bold(true)
	TableMarkedSelectedStyle = lipgloss.NewStyle().Background(theme.Accent).Foreground(theme.Selection).Bold(true)

	// Detail panel
	DetailHeaderStyle = lipgloss.NewStyle().Bold(true).Padding(0, 1)

	// Overlays
	OverlayStyle = lipgloss.NewStyle().BorderStyle(lipgloss.RoundedBorder()).BorderForeground(theme.Accent).Padding(1, 2)

	// Title
	TitleStyle          = lipgloss.NewStyle().Bold(true).Foreground(theme.Highlight).Padding(0, 1)
	TitleIndicatorStyle = lipgloss.NewStyle().Foreground(theme.Subtle)
)

Functions

func BuildPanelTitle

func BuildPanelTitle(base, filterPattern, searchPattern string, panelWidth int, inlineInput string) string

BuildPanelTitle assembles the complete rendered panel title from a base title string and optional filter/search patterns. filterPattern and searchPattern are raw pattern strings — empty means inactive. panelWidth is the total rendered width of the panel border including corners.

func BuildPanelTitleWithPrefix

func BuildPanelTitleWithPrefix(prefix, base, filterPattern, searchPattern string, panelWidth int, inlineInput string) string

BuildPanelTitleWithPrefix assembles a panel title with a dimmed prefix (e.g. namespace) followed by a bright base title and optional patterns.

func HighlightMatches

func HighlightMatches(cell string, re *regexp.Regexp) string

HighlightMatches wraps regex matches with reverse-video ANSI codes (for the active/cursor row).

func HighlightMatchesColor

func HighlightMatchesColor(cell string, re *regexp.Regexp) string

HighlightMatchesColor wraps regex matches with themed color ANSI codes (for inactive rows).

func LookupTimePreset added in v0.2.0

func LookupTimePreset(label string) (seconds int64, ok bool)

LookupTimePreset returns the seconds value for a time range label. Returns ok=false if the label is not a known preset.

func PlaceOverlay

func PlaceOverlay(bgWidth, bgHeight int, bg, overlay string, opts ...OverlayOption) string

PlaceOverlay composites the overlay string centered (by default) over bg, dimming the background content that is not covered by the overlay. bgWidth and bgHeight are the terminal dimensions.

func RenderButtonBar added in v0.2.0

func RenderButtonBar(buttons []Button, focusedIdx int) string

RenderButtonBar renders a styled button bar for overlay footers. Pass focusedIdx = -1 to render all buttons without highlight.

Types

type Button added in v0.2.0

type Button struct {
	Label  string
	Hotkey string
}

Button defines a single footer button with a label and hotkey hint.

type ChartInputOverlay

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

ChartInputOverlay prompts for a chart source (OCI ref or local path).

func NewChartInputOverlay

func NewChartInputOverlay(width, height int) ChartInputOverlay

func (ChartInputOverlay) Active

func (c ChartInputOverlay) Active() bool

func (*ChartInputOverlay) Close

func (c *ChartInputOverlay) Close()

func (*ChartInputOverlay) Open

func (c *ChartInputOverlay) Open(releaseName, namespace, currentRef string)

func (*ChartInputOverlay) SetSize

func (c *ChartInputOverlay) SetSize(w, h int)

func (ChartInputOverlay) Update

func (c ChartInputOverlay) Update(msg tea.Msg) (ChartInputOverlay, tea.Cmd)

func (ChartInputOverlay) View

func (c ChartInputOverlay) View() string

type ConfirmDialog

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

ConfirmDialog is an overlay that asks the user to confirm, force, or cancel an action.

func NewConfirmDialog

func NewConfirmDialog(message string, width int) ConfirmDialog

NewConfirmDialog creates a new active confirm dialog with the given message and terminal width.

func (ConfirmDialog) Active

func (c ConfirmDialog) Active() bool

Active returns whether the dialog is currently active.

func (ConfirmDialog) Message added in v0.7.0

func (c ConfirmDialog) Message() string

Message returns the prompt text the dialog was constructed with. Used by tests to assert against the actual stored message rather than re-deriving it.

func (*ConfirmDialog) SetWidth

func (c *ConfirmDialog) SetWidth(w int)

SetWidth updates the dialog width on terminal resize.

func (ConfirmDialog) Update

func (c ConfirmDialog) Update(msg tea.Msg) (ConfirmDialog, tea.Cmd)

Update handles key messages for the confirm dialog.

func (ConfirmDialog) View

func (c ConfirmDialog) View() string

View renders the confirm dialog as a centered bordered box.

type ContainerPicker

type ContainerPicker struct {
	Picker[string]
}

ContainerPicker is an overlay that lets the user select a container for log streaming.

func NewContainerPicker

func NewContainerPicker(width, height int) ContainerPicker

NewContainerPicker creates a new container picker with the given dimensions.

func (*ContainerPicker) SetContainers

func (c *ContainerPicker) SetContainers(names []string)

SetContainers stores the list of available containers.

func (ContainerPicker) Update

func (c ContainerPicker) Update(msg tea.Msg) (ContainerPicker, tea.Cmd)

Update handles key messages for the container picker.

type DetailPanel

type DetailPanel interface {
	Searchable
	ScrollLeft()
	ScrollRight()
	ScrollHome()
	ScrollEnd()
	ScrollUp()
	ScrollDown()
	PageUp()
	PageDown()
	GotoTop()
	GotoBottom()
	ToggleWrap()
	ToggleHeader()
	ShowHeader() bool
	Focus()
	Blur()
	SetSize(w, h int)
	SetBorderless(b bool)
	SetInlineSearch(s string)
	View() string
}

DetailPanel is the shared interface between DetailView and LogView, covering scrolling, focus, sizing, and search operations used by the layout.

type DetailView

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

DetailView wraps a viewport for displaying YAML, describe, or log content.

func NewDetailView

func NewDetailView(width, height int) DetailView

NewDetailView creates a new detail view with the given dimensions.

func (DetailView) AnyActive

func (d DetailView) AnyActive() bool

AnyActive reports whether either search or filter is active.

func (*DetailView) ApplySearch

func (d *DetailView) ApplySearch(pattern string, mode msgs.SearchMode) error

ApplySearch compiles the pattern and applies the given mode. In search mode, all content remains visible with matches highlighted. In filter mode, non-matching lines are hidden.

func (*DetailView) Blur

func (d *DetailView) Blur()

Blur marks this detail view as unfocused.

func (*DetailView) ClearContent

func (d *DetailView) ClearContent()

ClearContent clears all content.

func (*DetailView) ClearFilter

func (d *DetailView) ClearFilter()

ClearFilter removes the active filter and restores all lines.

func (*DetailView) ClearSearch

func (d *DetailView) ClearSearch()

ClearSearch removes the active search highlights.

func (DetailView) FilterActive

func (d DetailView) FilterActive() bool

FilterActive reports whether a filter is currently active.

func (*DetailView) Focus

func (d *DetailView) Focus()

Focus marks this detail view as focused.

func (*DetailView) GotoBottom

func (d *DetailView) GotoBottom()

GotoBottom scrolls to the bottom of the content.

func (*DetailView) GotoTop

func (d *DetailView) GotoTop()

GotoTop scrolls to the top of the content.

func (DetailView) Height

func (d DetailView) Height() int

Height returns the current height.

func (DetailView) LoadErr added in v0.3.0

func (d DetailView) LoadErr() string

LoadErr returns the current load error message, if any.

func (DetailView) Loading added in v0.3.0

func (d DetailView) Loading() bool

Loading reports whether the detail view is in a loading state.

func (*DetailView) Mode

func (d *DetailView) Mode() msgs.DetailMode

Mode returns the current detail mode.

func (*DetailView) PageDown

func (d *DetailView) PageDown()

PageDown scrolls the viewport down by one page.

func (*DetailView) PageUp

func (d *DetailView) PageUp()

PageUp scrolls the viewport up by one page.

func (*DetailView) ScrollDown

func (d *DetailView) ScrollDown()

ScrollDown scrolls the viewport down by one line.

func (*DetailView) ScrollEnd added in v0.3.6

func (d *DetailView) ScrollEnd()

ScrollEnd scrolls horizontally to show the end of the longest visible line. No-op when soft-wrap is enabled.

func (*DetailView) ScrollHome added in v0.3.6

func (d *DetailView) ScrollHome()

ScrollHome resets horizontal scroll to the beginning of the line. No-op when soft-wrap is enabled.

func (*DetailView) ScrollLeft

func (d *DetailView) ScrollLeft()

ScrollLeft scrolls the viewport left by hScrollStep columns. No-op when soft-wrap is enabled.

func (*DetailView) ScrollRight

func (d *DetailView) ScrollRight()

ScrollRight scrolls the viewport right by hScrollStep columns. No-op when soft-wrap is enabled.

func (*DetailView) ScrollUp

func (d *DetailView) ScrollUp()

ScrollUp scrolls the viewport up by one line.

func (*DetailView) ScrollWheel added in v0.5.0

func (d *DetailView) ScrollWheel(btn tea.MouseButton)

ScrollWheel nudges the viewport by one line in response to a mouse wheel event. Up/down delegate to the embedded bubbles/viewport's scroll helpers. Left/right wheel and any other button are dropped.

func (DetailView) SearchActive

func (d DetailView) SearchActive() bool

SearchActive reports whether a search is active (highlights only).

func (*DetailView) SearchNext

func (d *DetailView) SearchNext()

SearchNext navigates to the next search match.

func (*DetailView) SearchPrev

func (d *DetailView) SearchPrev()

SearchPrev navigates to the previous search match.

func (*DetailView) SetBorderless

func (d *DetailView) SetBorderless(b bool)

SetBorderless enables or disables borderless rendering.

func (*DetailView) SetContent

func (d *DetailView) SetContent(content render.Content, refresh bool)

SetContent sets the detail view content from pre-rendered render.Content. When refresh is true, scroll resets to top; when false, scroll position is preserved. Setting content also clears the loading and error states.

func (*DetailView) SetEnvResolved added in v0.3.3

func (d *DetailView) SetEnvResolved(v bool)

SetEnvResolved sets whether secrets are currently revealed, shown as [S] in the header.

func (*DetailView) SetInlineSearch

func (d *DetailView) SetInlineSearch(s string)

SetInlineSearch sets the inline search input text for rendering in the title.

func (*DetailView) SetLoadError added in v0.3.0

func (d *DetailView) SetLoadError(msg string)

SetLoadError sets a load error message and clears the loading state.

func (*DetailView) SetLoading added in v0.3.0

func (d *DetailView) SetLoading(v bool) tea.Cmd

SetLoading enables or disables the loading state. When true, resets any load error but preserves existing viewport content so that scroll position is maintained across async reloads. Returns a tea.Cmd to start the spinner animation (nil when disabling).

func (*DetailView) SetMode

func (d *DetailView) SetMode(mode msgs.DetailMode)

SetMode sets the active detail mode.

func (*DetailView) SetSize

func (d *DetailView) SetSize(w, h int)

SetSize updates the dimensions.

func (DetailView) ShowHeader added in v0.3.2

func (d DetailView) ShowHeader() bool

ShowHeader reports whether the header bar is visible.

func (*DetailView) ToggleHeader added in v0.3.2

func (d *DetailView) ToggleHeader()

ToggleHeader flips the header visibility and recalculates the viewport size.

func (*DetailView) ToggleWrap

func (d *DetailView) ToggleWrap()

ToggleWrap toggles soft-wrap mode. When enabling wrap, content is pre-wrapped via wrapLines so that continuation rows receive the "↪ " indicator. The viewport's own SoftWrap is never used — we handle wrapping ourselves. When enabling wrap, the horizontal offset is reset since horizontal scroll is a no-op.

func (DetailView) Update

func (d DetailView) Update(msg tea.Msg) (DetailView, tea.Cmd)

Update handles key messages for viewport scrolling.

func (DetailView) View

func (d DetailView) View() string

View renders the detail view with mode label in the border.

func (DetailView) Width

func (d DetailView) Width() int

Width returns the current width.

type DualRingBuffer added in v0.2.0

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

DualRingBuffer is a fixed-capacity circular buffer storing parallel raw and colored (highlighted) log lines. O(1) append, oldest lines are evicted when full. Not goroutine-safe — only access from the bubbletea Update goroutine.

func NewDualRingBuffer added in v0.2.0

func NewDualRingBuffer(capacity int) *DualRingBuffer

NewDualRingBuffer creates a dual ring buffer with the given capacity.

func (*DualRingBuffer) Append added in v0.2.0

func (d *DualRingBuffer) Append(raw, colored, stripped string, rawWidth int)

Append adds a raw, colored, and stripped line triple with a pre-computed display width. If at capacity, the oldest entry is evicted.

func (*DualRingBuffer) Cap added in v0.3.0

func (d *DualRingBuffer) Cap() int

Cap returns the maximum capacity of the ring buffer.

func (*DualRingBuffer) ColoredAll added in v0.2.0

func (d *DualRingBuffer) ColoredAll() []string

ColoredAll returns all colored lines in order (oldest to newest) using bulk copy.

func (*DualRingBuffer) ColoredGet added in v0.2.0

func (d *DualRingBuffer) ColoredGet(i int) string

ColoredGet returns the colored line at logical index i (0 = oldest).

func (*DualRingBuffer) ColoredSlice added in v0.2.0

func (d *DualRingBuffer) ColoredSlice(start, end int) []string

ColoredSlice returns a copy of colored lines[start:end] in logical order.

func (*DualRingBuffer) Dropped added in v0.2.0

func (d *DualRingBuffer) Dropped() int

Dropped returns the total number of pairs evicted since creation or last reset.

func (*DualRingBuffer) Len added in v0.2.0

func (d *DualRingBuffer) Len() int

Len returns the number of line pairs currently stored.

func (*DualRingBuffer) RawAll added in v0.2.0

func (d *DualRingBuffer) RawAll() []string

RawAll returns all raw lines in order (oldest to newest) using bulk copy.

func (*DualRingBuffer) RawGet added in v0.2.0

func (d *DualRingBuffer) RawGet(i int) string

RawGet returns the raw line at logical index i (0 = oldest).

func (*DualRingBuffer) RawSlice added in v0.2.0

func (d *DualRingBuffer) RawSlice(start, end int) []string

RawSlice returns a copy of raw lines[start:end] in logical order.

func (*DualRingBuffer) Reset added in v0.2.0

func (d *DualRingBuffer) Reset()

Reset clears all state without reallocating.

func (*DualRingBuffer) SetColored added in v0.2.0

func (d *DualRingBuffer) SetColored(i int, s string, width int)

SetColored overwrites the colored line at logical index i.

func (*DualRingBuffer) SetStripped added in v0.3.5

func (d *DualRingBuffer) SetStripped(i int, s string)

SetStripped overwrites the stripped line at logical index i.

func (*DualRingBuffer) StrippedGet added in v0.3.5

func (d *DualRingBuffer) StrippedGet(i int) string

StrippedGet returns the ANSI-stripped line at logical index i (0 = oldest).

func (*DualRingBuffer) StrippedSlice added in v0.3.5

func (d *DualRingBuffer) StrippedSlice(start, end int) []string

StrippedSlice returns a copy of stripped lines[start:end] in logical order.

func (*DualRingBuffer) WidthGet added in v0.3.0

func (d *DualRingBuffer) WidthGet(i int) int

WidthGet returns the pre-computed display width at logical index i (0 = oldest). Returns 0 for out-of-bounds indices.

func (*DualRingBuffer) WidthSlice added in v0.3.0

func (d *DualRingBuffer) WidthSlice(start, end int) []int

WidthSlice returns a copy of widths[start:end] in logical order.

type FuzzyMatch

type FuzzyMatch struct {
	Name    string // plugin Name() — the goto target
	Display string // formatted: "name (short)"
	Score   int    // higher = better match
	Index   int    // index into the original entries slice
}

FuzzyMatch represents a scored match result.

func FuzzyMatchPlugins

func FuzzyMatchPlugins(query string, entries []PluginEntry) []FuzzyMatch

FuzzyMatchPlugins scores all entries against query, returning non-zero matches sorted best-first. Empty query returns all entries.

type HelmRevisionEntry

type HelmRevisionEntry struct {
	Revision int
	Display  string
}

HelmRevisionEntry holds display data for one revision.

type HelmRollbackOverlay

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

HelmRollbackOverlay shows revision history and lets the user pick one.

func NewHelmRollbackOverlay

func NewHelmRollbackOverlay(width, height int) HelmRollbackOverlay

NewHelmRollbackOverlay creates a new rollback overlay with the given dimensions.

func (HelmRollbackOverlay) Active

func (h HelmRollbackOverlay) Active() bool

Active returns whether the overlay is currently active.

func (*HelmRollbackOverlay) Open

func (h *HelmRollbackOverlay) Open(name, namespace string, revisions []HelmRevisionEntry)

Open activates the overlay with the given revision list.

func (*HelmRollbackOverlay) OpenLoading added in v0.3.0

func (h *HelmRollbackOverlay) OpenLoading(name, namespace string)

OpenLoading activates the overlay in a loading state while history is fetched asynchronously.

func (*HelmRollbackOverlay) SetError added in v0.3.0

func (h *HelmRollbackOverlay) SetError(msg string)

SetError sets an error message in the overlay, clearing the loading state.

func (*HelmRollbackOverlay) SetRevisions added in v0.3.0

func (h *HelmRollbackOverlay) SetRevisions(entries []HelmRevisionEntry)

SetRevisions populates the overlay with fetched revision entries, clearing the loading state.

func (*HelmRollbackOverlay) SetSize

func (h *HelmRollbackOverlay) SetSize(w, height int)

SetSize updates the terminal dimensions available to the overlay.

func (HelmRollbackOverlay) Update

Update handles key events for the rollback overlay.

func (HelmRollbackOverlay) View

func (h HelmRollbackOverlay) View() string

View renders the overlay panel.

type HelpOverlay

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

HelpOverlay is a full-screen modal displaying all keybindings grouped by scope.

func NewHelpOverlay

func NewHelpOverlay(width, height int) HelpOverlay

NewHelpOverlay creates a new (inactive) help overlay.

func (HelpOverlay) Active

func (h HelpOverlay) Active() bool

Active reports whether the overlay is currently shown.

func (*HelpOverlay) Open

func (h *HelpOverlay) Open(groups []config.HintGroup)

Open activates the overlay with the provided hint groups.

func (HelpOverlay) ScrollForTest added in v0.5.0

func (h HelpOverlay) ScrollForTest() int

ScrollForTest returns the current scroll offset. Test-only accessor; the production View/Update paths consult the unexported field directly.

func (*HelpOverlay) ScrollWheel added in v0.5.0

func (h *HelpOverlay) ScrollWheel(btn tea.MouseButton)

ScrollWheel nudges the help overlay's vertical scroll by one line in response to a mouse wheel event. Up/down mirror the j/k/arrow keybindings. Left/right wheel and any other button are dropped.

func (*HelpOverlay) SetSize

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

SetSize updates the terminal dimensions.

func (HelpOverlay) Update

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

Update handles key events for the help overlay.

func (HelpOverlay) View

func (h HelpOverlay) View() string

View renders the help overlay. Returns empty string when inactive.

type LogView

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

LogView is a dedicated component for streaming pod logs with autoscroll, filtering, search, and built-in syntax highlighting.

func NewLogView

func NewLogView(width, height, bufCapacity int, defaultTimeRange string, defaultSinceSeconds int64) LogView

NewLogView creates a new log view with the given dimensions and ring buffer capacity.

func (LogView) ActiveContainer

func (lv LogView) ActiveContainer() string

ActiveContainer returns the currently active container name.

func (LogView) AnyActive

func (lv LogView) AnyActive() bool

AnyActive reports whether either search or filter is active.

func (*LogView) AppendLine

func (lv *LogView) AppendLine(line string)

AppendLine appends a log line to the ring buffer and updates the viewport.

func (*LogView) ApplySearch

func (lv *LogView) ApplySearch(pattern string, mode msgs.SearchMode) error

ApplySearch compiles the pattern and applies the given search mode.

func (LogView) Autoscroll

func (lv LogView) Autoscroll() bool

Autoscroll reports whether autoscroll is enabled.

func (*LogView) Blur

func (lv *LogView) Blur()

Blur marks this log view as unfocused.

func (*LogView) BufferLen added in v0.2.0

func (lv *LogView) BufferLen() int

BufferLen returns the number of lines in the log buffer.

func (*LogView) ClearAndRestart

func (lv *LogView) ClearAndRestart()

ClearAndRestart resets the ring buffer, clears viewport content, and re-enables autoscroll for a fresh log stream.

func (*LogView) ClearFilter

func (lv *LogView) ClearFilter()

ClearFilter removes the active filter and restores all lines.

func (*LogView) ClearSearch

func (lv *LogView) ClearSearch()

ClearSearch removes the active search highlights.

func (LogView) Containers

func (lv LogView) Containers() []string

Containers returns the list of available containers.

func (*LogView) DefaultSinceSeconds added in v0.2.0

func (lv *LogView) DefaultSinceSeconds() int64

DefaultSinceSeconds returns the configured default sinceSeconds value for log streams.

func (LogView) FilterActive

func (lv LogView) FilterActive() bool

FilterActive reports whether a filter is currently active.

func (*LogView) Focus

func (lv *LogView) Focus()

Focus marks this log view as focused.

func (*LogView) GotoBottom

func (lv *LogView) GotoBottom()

GotoBottom scrolls to the bottom of the content.

func (*LogView) GotoTop

func (lv *LogView) GotoTop()

GotoTop scrolls to the top of the content.

func (*LogView) InsertMarker added in v0.2.0

func (lv *LogView) InsertMarker()

InsertMarker inserts a dimmed timestamp marker line into the log buffer.

func (LogView) IsUnavailable

func (lv LogView) IsUnavailable() bool

IsUnavailable reports whether the log view is in the unavailable state.

func (LogView) Mode

func (lv LogView) Mode() msgs.DetailMode

Mode returns DetailLogs, identifying this as a log view component.

func (*LogView) PageDown

func (lv *LogView) PageDown()

PageDown scrolls the viewport down by one page.

func (*LogView) PageUp

func (lv *LogView) PageUp()

PageUp scrolls the viewport up by one page.

func (*LogView) ScrollDown

func (lv *LogView) ScrollDown()

ScrollDown scrolls the viewport down by one line.

func (*LogView) ScrollEnd added in v0.3.6

func (lv *LogView) ScrollEnd()

ScrollEnd scrolls horizontally to show the end of the longest visible line.

func (*LogView) ScrollHome added in v0.3.6

func (lv *LogView) ScrollHome()

ScrollHome resets horizontal scroll to the beginning of the line.

func (*LogView) ScrollLeft

func (lv *LogView) ScrollLeft()

ScrollLeft scrolls the viewport left by hScrollStep columns.

func (*LogView) ScrollRight

func (lv *LogView) ScrollRight()

ScrollRight scrolls the viewport right by hScrollStep columns.

func (*LogView) ScrollUp

func (lv *LogView) ScrollUp()

ScrollUp scrolls the viewport up by one line.

func (LogView) SearchActive

func (lv LogView) SearchActive() bool

SearchActive reports whether a search is active (highlights only).

func (*LogView) SearchNext

func (lv *LogView) SearchNext()

SearchNext navigates to the next search match.

func (*LogView) SearchPrev

func (lv *LogView) SearchPrev()

SearchPrev navigates to the previous search match.

func (*LogView) SetActiveContainer

func (lv *LogView) SetActiveContainer(name string)

SetActiveContainer sets the active container for log streaming.

func (*LogView) SetBorderless

func (lv *LogView) SetBorderless(b bool)

SetBorderless enables or disables borderless rendering.

func (*LogView) SetContainers

func (lv *LogView) SetContainers(containers []string)

SetContainers sets the list of available containers for the log view.

func (*LogView) SetInlineSearch

func (lv *LogView) SetInlineSearch(s string)

SetInlineSearch sets the inline search input text for rendering in the title.

func (*LogView) SetSize

func (lv *LogView) SetSize(w, h int)

SetSize updates the dimensions of the log view.

func (*LogView) SetTimeRangeLabel added in v0.2.0

func (lv *LogView) SetTimeRangeLabel(label string)

SetTimeRangeLabel sets the displayed time range label in the title.

func (*LogView) SetUnavailable

func (lv *LogView) SetUnavailable(v bool)

SetUnavailable marks the log view as unavailable (no loggable resource focused).

func (LogView) ShowHeader added in v0.3.2

func (lv LogView) ShowHeader() bool

ShowHeader reports whether the header bar is visible.

func (LogView) SyntaxEnabled added in v0.2.0

func (lv LogView) SyntaxEnabled() bool

SyntaxEnabled reports whether built-in syntax highlighting is enabled.

func (*LogView) ToggleAutoscroll

func (lv *LogView) ToggleAutoscroll()

ToggleAutoscroll toggles autoscroll on/off.

func (*LogView) ToggleHeader added in v0.3.2

func (lv *LogView) ToggleHeader()

ToggleHeader flips the header visibility and recalculates the viewport size.

func (*LogView) ToggleSyntax added in v0.2.0

func (lv *LogView) ToggleSyntax()

ToggleSyntax toggles built-in syntax highlighting on/off and re-renders.

func (*LogView) ToggleWrap

func (lv *LogView) ToggleWrap()

ToggleWrap toggles soft-wrap on the viewport. When enabling wrap, the horizontal offset is reset since horizontal scroll is a no-op.

func (LogView) Update

func (lv LogView) Update(msg tea.Msg) (LogView, tea.Cmd)

Update handles messages for viewport scrolling.

func (LogView) View

func (lv LogView) View() string

View renders the log view with border and title.

type NavSnapshot struct {
	Plugin           plugin.ResourcePlugin
	Namespace        string
	Objects          []*unstructured.Unstructured
	Cursor           int
	SortState        SortState
	FilterState      SearchState
	SearchState      SearchState
	ParentUID        string // UID of the parent resource that produced this drilled view
	ParentName       string // Name of the parent resource for breadcrumb display
	ParentAPIVersion string // API version of the parent resource for kind disambiguation
	ParentKind       string // Kind of the parent resource for kind disambiguation
}

NavSnapshot captures the full restorable state of a ResourceList pane.

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

NavStack is a simple LIFO stack for drill-down navigation.

func (s *NavStack) Depth() int

Depth returns the number of snapshots on the stack.

func (s *NavStack) HasGVR(gvr schema.GroupVersionResource, namespace string) bool

HasGVR reports whether any snapshot on the stack references the given GVR and namespace.

func (s *NavStack) Peek() (NavSnapshot, bool)

Peek returns the top snapshot without removing it. Returns false if empty.

func (s *NavStack) Pop() (NavSnapshot, bool)

Pop removes and returns the top snapshot. Returns false if empty.

func (s *NavStack) Push(snap NavSnapshot)

Push saves a snapshot onto the stack.

type NsPicker

type NsPicker struct {
	Picker[string]
}

NsPicker is an overlay that lets the user search and select a namespace.

func NewNsPicker

func NewNsPicker(width, height int) NsPicker

NewNsPicker creates a new namespace picker with the given dimensions.

func (*NsPicker) SetNamespaces

func (n *NsPicker) SetNamespaces(nss []string)

SetNamespaces stores the list of available namespaces, prepending "All Namespaces".

func (NsPicker) Update

func (n NsPicker) Update(msg tea.Msg) (NsPicker, tea.Cmd)

Update handles key messages for the namespace picker.

type Overlay

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

Overlay is a composable building block for modal overlay panels. It manages optional title, text inputs, scrollable item list, and footer.

func NewOverlay

func NewOverlay() Overlay

NewOverlay creates a new inactive overlay with sensible defaults.

func (Overlay) Active

func (o Overlay) Active() bool

Active returns whether the overlay is currently active.

func (*Overlay) AddInput

func (o *Overlay) AddInput(ti textinput.Model) int

AddInput appends a text input and returns its index. If a prompt style has been set, it is applied to the input.

func (Overlay) Content added in v0.7.0

func (o Overlay) Content() string

Content returns the overlay content text. Used by tests to assert on the stored message without parsing the full View output.

func (Overlay) Cursor

func (o Overlay) Cursor() int

Cursor returns the current cursor position.

func (*Overlay) FocusInput

func (o *Overlay) FocusInput(i int)

FocusInput sets focus to the input at index i, blurring all others.

func (*Overlay) FocusList

func (o *Overlay) FocusList()

FocusList sets focus to the item list, blurring all inputs.

func (*Overlay) FocusNextInput

func (o *Overlay) FocusNextInput()

FocusNextInput cycles focus forward: inputs -> list (-1) -> first input.

func (*Overlay) FocusPrevInput

func (o *Overlay) FocusPrevInput()

FocusPrevInput cycles focus backward: first input -> list (-1) -> last input.

func (Overlay) FocusedInput

func (o Overlay) FocusedInput() int

FocusedInput returns the index of the currently focused input (-1 = list).

func (*Overlay) HandleListKeys

func (o *Overlay) HandleListKeys(msg tea.KeyPressMsg) bool

HandleListKeys handles Up/Down key presses for list navigation. Returns true if the key was handled.

func (*Overlay) Input

func (o *Overlay) Input(i int) *textinput.Model

Input returns a pointer to the input at index i.

func (Overlay) InputCount

func (o Overlay) InputCount() int

InputCount returns the number of text inputs.

func (Overlay) InputValue

func (o Overlay) InputValue(i int) string

InputValue returns the current value of the input at index i.

func (Overlay) Items

func (o Overlay) Items() []string

Items returns the current item list.

func (*Overlay) Reset

func (o *Overlay) Reset()

Reset clears all dynamic state (inputs, cursor, offset) and deactivates.

func (Overlay) SelectedItem

func (o Overlay) SelectedItem() string

SelectedItem returns the item at the cursor, or "" if no items.

func (*Overlay) SetActive

func (o *Overlay) SetActive(v bool)

SetActive sets the overlay's active state.

func (*Overlay) SetContent

func (o *Overlay) SetContent(s string)

SetContent sets the overlay content text rendered inside the box.

func (*Overlay) SetCursor

func (o *Overlay) SetCursor(pos int)

SetCursor sets the cursor position, clamping to valid range.

func (*Overlay) SetFixedWidth

func (o *Overlay) SetFixedWidth(w int)

SetFixedWidth sets a fixed inner width. 0 means auto-size.

func (*Overlay) SetFooter

func (o *Overlay) SetFooter(f string)

SetFooter sets the overlay footer text.

func (*Overlay) SetItems

func (o *Overlay) SetItems(items []string)

SetItems sets the item list, marks items as configured, and resets the cursor.

func (*Overlay) SetItemsVisible

func (o *Overlay) SetItemsVisible(v bool)

SetItemsVisible controls whether the item list section is rendered.

func (*Overlay) SetMaxVisible

func (o *Overlay) SetMaxVisible(n int)

SetMaxVisible sets the maximum number of visible items in the list.

func (*Overlay) SetNoItemsMsg

func (o *Overlay) SetNoItemsMsg(msg string)

SetNoItemsMsg sets the message shown when the item list is empty.

func (*Overlay) SetPostListInputIdx

func (o *Overlay) SetPostListInputIdx(idx int)

SetPostListInputIdx configures which inputs render after the list. Inputs with index >= idx render after the list, others render before. Default 0 means all inputs render before the list (backward compatible).

func (*Overlay) SetPromptStyle

func (o *Overlay) SetPromptStyle(s lipgloss.Style)

SetPromptStyle sets a style applied to all subsequently added input prompts.

func (*Overlay) SetSize

func (o *Overlay) SetSize(w, h int)

SetSize updates the terminal dimensions available to the overlay.

func (*Overlay) SetTitle

func (o *Overlay) SetTitle(t string)

SetTitle sets the overlay title.

func (*Overlay) UpdateInputs

func (o *Overlay) UpdateInputs(msg tea.Msg) tea.Cmd

UpdateInputs forwards a message to the focused input and returns any command.

func (Overlay) View

func (o Overlay) View() string

View renders the overlay panel. Returns "" if inactive.

type OverlayOption

type OverlayOption func(*overlayOpts)

OverlayOption configures PlaceOverlay behavior.

func WithDim

func WithDim(d bool) OverlayOption

WithDim controls whether the background is dimmed. Enabled by default.

func WithOverlayPosition

func WithOverlayPosition(h, v float64) OverlayOption

WithOverlayPosition sets the normalized horizontal and vertical anchor. 0.5, 0.5 is center (the default). 0.5, 1.0 pins to bottom-center.

type OverlayRect added in v0.5.0

type OverlayRect struct {
	X, Y, W, H int
}

OverlayRect describes the screen area occupied by a rendered overlay. X,Y are the top-left cell coordinates; W,H are the overlay content width and height in cells.

func PlaceOverlayWithRect added in v0.5.0

func PlaceOverlayWithRect(bgWidth, bgHeight int, bg, overlay string, opts ...OverlayOption) (string, OverlayRect, bool)

PlaceOverlayWithRect is like PlaceOverlay but also returns the rect that the overlay occupies on screen. Splits and width measurement happen once. When overlay is empty, returns bg and a zero rect with ok=false.

func (OverlayRect) Contains added in v0.5.0

func (r OverlayRect) Contains(x, y int) bool

Contains reports whether the given cell coordinate lies inside the rect. Returns false for zero-sized rects (W == 0 || H == 0), which is the sentinel for "no active overlay".

type Picker

type Picker[T any] struct {
	// contains filtered or unexported fields
}

Picker is a generic filterable selection overlay.

func NewPicker

func NewPicker[T any](cfg PickerConfig[T], width, height int) Picker[T]

NewPicker creates a new Picker with the given config and dimensions.

func (Picker[T]) Active

func (p Picker[T]) Active() bool

Active returns whether the picker is currently displayed.

func (*Picker[T]) Close

func (p *Picker[T]) Close()

Close deactivates the picker.

func (Picker[T]) Cursor

func (p Picker[T]) Cursor() int

Cursor returns the current cursor position.

func (Picker[T]) Filtered

func (p Picker[T]) Filtered() []T

Filtered returns the current filtered item slice.

func (*Picker[T]) Open

func (p *Picker[T]) Open()

Open activates the picker, resets state, creates the filter input.

func (*Picker[T]) ScrollWheel added in v0.5.0

func (p *Picker[T]) ScrollWheel(btn tea.MouseButton)

ScrollWheel nudges the picker's selection by one item in response to a mouse wheel event. Up/down reuse the same cursor movement as k/j and the arrow keys. Left/right wheel and any other button are dropped.

func (*Picker[T]) SetItems

func (p *Picker[T]) SetItems(items []T)

SetItems replaces the source data and reapplies the filter.

func (*Picker[T]) SetSize

func (p *Picker[T]) SetSize(w, h int)

SetSize updates the dimensions.

func (Picker[T]) Update

func (p Picker[T]) Update(msg tea.Msg) (Picker[T], tea.Cmd)

Update handles key messages for the picker.

func (Picker[T]) View

func (p Picker[T]) View() string

View renders the picker overlay.

type PickerConfig

type PickerConfig[T any] struct {
	Title      string
	NoItemsMsg string
	MaxVisible int // 0 = auto from terminal height
	Display    func(T) string
	Filter     func(query string, items []T) []T
	OnSelect   func(T) tea.Cmd
}

PickerConfig holds construction-time options for a Picker.

type PluginEntry

type PluginEntry struct {
	Name      string
	ShortName string
	GVR       schema.GroupVersionResource
	Qualified bool
}

PluginEntry holds the minimal info needed for fuzzy matching.

func FilterPlugins

func FilterPlugins(query string, entries []PluginEntry) []PluginEntry

FilterPlugins returns PluginEntries matching query, sorted by score (best first).

type PortForwardOverlay

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

PortForwardOverlay is a single-view overlay for setting up port-forwards. It shows a filter input, a scrollable port list, and a local port input.

func NewPortForwardOverlay

func NewPortForwardOverlay(width, height int) PortForwardOverlay

NewPortForwardOverlay creates a new port-forward overlay with the given dimensions.

func (PortForwardOverlay) Active

func (p PortForwardOverlay) Active() bool

Active returns whether the overlay is currently active.

func (*PortForwardOverlay) Close

func (p *PortForwardOverlay) Close()

Close deactivates the overlay.

func (PortForwardOverlay) FocusedButton added in v0.2.0

func (p PortForwardOverlay) FocusedButton() int

FocusedButton returns the currently focused button index.

func (PortForwardOverlay) InputFocused added in v0.2.0

func (p PortForwardOverlay) InputFocused() bool

InputFocused returns whether a text input has focus (vs the button bar).

func (*PortForwardOverlay) Open

func (p *PortForwardOverlay) Open(podName, podNs string, ports []PortItem)

Open activates the overlay for a given pod, showing its available ports.

func (*PortForwardOverlay) SetSize

func (p *PortForwardOverlay) SetSize(w, h int)

SetSize updates the terminal dimensions available to the overlay.

func (PortForwardOverlay) Update

Update handles key messages for the port-forward overlay.

func (PortForwardOverlay) View

func (p PortForwardOverlay) View() string

View renders the overlay panel.

type PortItem

type PortItem struct {
	ContainerName string
	Port          int32
	Protocol      string
}

PortItem represents a container port available for forwarding.

type ResourceList

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

ResourceList wraps bubbles/table with plugin-driven columns.

func NewResourceList

func NewResourceList(p plugin.ResourcePlugin, width, height int) ResourceList

NewResourceList creates a new resource list for the given plugin.

func (*ResourceList) AnyActive

func (r *ResourceList) AnyActive() bool

AnyActive reports whether either search or filter is active.

func (*ResourceList) ApplySearch

func (r *ResourceList) ApplySearch(pattern string, mode msgs.SearchMode) error

ApplySearch compiles the regex pattern and applies search or filter mode. In search mode, all rows remain visible but matches are highlighted and cursor jumps to the first match. In filter mode, non-matching rows are hidden.

func (*ResourceList) Blur

func (r *ResourceList) Blur()

Blur marks this list as unfocused.

func (*ResourceList) BlurBorder

func (r *ResourceList) BlurBorder()

BlurBorder dims only the border, keeping the selected row style. Used when focus moves to the detail panel so the active selection remains visible.

func (*ResourceList) ClearFilter

func (r *ResourceList) ClearFilter()

ClearFilter removes the active filter and restores all rows.

func (*ResourceList) ClearSearch

func (r *ResourceList) ClearSearch()

ClearSearch removes the active search and restores highlighting.

func (*ResourceList) ClearSelection

func (r *ResourceList) ClearSelection()

ClearSelection removes all selections.

func (*ResourceList) Cursor

func (r *ResourceList) Cursor() int

Cursor returns selected element.

func (*ResourceList) CursorDown

func (r *ResourceList) CursorDown()

CursorDown moves the table cursor down by one row.

func (*ResourceList) CursorUp

func (r *ResourceList) CursorUp()

CursorUp moves the table cursor up by one row.

func (*ResourceList) EffectiveNamespace

func (r *ResourceList) EffectiveNamespace() string

EffectiveNamespace returns the namespace used for store operations. Returns "" for cluster-scoped plugins (they watch all namespaces).

func (*ResourceList) EnsureCursorVisible

func (r *ResourceList) EnsureCursorVisible()

EnsureCursorVisible adjusts cursor location.

func (*ResourceList) FilterActive

func (r *ResourceList) FilterActive() bool

FilterActive reports whether a filter is currently active.

func (*ResourceList) Focus

func (r *ResourceList) Focus()

Focus marks this list as focused.

func (*ResourceList) FocusBorder

func (r *ResourceList) FocusBorder()

FocusBorder restores the focused border without changing the selected row style. Pairs with BlurBorder when returning from detail-scroll mode.

func (*ResourceList) Focused

func (r *ResourceList) Focused() bool

Focused returns whether this list has focus.

func (*ResourceList) GotoBottom

func (r *ResourceList) GotoBottom()

GotoBottom moves the cursor to the last row.

func (*ResourceList) GotoTop

func (r *ResourceList) GotoTop()

GotoTop moves the cursor to the first row.

func (ResourceList) HasSelection

func (r ResourceList) HasSelection() bool

HasSelection reports whether any rows are selected.

func (ResourceList) Height

func (r ResourceList) Height() int

Height returns the current height.

func (*ResourceList) InDrillDown

func (r *ResourceList) InDrillDown() bool

InDrillDown reports whether this pane is in a drill-down child view.

func (*ResourceList) Len

func (r *ResourceList) Len() int

Len returns the number of displayed items.

func (*ResourceList) Namespace

func (r *ResourceList) Namespace() string

Namespace returns the namespace this list is scoped to.

func (*ResourceList) NavStackHasGVR

func (r *ResourceList) NavStackHasGVR(gvr schema.GroupVersionResource, namespace string) bool

NavStackHasGVR reports whether this pane's nav stack contains a snapshot referencing the given GVR and namespace.

func (*ResourceList) PageDown

func (r *ResourceList) PageDown()

PageDown moves the cursor down by one page.

func (*ResourceList) PageUp

func (r *ResourceList) PageUp()

PageUp moves the cursor up by one page.

func (*ResourceList) ParentContext

func (r *ResourceList) ParentContext() string

ParentContext returns the parent resource name shown in the title during drill-down.

func (*ResourceList) ParentSnap

func (r *ResourceList) ParentSnap() (NavSnapshot, bool)

ParentSnap returns a value copy of the top nav snapshot and an ok flag. The returned snapshot is a one-time copy — callers that mutate the nav stack (PushNav/PopNav) must re-fetch to see the new top.

func (*ResourceList) Plugin

func (r *ResourceList) Plugin() plugin.ResourcePlugin

Plugin returns the current plugin.

func (*ResourceList) PopNav

func (r *ResourceList) PopNav() bool

PopNav restores the previous pane state. Returns false if stack is empty.

func (*ResourceList) PushNav

func (r *ResourceList) PushNav(childPlugin plugin.ResourcePlugin, children []*unstructured.Unstructured, parentName string, parentUID string, parentAPIVersion string, parentKind string)

PushNav saves current state and switches to a drill-down child view.

func (*ResourceList) ResetForReload

func (r *ResourceList) ResetForReload()

ResetForReload unwinds the nav stack to root, restoring the root plugin and namespace. Sort/filter/search state is preserved. Objects are cleared and must be repopulated by the caller.

func (*ResourceList) ResetNav

func (r *ResourceList) ResetNav()

ResetNav clears the drill-down nav stack.

func (*ResourceList) RowAtY added in v0.5.0

func (r *ResourceList) RowAtY(y int) int

RowAtY maps a y-coordinate (relative to the ResourceList pane's top-left, y=0 = top border line that carries the injected title) to an index into the underlying display objects. Returns -1 for the border/header area or any y past the last data row. Chrome accounted for: 1 line for the top border (the title is injected into that border line via injectBorderTitle, so it shares the same row); the table's own header row is subtracted inside table.RowAtY.

func (*ResourceList) ScrollEnd added in v0.4.0

func (r *ResourceList) ScrollEnd()

ScrollEnd scrolls horizontally to show the end of the content.

func (*ResourceList) ScrollHome added in v0.4.0

func (r *ResourceList) ScrollHome()

ScrollHome resets horizontal scroll to the beginning.

func (*ResourceList) ScrollLeft

func (r *ResourceList) ScrollLeft()

ScrollLeft scrolls the resource list left by listScrollStep characters.

func (*ResourceList) ScrollRight

func (r *ResourceList) ScrollRight()

ScrollRight scrolls the resource list right by listScrollStep characters.

func (*ResourceList) ScrollWheel added in v0.5.0

func (r *ResourceList) ScrollWheel(btn tea.MouseButton)

ScrollWheel advances the cursor by one row in response to a mouse wheel event. Up/down reuse CursorUp/CursorDown (same as k/j). Left/right wheel and any other button are dropped.

func (*ResourceList) SearchActive

func (r *ResourceList) SearchActive() bool

SearchActive reports whether a search is currently active.

func (*ResourceList) SearchNext

func (r *ResourceList) SearchNext()

SearchNext moves the cursor to the next matching row after the current cursor position.

func (*ResourceList) SearchPrev

func (r *ResourceList) SearchPrev()

SearchPrev moves the cursor to the previous matching row before the current cursor position.

func (*ResourceList) SelectAll

func (r *ResourceList) SelectAll()

SelectAll selects all display objects. If all are already selected, deselects all.

func (*ResourceList) Selected

func (r *ResourceList) Selected() *unstructured.Unstructured

Selected returns the currently highlighted unstructured object.

func (*ResourceList) SelectedObjects

func (r *ResourceList) SelectedObjects() []*unstructured.Unstructured

SelectedObjects returns all selected objects in display order.

func (ResourceList) SelectionCount

func (r ResourceList) SelectionCount() int

SelectionCount returns the number of selected rows visible in the current display.

func (*ResourceList) SetCursor added in v0.5.0

func (r *ResourceList) SetCursor(row int)

SetCursor sets the table cursor to the given row index. Out-of-range values are clamped by the underlying table.

func (*ResourceList) SetInlineSearch

func (r *ResourceList) SetInlineSearch(s string)

SetInlineSearch sets the inline search input text for rendering in the title.

func (*ResourceList) SetNamespace

func (r *ResourceList) SetNamespace(ns string)

SetNamespace updates the namespace this list is scoped to.

func (*ResourceList) SetObjects

func (r *ResourceList) SetObjects(objs []*unstructured.Unstructured)

SetObjects replaces the displayed items with cursor position preservation.

func (*ResourceList) SetPlugin

func (r *ResourceList) SetPlugin(p plugin.ResourcePlugin)

SetPlugin changes the resource plugin and clears the list.

func (*ResourceList) SetSize

func (r *ResourceList) SetSize(w, h int)

SetSize updates the dimensions.

func (*ResourceList) SetSort

func (r *ResourceList) SetSort(column string)

SetSort toggles or changes the sort column and re-renders.

func (*ResourceList) SortState

func (r *ResourceList) SortState() SortState

SortState returns the current sort state.

func (*ResourceList) ToggleSelect

func (r *ResourceList) ToggleSelect()

ToggleSelect toggles the selection of the row under the cursor and advances the cursor.

func (ResourceList) Update

func (r ResourceList) Update(msg tea.Msg) (ResourceList, tea.Cmd)

Update handles key messages for table navigation.

func (ResourceList) View

func (r ResourceList) View() string

View renders the resource list with border and title.

func (ResourceList) Width

func (r ResourceList) Width() int

Width returns the current width.

type ResourcePicker

type ResourcePicker struct {
	Picker[PluginEntry]
}

ResourcePicker is an overlay that lets the user search and select a resource type.

func NewResourcePicker

func NewResourcePicker(width, height int) ResourcePicker

NewResourcePicker creates a new resource picker with the given dimensions.

func (*ResourcePicker) SetPlugins

func (rp *ResourcePicker) SetPlugins(entries []PluginEntry)

SetPlugins provides the list of available plugins.

func (ResourcePicker) Update

func (rp ResourcePicker) Update(msg tea.Msg) (ResourcePicker, tea.Cmd)

Update handles key messages for the resource picker.

type ScaleOverlay added in v0.2.0

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

ScaleOverlay is an overlay for changing the replica count of a resource.

func NewScaleOverlay added in v0.2.0

func NewScaleOverlay(width, height int) ScaleOverlay

NewScaleOverlay creates a new scale overlay with the given dimensions.

func (ScaleOverlay) Active added in v0.2.0

func (s ScaleOverlay) Active() bool

Active returns whether the overlay is currently active.

func (*ScaleOverlay) Close added in v0.2.0

func (s *ScaleOverlay) Close()

Close deactivates the overlay.

func (ScaleOverlay) FocusedButton added in v0.2.0

func (s ScaleOverlay) FocusedButton() int

FocusedButton returns the currently focused button index.

func (ScaleOverlay) InputFocused added in v0.2.0

func (s ScaleOverlay) InputFocused() bool

InputFocused returns whether the text input has focus (vs the button bar).

func (*ScaleOverlay) Open added in v0.2.0

func (s *ScaleOverlay) Open(resourceName, namespace string, gvr schema.GroupVersionResource, replicas int32)

Open activates the overlay, showing a single text input pre-filled with the current replica count.

func (*ScaleOverlay) SetSize added in v0.2.0

func (s *ScaleOverlay) SetSize(w, h int)

SetSize updates the terminal dimensions available to the overlay.

func (ScaleOverlay) Update added in v0.2.0

func (s ScaleOverlay) Update(msg tea.Msg) (ScaleOverlay, tea.Cmd)

Update handles key messages for the scale overlay.

func (ScaleOverlay) View added in v0.2.0

func (s ScaleOverlay) View() string

View renders the overlay panel.

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

SearchBar is a bottom-anchored overlay for entering search/filter patterns.

func NewSearchBar

func NewSearchBar(width int) SearchBar

NewSearchBar creates a new search bar with the given width.

func (SearchBar) Active

func (s SearchBar) Active() bool

Active reports whether the search bar is open.

func (*SearchBar) Close

func (s *SearchBar) Close()

Close deactivates the search bar.

func (SearchBar) InlineView

func (s SearchBar) InlineView() string

InlineView returns a styled string fragment for embedding in a title border. Returns "" when inactive. Includes prompt, text, and cursor. Error styling is applied via textinput styles set in SetError().

func (*SearchBar) Open

func (s *SearchBar) Open(mode msgs.SearchMode)

Open activates the search bar in the given mode.

func (*SearchBar) SetError

func (s *SearchBar) SetError(err string)

SetError sets an error message and toggles the input styling to indicate invalid regex. When err is non-empty, the prompt, text, and cursor turn red.

func (*SearchBar) SetValue

func (s *SearchBar) SetValue(v string)

SetValue sets the text input value (for testing).

func (*SearchBar) SetWidth

func (s *SearchBar) SetWidth(w int)

SetWidth updates the width of the search bar.

func (SearchBar) Update

func (s SearchBar) Update(msg tea.Msg) (SearchBar, tea.Cmd)

Update handles key messages for the search bar.

func (SearchBar) View

func (s SearchBar) View() string

View renders the search bar. Returns empty string when not active.

type SearchState

type SearchState struct {
	Pattern    string
	Mode       msgs.SearchMode
	Re         *regexp.Regexp
	MatchCount int
	CurrentIdx int
}

SearchState holds compiled regex and navigation cursor for one pane.

func (SearchState) Active

func (s SearchState) Active() bool

Active reports whether a search/filter is compiled and ready.

func (*SearchState) Clear

func (s *SearchState) Clear()

Clear resets all search state.

func (*SearchState) Compile

func (s *SearchState) Compile(pattern string, mode msgs.SearchMode) error

Compile parses pattern as a regex. Empty pattern clears state. On error, the previous search state is preserved (vim-like behavior).

func (SearchState) DisplayPattern

func (s SearchState) DisplayPattern() string

DisplayPattern returns the pattern if active, empty string otherwise.

func (*SearchState) NextIdx

func (s *SearchState) NextIdx() int

NextIdx advances the current index cyclically and returns it.

func (*SearchState) PrevIdx

func (s *SearchState) PrevIdx() int

PrevIdx reverses the current index cyclically and returns it.

type Searchable

type Searchable interface {
	ApplySearch(pattern string, mode msgs.SearchMode) error
	ClearSearch()
	ClearFilter()
	SearchActive() bool
	FilterActive() bool
	AnyActive() bool
	SearchNext()
	SearchPrev()
}

Searchable is the common interface for components that support search/filter. Both ResourceList and DetailView satisfy this interface.

type SetImageOverlay

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

SetImageOverlay is an overlay for changing container images.

func NewSetImageOverlay

func NewSetImageOverlay(width, height int) SetImageOverlay

NewSetImageOverlay creates a new set-image overlay with the given dimensions.

func (SetImageOverlay) Active

func (s SetImageOverlay) Active() bool

Active returns whether the overlay is currently active.

func (*SetImageOverlay) Close

func (s *SetImageOverlay) Close()

Close deactivates the overlay.

func (SetImageOverlay) FocusedButton added in v0.2.0

func (s SetImageOverlay) FocusedButton() int

FocusedButton returns the currently focused button index.

func (SetImageOverlay) InputFocused added in v0.2.0

func (s SetImageOverlay) InputFocused() bool

InputFocused returns whether a text input has focus (vs the button bar).

func (*SetImageOverlay) Open

func (s *SetImageOverlay) Open(resourceName, namespace string, gvr schema.GroupVersionResource, pluginName string, containers []msgs.ContainerImageChange)

Open activates the overlay, showing one text input per container.

func (*SetImageOverlay) SetSize

func (s *SetImageOverlay) SetSize(w, h int)

SetSize updates the terminal dimensions available to the overlay.

func (SetImageOverlay) Update

func (s SetImageOverlay) Update(msg tea.Msg) (SetImageOverlay, tea.Cmd)

Update handles key messages for the set-image overlay.

func (SetImageOverlay) View

func (s SetImageOverlay) View() string

View renders the overlay panel.

type SortState

type SortState struct {
	Column    string // matches a Column.Title, e.g. "NAME", "AGE", "STATUS"
	Ascending bool
}

SortState holds the active sort column and direction for one ResourceList.

func DefaultSortState

func DefaultSortState() SortState

DefaultSortState returns name ascending — the default for all new lists.

func SortStateForPlugin

func SortStateForPlugin(p plugin.ResourcePlugin) SortState

SortStateForPlugin returns the plugin's preferred default sort if it implements DefaultSorter, otherwise NAME ascending.

func (SortState) Indicator

func (s SortState) Indicator(column string) string

Indicator returns "▲" or "▼" for the active column, "" for all others.

func (SortState) Toggle

func (s SortState) Toggle(column string) SortState

Toggle returns a new SortState. Same column flips direction; new column resets to ascending.

type StatusBar

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

StatusBar displays context-sensitive key help at the bottom.

func NewStatusBar

func NewStatusBar(width int) StatusBar

func (*StatusBar) Busy added in v0.3.0

func (s *StatusBar) Busy() bool

func (*StatusBar) ClearHints

func (s *StatusBar) ClearHints()

func (*StatusBar) EndOperation added in v0.3.0

func (s *StatusBar) EndOperation()

func (*StatusBar) SetContextName added in v0.3.4

func (s *StatusBar) SetContextName(name string)

func (*StatusBar) SetError

func (s *StatusBar) SetError(err string) tea.Cmd

func (*StatusBar) SetHints

func (s *StatusBar) SetHints(hints []config.KeyHint)

func (*StatusBar) SetIndicator

func (s *StatusBar) SetIndicator(ind string)

func (*StatusBar) SetOnline added in v0.3.0

func (s *StatusBar) SetOnline(v bool)

func (*StatusBar) SetWarning

func (s *StatusBar) SetWarning(w string) tea.Cmd

func (*StatusBar) SetWidth

func (s *StatusBar) SetWidth(w int)

func (*StatusBar) StartOperation added in v0.3.0

func (s *StatusBar) StartOperation() tea.Cmd

func (*StatusBar) Update added in v0.3.0

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

func (*StatusBar) UpdateSpinner added in v0.3.0

func (s *StatusBar) UpdateSpinner(msg tea.Msg) tea.Cmd

func (StatusBar) View

func (s StatusBar) View() string

type TimeRangePicker

type TimeRangePicker struct {
	Picker[timePreset]
}

TimeRangePicker is an overlay for selecting a log time range.

func NewTimeRangePicker

func NewTimeRangePicker(width, height int) TimeRangePicker

NewTimeRangePicker creates a new time range picker with the given dimensions.

func (*TimeRangePicker) OpenPresets

func (t *TimeRangePicker) OpenPresets()

OpenPresets opens the picker with the predefined time range presets.

func (TimeRangePicker) Update

func (t TimeRangePicker) Update(msg tea.Msg) (TimeRangePicker, tea.Cmd)

Update handles key messages for the time range picker.

Jump to

Keyboard shortcuts

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