Documentation
¶
Index ¶
- Constants
- Variables
- func CalculateDuration(startStr, endStr string) string
- func CalculateVisibleHeight(totalHeight, itemCount, padding int) int
- func CopyToClipboardWithCountCmd(text string, count int) tea.Cmd
- func EnsureCursorVisible(cursor, scrollOffset, itemCount, visibleHeight int) int
- func FormatTime(timeStr, format string) string
- func FormatTimeStyled(timeStr, format string, maxLen int, style lipgloss.Style) string
- func IsScrollable(totalHeight, itemCount, padding int) bool
- func MoveCursor(cursor, delta, itemCount int) int
- func RenderCenteredLoading(spin spinner.Model, msg string, width, height int) string
- func RenderCenteredMessage(msg string, width, height int) string
- func RenderFilterBar(filter *FilterState, matchCount, totalCount, width int) string
- func RenderHistoryKind(kind string) string
- func RenderHistoryResult(result string) string
- func RenderOp(op ResourceOp) string
- func RenderPaddedError(err error) string
- func RenderResourceChanges(changes map[string]int, format ResourceChangesFormat) string
- func RenderScrollDownIndicator(canScroll bool) string
- func RenderScrollDownIndicatorWithConfig(canScroll bool, config ScrollIndicatorConfig) string
- func RenderScrollHint(canScrollUp, canScrollDown bool, padding string) string
- func RenderScrollIndicators(isScrollable, canScrollUp, canScrollDown bool, config ScrollIndicatorConfig) (upIndicator, downIndicator string)
- func RenderScrollUpIndicator(canScroll bool) string
- func RenderScrollUpIndicatorWithConfig(canScroll bool, config ScrollIndicatorConfig) string
- func RenderStatus(status ItemStatus) string
- type ConfirmModal
- func (m *ConfirmModal) GetBulkResources() []SelectedResource
- func (m *ConfirmModal) GetContextName() string
- func (m *ConfirmModal) GetContextType() string
- func (m *ConfirmModal) GetContextURN() string
- func (m *ConfirmModal) Hide()
- func (m *ConfirmModal) IsBulkOperation() bool
- func (m *ConfirmModal) SetKeys(cancel, confirm string)
- func (m *ConfirmModal) SetLabels(cancel, confirm string)
- func (m *ConfirmModal) Show(title, message, warning string)
- func (m *ConfirmModal) ShowBulkWithContext(title, message, warning string, resources []SelectedResource)
- func (m *ConfirmModal) ShowWithContext(title, message, warning, contextURN, contextName, contextType string)
- func (m *ConfirmModal) Update(msg tea.KeyMsg) (confirmed, cancelled bool, cmd tea.Cmd)
- func (m *ConfirmModal) View() string
- type CopiedToClipboardMsg
- type CursorState
- type DetailPanel
- type DetailPanelContent
- type DetailPanelResult
- type DiffRenderer
- type DiffType
- type ErrorModal
- type FilterState
- func (f *FilterState) Activate()
- func (f *FilterState) Active() bool
- func (f *FilterState) ActiveOrApplied() bool
- func (f *FilterState) Applied() bool
- func (f *FilterState) Clear()
- func (f *FilterState) Deactivate()
- func (f *FilterState) Matches(text string) bool
- func (f *FilterState) MatchesAny(texts ...string) bool
- func (f *FilterState) Text() string
- func (f *FilterState) Update(msg tea.KeyMsg) (tea.Cmd, bool)
- func (f *FilterState) View() string
- type FlashClearMsg
- type FocusLayer
- type FocusStack
- type Header
- func (h *Header) IsLoading() bool
- func (h *Header) SetData(data *HeaderData)
- func (h *Header) SetError(err error)
- func (h *Header) SetOperation(op OperationType)
- func (h *Header) SetPreviewSummary(summary PreviewSummary, state PreviewState)
- func (h *Header) SetSpinner(s spinner.Model)
- func (h *Header) SetSummary(summary ResourceSummary, state HeaderState)
- func (h *Header) SetViewMode(mode ViewMode)
- func (h *Header) SetWidth(width int)
- func (h *Header) Spinner() spinner.Model
- func (h *Header) View() string
- type HeaderData
- type HeaderState
- type HelpDialog
- type HelpItem
- type HistoryDetailPanel
- type HistoryItem
- type HistoryList
- func (h *HistoryList) AtBottom() bool
- func (h *HistoryList) AtTop() bool
- func (h *HistoryList) Clear()
- func (h *HistoryList) FilterActive() bool
- func (h *HistoryList) FilterInputActive() bool
- func (h *HistoryList) SelectedItem() *HistoryItem
- func (h *HistoryList) SetItems(items []HistoryItem)
- func (h *HistoryList) SetSize(width, height int)
- func (h *HistoryList) TotalItems() int
- func (h *HistoryList) Update(msg tea.Msg) tea.Cmd
- func (h *HistoryList) View() string
- type ImportModal
- func (m *ImportModal) GetImportID() string
- func (m *ImportModal) GetParentURN() string
- func (m *ImportModal) GetResourceName() string
- func (m *ImportModal) GetResourceType() string
- func (m *ImportModal) GetResourceURN() string
- func (m *ImportModal) Hide()
- func (m *ImportModal) SetError(err error)
- func (m *ImportModal) SetLoadingSuggestions(loading bool)
- func (m *ImportModal) SetSuggestions(suggestions []ImportSuggestion)
- func (m *ImportModal) Show(resourceType, resourceName, resourceURN, parentURN string)
- func (m *ImportModal) Update(msg tea.KeyMsg) (confirmed bool, cmd tea.Cmd)
- func (m *ImportModal) View() string
- type ImportSuggestion
- type InfoLine
- type ItemStatus
- type KeyMap
- type ListBase
- func (l *ListBase) ClearError()
- func (l *ListBase) Error() error
- func (l *ListBase) Height() int
- func (l *ListBase) InitSpinner()
- func (l *ListBase) IsLoading() bool
- func (l *ListBase) IsReady() bool
- func (l *ListBase) RenderLoadingState() (string, bool)
- func (l *ListBase) SetError(err error)
- func (l *ListBase) SetLoading(loading bool, msg string)
- func (l *ListBase) SetSize(width, height int)
- func (l *ListBase) SetSpinner(s spinner.Model)
- func (l *ListBase) Spinner() spinner.Model
- func (l *ListBase) Width() int
- type ModalBase
- func (m *ModalBase) CenterDialog(dialog string) string
- func (m *ModalBase) Height() int
- func (m *ModalBase) Hide()
- func (m *ModalBase) RenderDialog(title, content, footer string) string
- func (m *ModalBase) RenderDialogWithStyle(style lipgloss.Style, parts ...string) string
- func (m *ModalBase) RenderScrollableDialog(params ScrollableDialogContent) ScrollableDialogResult
- func (m *ModalBase) ResetScroll()
- func (m *ModalBase) ScrollDown(lines int)
- func (m *ModalBase) ScrollOffset() int
- func (m *ModalBase) ScrollUp(lines int)
- func (m *ModalBase) SetScrollOffset(offset int)
- func (m *ModalBase) SetSize(width, height int)
- func (m *ModalBase) Show()
- func (m *ModalBase) Toggle()
- func (m *ModalBase) Visible() bool
- func (m *ModalBase) Width() int
- type OperationType
- type PanelBase
- func (p *PanelBase) Height() int
- func (p *PanelBase) Hide()
- func (p *PanelBase) ResetScroll()
- func (p *PanelBase) ScrollDown(lines int)
- func (p *PanelBase) ScrollOffset() int
- func (p *PanelBase) ScrollUp(lines int)
- func (p *PanelBase) SetScrollOffset(offset int)
- func (p *PanelBase) SetSize(width, height int)
- func (p *PanelBase) Show()
- func (p *PanelBase) Toggle()
- func (p *PanelBase) Visible() bool
- func (p *PanelBase) Width() int
- type PreviewState
- type PreviewSummary
- type ResourceChangesFormat
- type ResourceFlags
- type ResourceItem
- type ResourceJSON
- type ResourceList
- func (r *ResourceList) AddItem(item ResourceItem)
- func (r *ResourceList) AtBottom() bool
- func (r *ResourceList) AtTop() bool
- func (r *ResourceList) Clear()
- func (r *ResourceList) ClearAllFlags()
- func (r *ResourceList) ClearDiscreteSelections()
- func (r *ResourceList) ClearFlash()
- func (r *ResourceList) CopyAllResourcesJSON() tea.Cmd
- func (r *ResourceList) CopyResourceJSON() tea.Cmd
- func (r *ResourceList) FilterActive() bool
- func (r *ResourceList) FilterInputActive() bool
- func (r *ResourceList) FilterText() string
- func (r *ResourceList) GetExcludeURNs() []string
- func (r *ResourceList) GetReplaceURNs() []string
- func (r *ResourceList) GetSelectedResourcesForStateDelete() []SelectedResource
- func (r *ResourceList) GetTargetURNs() []string
- func (r *ResourceList) HasDiscreteSelections() bool
- func (r *ResourceList) HasFlags() bool
- func (r *ResourceList) IsDiscretelySelected(urn string) bool
- func (r *ResourceList) ScrollPercent() float64
- func (r *ResourceList) SelectedItem() *ResourceItem
- func (r *ResourceList) SetItems(items []ResourceItem)
- func (r *ResourceList) SetShowAllOps(show bool)
- func (r *ResourceList) SetSize(width, height int)
- func (r *ResourceList) Summary() ResourceSummary
- func (r *ResourceList) TotalLines() int
- func (r *ResourceList) Update(msg tea.Msg) tea.Cmd
- func (r *ResourceList) UpdateItemStatus(urn string, status ItemStatus)
- func (r *ResourceList) View() string
- func (r *ResourceList) VisibleCount() int
- func (r *ResourceList) VisibleLines() int
- func (r *ResourceList) VisualMode() bool
- type ResourceOp
- type ResourceSummary
- type ScrollIndicatorConfig
- type ScrollableDialogContent
- type ScrollableDialogResult
- type SelectedResource
- type SelectorDialog
- func (s *SelectorDialog[T]) HasItems() bool
- func (s *SelectorDialog[T]) Hide()
- func (s *SelectorDialog[T]) SelectedItem() *T
- func (s *SelectorDialog[T]) SetEmptyText(text string)
- func (s *SelectorDialog[T]) SetError(err error)
- func (s *SelectorDialog[T]) SetExtraInfoRenderer(fn func(item T) string)
- func (s *SelectorDialog[T]) SetItemRenderer(fn func(item T, isCursor bool) string)
- func (s *SelectorDialog[T]) SetItems(items []T)
- func (s *SelectorDialog[T]) SetLoading(loading bool)
- func (s *SelectorDialog[T]) SetLoadingText(text string)
- func (s *SelectorDialog[T]) SetMaxVisible(maxItems int)
- func (s *SelectorDialog[T]) SetSize(width, height int)
- func (s *SelectorDialog[T]) SetTitle(title string)
- func (s *SelectorDialog[T]) Show()
- func (s *SelectorDialog[T]) Update(msg tea.KeyMsg) (selected bool, cmd tea.Cmd)
- func (s *SelectorDialog[T]) View() string
- func (s *SelectorDialog[T]) Visible() bool
- type SelectorItem
- type StackInitModal
- func (m *StackInitModal) GetPassphrase() string
- func (m *StackInitModal) GetSecretsProvider() string
- func (m *StackInitModal) GetStackName() string
- func (m *StackInitModal) IsComplete() bool
- func (m *StackInitModal) NeedsPassphrase() bool
- func (m *StackInitModal) SetAuthEnv(env map[string]string)
- func (m *StackInitModal) SetBackendInfo(user, url string)
- func (m *StackInitModal) SetStackFiles(files []pulumi.StackFileInfo)
- func (m *StackInitModal) ShouldSkipPassphrase() bool
- func (m *StackInitModal) Show()
- func (m *StackInitModal) Update(msg tea.KeyMsg) (StepModalAction, tea.Cmd)
- type StackItem
- type StackSelector
- func (s *StackSelector) HasStacks() bool
- func (s *StackSelector) IsNewStackSelected() bool
- func (s *StackSelector) SelectedStack() string
- func (s *StackSelector) SetShowNewOption(show bool)
- func (s *StackSelector) SetStacks(stacks []StackItem)
- func (s *StackSelector) Update(msg tea.KeyMsg) (selected bool, cmd tea.Cmd)
- func (s *StackSelector) View() string
- type StackSource
- type StepModal
- func (m *StepModal) ClearError()
- func (m *StepModal) CurrentStep() int
- func (m *StepModal) GetResult(step int) string
- func (m *StepModal) IsLastStep() bool
- func (m *StepModal) NextStep() bool
- func (m *StepModal) PrevStep() bool
- func (m *StepModal) SetError(err error)
- func (m *StepModal) SetResult(step int, value string)
- func (m *StepModal) SetStepInfoLines(step int, lines []InfoLine)
- func (m *StepModal) SetStepSuggestions(step int, suggestions []StepSuggestion)
- func (m *StepModal) SetStepWarning(step int, warning string)
- func (m *StepModal) SetSteps(steps []StepModalStep)
- func (m *StepModal) Show()
- func (m *StepModal) Update(msg tea.KeyMsg) (StepModalAction, tea.Cmd)
- func (m *StepModal) View() string
- type StepModalAction
- type StepModalStep
- type StepSuggestion
- type Toast
- type ToastHideMsg
- type ToastMsg
- type ViewMode
- type WorkspaceItem
- type WorkspaceSelector
- func (s *WorkspaceSelector) HasWorkspaces() bool
- func (s *WorkspaceSelector) SelectedWorkspace() *WorkspaceItem
- func (s *WorkspaceSelector) SetWorkspaces(workspaces []WorkspaceItem)
- func (s *WorkspaceSelector) Update(msg tea.KeyMsg) (selected bool, cmd tea.Cmd)
- func (s *WorkspaceSelector) View() string
Constants ¶
const ( IconPending = "○" IconRunning = "◐" // or use spinner IconSuccess = "✓" IconFailed = "✗" )
Status icons
const ( // Text input widths DefaultInputWidth = 50 // Modal and dialog dimensions DefaultModalMaxHeight = 20 DefaultDialogMaxWidth = 80 ErrorDialogMaxWidth = 120 // Error modals are wider to show detailed output DefaultDialogMaxHeight = 30 MinContentWidth = 20 MinContentHeight = 5 DialogPaddingAllowance = 6 // Padding around dialog content DialogChromeAllowance = 10 // Title, summary, footer space // Resource list rendering DefaultMaxTypeLength = 50 MinTypeLength = 20 // Text formatting DefaultMaxStringLength = 30 MinFormattedStringLength = 20 ArrayItemTruncateLength = 30 ArrayItemTruncateDisplay = 27 // Length to show before "..." )
Layout constants for UI components
const ( OpCreate = pulumi.OpCreate OpUpdate = pulumi.OpUpdate OpDelete = pulumi.OpDelete OpSame = pulumi.OpSame OpReplace = pulumi.OpReplace OpCreateReplace = pulumi.OpCreateReplace OpDeleteReplace = pulumi.OpDeleteReplace OpRead = pulumi.OpRead OpRefresh = pulumi.OpRefresh )
ResourceOp constants - aliased from pulumi package
const ( OperationUp = pulumi.OperationUp OperationRefresh = pulumi.OperationRefresh OperationDestroy = pulumi.OperationDestroy )
OperationType constants - aliased from pulumi package
const FlashDuration = 100 * time.Millisecond
FlashDuration is how long the highlight flash lasts
const ToastDuration = 4 * time.Second
ToastDuration is how long the toast is visible
Variables ¶
var ( ColorPrimary = lipgloss.Color("#7aa2f7") ColorSecondary = lipgloss.Color("#bb9af7") ColorText = lipgloss.Color("#c0caf5") ColorDim = lipgloss.Color("#565f89") ColorError = lipgloss.Color("#f7768e") ColorBg = lipgloss.Color("#1a1b26") ColorSelection = lipgloss.Color("#283457") // subtle selection highlight (visual range) ColorDiscreteSelection = lipgloss.Color("#3d4f2f") // discrete selection (green-ish) ColorBothSelection = lipgloss.Color("#4a3f5c") // both visual and discrete (purple-ish) ColorFlash = lipgloss.Color("#3d59a1") // brighter flash highlight // Operation colors ColorCreate = lipgloss.Color("#9ece6a") // green ColorUpdate = lipgloss.Color("#e0af68") // yellow/orange ColorDelete = lipgloss.Color("#f7768e") // red ColorReplace = lipgloss.Color("#bb9af7") // purple ColorRefresh = lipgloss.Color("#7dcfff") // cyan ColorSuccess = lipgloss.Color("#9ece6a") // green (same as create) // Flag colors ColorTarget = lipgloss.Color("#7dcfff") // cyan ColorExclude = lipgloss.Color("#f7768e") // red (same as error/delete) ColorProtect = lipgloss.Color("#f5a623") // masterlock yellow )
Color palette (Tokyo Night)
var ( // Text styles LabelStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorSecondary) ValueStyle = lipgloss.NewStyle(). Foreground(ColorText) DimStyle = lipgloss.NewStyle(). Foreground(ColorDim) ErrorStyle = lipgloss.NewStyle(). Foreground(ColorError) // Box styles BoxStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorDim). Padding(0, 1) // Dialog styles DialogStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorPrimary). Padding(1, 2) DialogTitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorPrimary). MarginBottom(1) // Operation styles OpCreateStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorCreate) OpUpdateStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorUpdate) OpDeleteStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorDelete) OpReplaceStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorReplace) OpRefreshStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorRefresh) // Execution status styles StatusPendingStyle = lipgloss.NewStyle().Foreground(ColorDim) StatusRunningStyle = lipgloss.NewStyle().Foreground(ColorPrimary) StatusSuccessStyle = lipgloss.NewStyle().Foreground(ColorSuccess) StatusFailedStyle = lipgloss.NewStyle().Foreground(ColorError) // Scroll indicator styles - bright cyan for high visibility ScrollIndicatorStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorRefresh) // Use bright cyan for better visibility // Cursor and selection styles CursorStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorPrimary) SelectionStyle = lipgloss.NewStyle(). Background(ColorSelection) // Flag badge styles FlagTargetStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorTarget) FlagReplaceStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorReplace) FlagExcludeStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorExclude) FlagProtectStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorProtect) // View mode label styles ViewLabelStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorPrimary) // Tree connector style for component resources TreeLineStyle = lipgloss.NewStyle(). Foreground(ColorDim) )
Styles
var Keys = KeyMap{ Up: key.NewBinding( key.WithKeys("up", "k"), key.WithHelp("↑/k", "up"), ), Down: key.NewBinding( key.WithKeys("down", "j"), key.WithHelp("↓/j", "down"), ), PageUp: key.NewBinding( key.WithKeys("pgup", "ctrl+b"), key.WithHelp("pgup", "page up"), ), PageDown: key.NewBinding( key.WithKeys("pgdown", "ctrl+f"), key.WithHelp("pgdn", "page down"), ), Home: key.NewBinding( key.WithKeys("home", "g"), key.WithHelp("g", "top"), ), End: key.NewBinding( key.WithKeys("end", "G"), key.WithHelp("G", "bottom"), ), ToggleTarget: key.NewBinding( key.WithKeys("T"), key.WithHelp("T", "toggle target"), ), ToggleReplace: key.NewBinding( key.WithKeys("R"), key.WithHelp("R", "toggle replace"), ), ToggleExclude: key.NewBinding( key.WithKeys("E"), key.WithHelp("E", "toggle exclude"), ), ClearFlags: key.NewBinding( key.WithKeys("c"), key.WithHelp("c", "clear flags"), ), ClearAllFlags: key.NewBinding( key.WithKeys("C"), key.WithHelp("C", "clear all flags"), ), VisualMode: key.NewBinding( key.WithKeys("v"), key.WithHelp("v", "visual select"), ), ToggleSelect: key.NewBinding( key.WithKeys(" "), key.WithHelp("space", "toggle select"), ), Escape: key.NewBinding( key.WithKeys("esc"), key.WithHelp("esc", "cancel"), ), PreviewUp: key.NewBinding( key.WithKeys("u"), key.WithHelp("u", "preview up"), ), PreviewRefresh: key.NewBinding( key.WithKeys("r"), key.WithHelp("r", "preview refresh"), ), PreviewDestroy: key.NewBinding( key.WithKeys("d"), key.WithHelp("d", "preview destroy"), ), ExecuteUp: key.NewBinding( key.WithKeys("ctrl+u"), key.WithHelp("ctrl+u", "execute up"), ), ExecuteRefresh: key.NewBinding( key.WithKeys("ctrl+r"), key.WithHelp("ctrl+r", "execute refresh"), ), ExecuteDestroy: key.NewBinding( key.WithKeys("ctrl+d"), key.WithHelp("ctrl+d", "execute destroy"), ), CopyResource: key.NewBinding( key.WithKeys("y"), key.WithHelp("y", "copy resource JSON"), ), CopyAllResources: key.NewBinding( key.WithKeys("Y"), key.WithHelp("Y", "copy all resources JSON"), ), ToggleDetails: key.NewBinding( key.WithKeys("D"), key.WithHelp("D", "toggle details"), ), SelectStack: key.NewBinding( key.WithKeys("s"), key.WithHelp("s", "select stack"), ), SelectWorkspace: key.NewBinding( key.WithKeys("w"), key.WithHelp("w", "select workspace"), ), ViewHistory: key.NewBinding( key.WithKeys("h"), key.WithHelp("h", "view history"), ), Import: key.NewBinding( key.WithKeys("I"), key.WithHelp("I", "import resource"), ), DeleteFromState: key.NewBinding( key.WithKeys("x"), key.WithHelp("x", "delete from state"), ), ToggleProtect: key.NewBinding( key.WithKeys("P"), key.WithHelp("P", "toggle protect"), ), OpenResource: key.NewBinding( key.WithKeys("o"), key.WithHelp("o", "open resource"), ), Filter: key.NewBinding( key.WithKeys("/"), key.WithHelp("/", "filter"), ), Help: key.NewBinding( key.WithKeys("?"), key.WithHelp("?", "help"), ), Quit: key.NewBinding( key.WithKeys("q", "ctrl+c"), key.WithHelp("q", "quit"), ), }
Keys is the default keybinding configuration
Functions ¶
func CalculateDuration ¶
CalculateDuration calculates the duration between two RFC3339 time strings and returns a human-readable string. Returns empty string on parse error.
func CalculateVisibleHeight ¶
CalculateVisibleHeight returns the number of lines available for items. Accounts for padding and scroll indicators if content is scrollable.
func CopyToClipboardWithCountCmd ¶
CopyToClipboardWithCountCmd returns a command to copy text to the clipboard with a count
func EnsureCursorVisible ¶
EnsureCursorVisible adjusts scroll offset to keep cursor visible within the viewport. Returns the new scroll offset.
func FormatTime ¶
FormatTime parses an RFC3339 time string and formats it with the given format. Returns the original string if parsing fails.
func FormatTimeStyled ¶
FormatTimeStyled parses an RFC3339 time string and formats it with styling. If parsing fails and the string is longer than maxLen, it truncates the string. Pass maxLen <= 0 to skip truncation on parse failure.
func IsScrollable ¶
IsScrollable returns true if there are more items than can fit in the base height.
func MoveCursor ¶
MoveCursor moves the cursor by delta, clamping to valid range [0, itemCount-1]. Returns the new cursor position.
func RenderCenteredLoading ¶
RenderCenteredLoading renders a loading state with spinner centered in the given dimensions
func RenderCenteredMessage ¶
RenderCenteredMessage renders a dim message centered in the given dimensions
func RenderFilterBar ¶ added in v0.6.0
func RenderFilterBar(filter *FilterState, matchCount, totalCount, width int) string
RenderFilterBar renders a filter bar with match count
func RenderHistoryKind ¶
RenderHistoryKind renders a history operation kind with appropriate styling
func RenderHistoryResult ¶
RenderHistoryResult renders a history operation result with appropriate styling
func RenderOp ¶
func RenderOp(op ResourceOp) string
RenderOp renders a resource operation with appropriate styling
func RenderPaddedError ¶
RenderPaddedError renders an error with padding
func RenderResourceChanges ¶
func RenderResourceChanges(changes map[string]int, format ResourceChangesFormat) string
RenderResourceChanges renders a map of resource changes with appropriate styling. The changes map typically has keys: "create", "update", "delete", "replace", "same".
func RenderScrollDownIndicator ¶
RenderScrollDownIndicator renders a down scroll indicator with proper spacing. Returns styled arrow if canScroll is true, otherwise returns empty spacing.
func RenderScrollDownIndicatorWithConfig ¶
func RenderScrollDownIndicatorWithConfig(canScroll bool, config ScrollIndicatorConfig) string
RenderScrollDownIndicatorWithConfig renders a down scroll indicator with custom configuration.
func RenderScrollHint ¶
RenderScrollHint renders a text-based scroll hint for dialogs/modals. This uses text like "↑↓ more" rather than arrow symbols for inline hints.
func RenderScrollIndicators ¶
func RenderScrollIndicators(isScrollable, canScrollUp, canScrollDown bool, config ScrollIndicatorConfig) (upIndicator, downIndicator string)
RenderScrollIndicators renders both up and down scroll indicators based on current scroll state. This is the unified method for rendering scroll indicators throughout the UI. Returns upIndicator, downIndicator strings (both include newlines when non-empty).
func RenderScrollUpIndicator ¶
RenderScrollUpIndicator renders an up scroll indicator with proper spacing. Returns styled arrow if canScroll is true, otherwise returns empty spacing.
func RenderScrollUpIndicatorWithConfig ¶
func RenderScrollUpIndicatorWithConfig(canScroll bool, config ScrollIndicatorConfig) string
RenderScrollUpIndicatorWithConfig renders an up scroll indicator with custom configuration.
func RenderStatus ¶
func RenderStatus(status ItemStatus) string
RenderStatus renders a status with appropriate styling
Types ¶
type ConfirmModal ¶
type ConfirmModal struct {
ModalBase // Embedded modal base for common functionality
// contains filtered or unexported fields
}
ConfirmModal is a reusable confirmation dialog with keybind actions
func NewConfirmModal ¶
func NewConfirmModal() *ConfirmModal
NewConfirmModal creates a new confirmation modal
func (*ConfirmModal) GetBulkResources ¶ added in v0.8.0
func (m *ConfirmModal) GetBulkResources() []SelectedResource
GetBulkResources returns the stored bulk resources (nil for single-resource operations)
func (*ConfirmModal) GetContextName ¶
func (m *ConfirmModal) GetContextName() string
GetContextName returns the stored context name
func (*ConfirmModal) GetContextType ¶
func (m *ConfirmModal) GetContextType() string
GetContextType returns the stored context type
func (*ConfirmModal) GetContextURN ¶
func (m *ConfirmModal) GetContextURN() string
GetContextURN returns the stored context URN
func (*ConfirmModal) Hide ¶
func (m *ConfirmModal) Hide()
Hide hides the confirmation modal and clears context
func (*ConfirmModal) IsBulkOperation ¶ added in v0.8.0
func (m *ConfirmModal) IsBulkOperation() bool
IsBulkOperation returns true if this is a bulk operation with multiple resources
func (*ConfirmModal) SetKeys ¶
func (m *ConfirmModal) SetKeys(cancel, confirm string)
SetKeys customizes the keybinds (default: y to confirm, n to cancel)
func (*ConfirmModal) SetLabels ¶
func (m *ConfirmModal) SetLabels(cancel, confirm string)
SetLabels customizes the action labels
func (*ConfirmModal) Show ¶
func (m *ConfirmModal) Show(title, message, warning string)
Show shows the confirmation modal with the given content
func (*ConfirmModal) ShowBulkWithContext ¶ added in v0.8.0
func (m *ConfirmModal) ShowBulkWithContext(title, message, warning string, resources []SelectedResource)
ShowBulkWithContext shows the modal for bulk operations with multiple resources
func (*ConfirmModal) ShowWithContext ¶
func (m *ConfirmModal) ShowWithContext(title, message, warning, contextURN, contextName, contextType string)
ShowWithContext shows the modal and stores context data
func (*ConfirmModal) Update ¶
Update handles key events and returns confirmation status and any tea command.
func (*ConfirmModal) View ¶
func (m *ConfirmModal) View() string
View renders the confirmation modal
type CopiedToClipboardMsg ¶
type CopiedToClipboardMsg struct {
Success bool
Count int // Number of items copied (for visual feedback)
}
CopiedToClipboardMsg is sent after text is copied to the clipboard
type CursorState ¶
CursorState holds cursor and scroll state for list components
type DetailPanel ¶
type DetailPanel struct {
PanelBase // Embed common panel functionality
// contains filtered or unexported fields
}
DetailPanel is a floating panel showing resource details
func NewDetailPanel ¶
func NewDetailPanel() *DetailPanel
NewDetailPanel creates a new detail panel component
func (*DetailPanel) FilterActive ¶ added in v0.6.0
func (d *DetailPanel) FilterActive() bool
FilterActive returns whether the filter is currently active
func (*DetailPanel) SetResource ¶
func (d *DetailPanel) SetResource(resource *ResourceItem)
SetResource sets the resource to display details for
type DetailPanelContent ¶
type DetailPanelContent struct {
Header string // Header text (e.g., resource name)
Content string // Main content to display
Width int // Panel width
Height int // Panel height
ScrollOffset int // Current scroll position
}
DetailPanelContent holds the parameters for rendering a detail panel
type DetailPanelResult ¶
type DetailPanelResult struct {
Rendered string // The fully rendered panel
VisibleLines []string // The visible content lines (for selection extraction)
NewScrollOffset int // Adjusted scroll offset (clamped to valid range)
}
DetailPanelResult holds the result of rendering a detail panel
func RenderDetailPanel ¶
func RenderDetailPanel(params DetailPanelContent) DetailPanelResult
RenderDetailPanel renders a scrollable detail panel with header and content. This consolidates the common rendering logic between DetailPanel and HistoryDetailPanel.
type DiffRenderer ¶
type DiffRenderer struct {
// contains filtered or unexported fields
}
DiffRenderer handles rendering of property diffs
func NewDiffRenderer ¶
func NewDiffRenderer(maxWidth int) *DiffRenderer
NewDiffRenderer creates a new diff renderer with the specified max width
func (*DiffRenderer) ClearKeyFilter ¶ added in v0.6.0
func (r *DiffRenderer) ClearKeyFilter()
ClearKeyFilter removes the key filter
func (*DiffRenderer) RenderCombinedProperties ¶
func (r *DiffRenderer) RenderCombinedProperties(resource *ResourceItem) string
RenderCombinedProperties renders inputs and outputs in a single unified diff view Properties that exist in both inputs and outputs are shown once (from inputs for diff) Output-only properties (computed values like id, arn) are shown separately at the end
func (*DiffRenderer) SetKeyFilter ¶ added in v0.6.0
func (r *DiffRenderer) SetKeyFilter(filter func(key string) bool)
SetKeyFilter sets a filter function for property keys Only keys where filter(key) returns true will be displayed
type ErrorModal ¶
type ErrorModal struct {
ModalBase // Embedded modal base for common functionality
// contains filtered or unexported fields
}
ErrorModal is a modal dialog for displaying detailed error information
func (*ErrorModal) SetSize ¶
func (m *ErrorModal) SetSize(width, height int)
SetSize sets the dialog dimensions for centering and sizes the viewport
func (*ErrorModal) Show ¶
func (m *ErrorModal) Show(title, summary, details string)
Show shows the error modal with the given content
type FilterState ¶ added in v0.6.0
type FilterState struct {
// contains filtered or unexported fields
}
FilterState manages filter state for list components
func NewFilterState ¶ added in v0.6.0
func NewFilterState() FilterState
NewFilterState creates a new filter state
func (*FilterState) Activate ¶ added in v0.6.0
func (f *FilterState) Activate()
Activate enters filter mode, resetting any previous filter text
func (*FilterState) Active ¶ added in v0.6.0
func (f *FilterState) Active() bool
Active returns whether filter input mode is active (user is typing)
func (*FilterState) ActiveOrApplied ¶ added in v0.6.0
func (f *FilterState) ActiveOrApplied() bool
ActiveOrApplied returns true if the filter is either being typed in or has text applied
func (*FilterState) Applied ¶ added in v0.6.0
func (f *FilterState) Applied() bool
Applied returns whether a filter is currently applied (has text)
func (*FilterState) Clear ¶ added in v0.6.0
func (f *FilterState) Clear()
Clear clears the filter text but stays in filter mode
func (*FilterState) Deactivate ¶ added in v0.6.0
func (f *FilterState) Deactivate()
Deactivate exits filter mode but keeps filter text applied
func (*FilterState) Matches ¶ added in v0.6.0
func (f *FilterState) Matches(text string) bool
Matches returns true if the given text matches the filter (case-insensitive)
func (*FilterState) MatchesAny ¶ added in v0.6.0
func (f *FilterState) MatchesAny(texts ...string) bool
MatchesAny returns true if any of the given texts match the filter (case-insensitive)
func (*FilterState) Text ¶ added in v0.6.0
func (f *FilterState) Text() string
Text returns the current filter text
func (*FilterState) Update ¶ added in v0.6.0
Update handles key events when filter is active Returns: (tea.Cmd, handled bool)
func (*FilterState) View ¶ added in v0.6.0
func (f *FilterState) View() string
View returns the filter input view
type FocusLayer ¶
type FocusLayer int
FocusLayer represents what component currently owns keyboard input
const ( FocusMain FocusLayer = iota // Normal app interaction (resource list, history list) FocusDetailsPanel // Details panel is open and capturing scroll keys FocusHelp // Help dialog open FocusStackSelector // Stack selector modal FocusWorkspaceSelector // Workspace selector modal FocusImportModal // Import modal FocusStackInitModal // Stack creation modal FocusConfirmModal // Confirmation dialog FocusErrorModal // Error dialog (highest priority) )
func (FocusLayer) String ¶
func (f FocusLayer) String() string
String returns a human-readable name for the focus layer
type FocusStack ¶
type FocusStack struct {
// contains filtered or unexported fields
}
FocusStack manages the stack of focus layers. The stack always has at least one element (FocusMain at the bottom).
func NewFocusStack ¶
func NewFocusStack() FocusStack
NewFocusStack creates a new focus stack with FocusMain as the base layer
func (*FocusStack) Clear ¶
func (f *FocusStack) Clear()
Clear resets the stack to just the base FocusMain layer
func (*FocusStack) Current ¶
func (f *FocusStack) Current() FocusLayer
Current returns the current focus layer (top of stack)
func (*FocusStack) Depth ¶
func (f *FocusStack) Depth() int
Depth returns the number of layers in the stack (including FocusMain)
func (*FocusStack) Has ¶
func (f *FocusStack) Has(layer FocusLayer) bool
Has returns true if the given layer is anywhere in the stack
func (*FocusStack) Pop ¶
func (f *FocusStack) Pop() FocusLayer
Pop removes and returns the top focus layer. Returns FocusMain if only the base layer remains (never pops below FocusMain).
func (*FocusStack) Push ¶
func (f *FocusStack) Push(layer FocusLayer)
Push adds a new focus layer to the top of the stack. Does nothing if the layer is already at the top (prevents duplicate pushes).
func (*FocusStack) Remove ¶
func (f *FocusStack) Remove(layer FocusLayer)
Remove removes a specific layer from anywhere in the stack. This is useful when a modal is hidden by some external event.
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header renders the top header bar
func (*Header) SetOperation ¶
func (h *Header) SetOperation(op OperationType)
SetOperation sets the current operation type
func (*Header) SetPreviewSummary ¶
func (h *Header) SetPreviewSummary(summary PreviewSummary, state PreviewState)
SetPreviewSummary is a compatibility method that converts PreviewSummary to ResourceSummary
func (*Header) SetSpinner ¶
SetSpinner updates the spinner model
func (*Header) SetSummary ¶
func (h *Header) SetSummary(summary ResourceSummary, state HeaderState)
SetSummary updates the resource summary in the header
func (*Header) SetViewMode ¶
SetViewMode sets the current view mode
type HeaderData ¶
HeaderData contains the data displayed in the header
type HeaderState ¶
type HeaderState int
HeaderState represents the current state of the header
const ( HeaderLoading HeaderState = iota HeaderRunning HeaderDone HeaderError )
type HelpDialog ¶
type HelpDialog struct {
// contains filtered or unexported fields
}
HelpDialog renders a help overlay
func (*HelpDialog) GotoBottom ¶
func (h *HelpDialog) GotoBottom()
GotoBottom scrolls to the bottom of the help content
func (*HelpDialog) GotoTop ¶
func (h *HelpDialog) GotoTop()
GotoTop scrolls to the top of the help content
func (*HelpDialog) SetSize ¶
func (h *HelpDialog) SetSize(width, height int)
SetSize sets the dialog dimensions for centering
func (*HelpDialog) Update ¶
func (h *HelpDialog) Update(msg tea.KeyMsg)
Update handles key events for scrolling
func (*HelpDialog) View ¶
func (h *HelpDialog) View() string
View renders the help dialog centered on screen
type HistoryDetailPanel ¶
type HistoryDetailPanel struct {
PanelBase // Embed common panel functionality
// contains filtered or unexported fields
}
HistoryDetailPanel is a floating panel showing history update details
func NewHistoryDetailPanel ¶
func NewHistoryDetailPanel() *HistoryDetailPanel
NewHistoryDetailPanel creates a new history detail panel component
func (*HistoryDetailPanel) SetItem ¶
func (d *HistoryDetailPanel) SetItem(item *HistoryItem)
SetItem sets the history item to display details for
func (*HistoryDetailPanel) View ¶
func (d *HistoryDetailPanel) View() string
View renders the history detail panel
type HistoryItem ¶
type HistoryItem struct {
Version int
Kind string // "update", "preview", "refresh", "destroy"
StartTime string
EndTime string
Message string
Result string // "succeeded", "failed", "in-progress"
ResourceChanges map[string]int // e.g., {"create": 2, "update": 1}
User string // git.author who ran the update
UserEmail string // git.author.email
}
HistoryItem represents a single update in the history list
type HistoryList ¶
type HistoryList struct {
ListBase // Embed common list functionality for loading/error state
// contains filtered or unexported fields
}
HistoryList is a scrollable list of stack history updates
func NewHistoryList ¶
func NewHistoryList() *HistoryList
NewHistoryList creates a new HistoryList component
func (*HistoryList) AtBottom ¶
func (h *HistoryList) AtBottom() bool
AtBottom returns true if scrolled to bottom
func (*HistoryList) AtTop ¶
func (h *HistoryList) AtTop() bool
AtTop returns true if scrolled to top
func (*HistoryList) FilterActive ¶ added in v0.6.0
func (h *HistoryList) FilterActive() bool
FilterActive returns whether the filter is currently active (typing) or applied (has text)
func (*HistoryList) FilterInputActive ¶ added in v0.6.0
func (h *HistoryList) FilterInputActive() bool
FilterInputActive returns true if the filter is actively receiving input (user is typing)
func (*HistoryList) SelectedItem ¶
func (h *HistoryList) SelectedItem() *HistoryItem
SelectedItem returns the currently selected item, or nil if none
func (*HistoryList) SetItems ¶
func (h *HistoryList) SetItems(items []HistoryItem)
SetItems replaces all items
func (*HistoryList) SetSize ¶
func (h *HistoryList) SetSize(width, height int)
SetSize sets the dimensions for the list and ensures cursor is visible
func (*HistoryList) TotalItems ¶
func (h *HistoryList) TotalItems() int
TotalItems returns the total number of items
type ImportModal ¶
type ImportModal struct {
ModalBase // Embedded modal base for common functionality
// contains filtered or unexported fields
}
ImportModal is a modal dialog for importing a resource
func (*ImportModal) GetImportID ¶
func (m *ImportModal) GetImportID() string
GetImportID returns the entered import ID
func (*ImportModal) GetParentURN ¶
func (m *ImportModal) GetParentURN() string
GetParentURN returns the parent URN for the resource being imported
func (*ImportModal) GetResourceName ¶
func (m *ImportModal) GetResourceName() string
GetResourceName returns the name of the resource being imported
func (*ImportModal) GetResourceType ¶
func (m *ImportModal) GetResourceType() string
GetResourceType returns the type of the resource being imported
func (*ImportModal) GetResourceURN ¶
func (m *ImportModal) GetResourceURN() string
GetResourceURN returns the URN of the resource being imported
func (*ImportModal) SetError ¶
func (m *ImportModal) SetError(err error)
SetError sets an error to display
func (*ImportModal) SetLoadingSuggestions ¶
func (m *ImportModal) SetLoadingSuggestions(loading bool)
SetLoadingSuggestions sets the loading state
func (*ImportModal) SetSuggestions ¶
func (m *ImportModal) SetSuggestions(suggestions []ImportSuggestion)
SetSuggestions sets the import suggestions from plugins
func (*ImportModal) Show ¶
func (m *ImportModal) Show(resourceType, resourceName, resourceURN, parentURN string)
Show shows the import modal for the given resource
type ImportSuggestion ¶
ImportSuggestion represents a single import suggestion from a plugin
type ItemStatus ¶
type ItemStatus int
ItemStatus represents execution progress
const ( StatusNone ItemStatus = iota // Preview/stack view (not executing) StatusPending // Queued for execution StatusRunning // Currently executing StatusSuccess // Completed successfully StatusFailed // Failed )
type KeyMap ¶
type KeyMap struct {
// Navigation
Up key.Binding
Down key.Binding
PageUp key.Binding
PageDown key.Binding
Home key.Binding
End key.Binding
// Selection flags (uppercase)
ToggleTarget key.Binding
ToggleReplace key.Binding
ToggleExclude key.Binding
ClearFlags key.Binding
ClearAllFlags key.Binding
// Visual mode
VisualMode key.Binding
ToggleSelect key.Binding
Escape key.Binding
// Operations - Preview (lowercase)
PreviewUp key.Binding
PreviewRefresh key.Binding
PreviewDestroy key.Binding
// Operations - Execute (ctrl+key)
ExecuteUp key.Binding
ExecuteRefresh key.Binding
ExecuteDestroy key.Binding
// Copy resource
CopyResource key.Binding
CopyAllResources key.Binding
// Details panel
ToggleDetails key.Binding
// Stack selector
SelectStack key.Binding
// Workspace selector
SelectWorkspace key.Binding
// History view
ViewHistory key.Binding
// Import
Import key.Binding
// Delete from state
DeleteFromState key.Binding
// Toggle protection
ToggleProtect key.Binding
// Open resource
OpenResource key.Binding
// Filter
Filter key.Binding
// General
Help key.Binding
Quit key.Binding
}
KeyMap defines all application keybindings
type ListBase ¶
type ListBase struct {
// contains filtered or unexported fields
}
ListBase provides common list functionality for list components. Note: This is a partial base - lists have complex state that varies significantly. Use this for common loading/error state management.
func (*ListBase) InitSpinner ¶
func (l *ListBase) InitSpinner()
InitSpinner initializes the spinner with default settings
func (*ListBase) RenderLoadingState ¶
RenderLoadingState renders the loading spinner if loading, error if error, or empty string. Returns (rendered string, handled bool). If handled is true, use the rendered string. If handled is false, render items normally.
func (*ListBase) SetLoading ¶
SetLoading sets the loading state with an optional message
func (*ListBase) SetSpinner ¶
SetSpinner updates the spinner model
type ModalBase ¶
type ModalBase struct {
// contains filtered or unexported fields
}
ModalBase provides common functionality for modal dialogs
func (*ModalBase) CenterDialog ¶
CenterDialog centers the given dialog content on screen
func (*ModalBase) RenderDialog ¶
RenderDialog creates a dialog with title, content, and footer, then centers it
func (*ModalBase) RenderDialogWithStyle ¶
RenderDialogWithStyle creates a dialog with custom style, then centers it
func (*ModalBase) RenderScrollableDialog ¶
func (m *ModalBase) RenderScrollableDialog(params ScrollableDialogContent) ScrollableDialogResult
RenderScrollableDialog renders a dialog with scrollable content
func (*ModalBase) ResetScroll ¶
func (m *ModalBase) ResetScroll()
ResetScroll resets the scroll offset to 0
func (*ModalBase) ScrollDown ¶
ScrollDown scrolls the content down by the given number of lines
func (*ModalBase) ScrollOffset ¶
ScrollOffset returns the current scroll offset
func (*ModalBase) SetScrollOffset ¶
SetScrollOffset sets the scroll offset directly
type OperationType ¶
type OperationType = pulumi.OperationType
OperationType represents an operation type (up, refresh, destroy)
type PanelBase ¶
type PanelBase struct {
// contains filtered or unexported fields
}
PanelBase provides common panel functionality for detail panels. Embed this in panel types to get standard visibility, scroll, and size management.
func (*PanelBase) ResetScroll ¶
func (p *PanelBase) ResetScroll()
ResetScroll resets the scroll offset to 0
func (*PanelBase) ScrollDown ¶
ScrollDown scrolls the content down by the given number of lines
func (*PanelBase) ScrollOffset ¶
ScrollOffset returns the current scroll offset
func (*PanelBase) SetScrollOffset ¶
SetScrollOffset sets the scroll offset directly
func (*PanelBase) Toggle ¶
func (p *PanelBase) Toggle()
Toggle toggles the panel visibility and resets scroll offset
type PreviewState ¶
type PreviewState int
PreviewState represents the current state of the preview (for backwards compatibility)
const ( PreviewLoading PreviewState = iota PreviewRunning PreviewDone PreviewError )
type PreviewSummary ¶
PreviewSummary contains counts of each operation type (for backwards compatibility)
type ResourceChangesFormat ¶
type ResourceChangesFormat int
ResourceChangesFormat specifies the output format for RenderResourceChanges
const ( // ResourceChangesCompact renders as: +2 ~1 ±1 -0 ResourceChangesCompact ResourceChangesFormat = iota // ResourceChangesExpanded renders as: + 2 created, ~ 1 updated, etc. ResourceChangesExpanded )
type ResourceFlags ¶
type ResourceFlags struct {
Target bool // --target flag for update
Replace bool // --replace flag for update
Exclude bool // exclude from update (mutually exclusive with Target/Replace)
}
ResourceFlags tracks selection flags for a resource
type ResourceItem ¶
type ResourceItem struct {
URN string
Type string
Name string
Op ResourceOp // OpSame for stack view, actual op for preview/exec
Status ItemStatus // Execution progress
Parent string // Parent URN for component hierarchy
Sequence int // Event sequence number from Pulumi engine (for ordering)
Depth int // Nesting depth (0 = root)
IsLast bool // True if this is the last child of its parent
CurrentOp ResourceOp // Current step being executed (for replace: create-replacement or delete-replaced)
Protected bool // Whether the resource is protected from deletion
Inputs map[string]any // Resource inputs/args from stack state
Outputs map[string]any // Resource outputs from stack state
OldInputs map[string]any // Previous inputs (for updates/deletes)
OldOutputs map[string]any // Previous outputs (for updates/deletes)
Provider string // Provider reference string (URN::ID format)
ProviderInputs map[string]any // Provider's configuration inputs
}
ResourceItem is the generic representation of a resource
type ResourceJSON ¶
type ResourceJSON struct {
URN string `json:"urn"`
Type string `json:"type"`
Inputs map[string]any `json:"inputs,omitempty"`
Outputs map[string]any `json:"outputs,omitempty"`
}
ResourceJSON is the JSON structure for copying a resource Matches Pulumi's native output format as closely as possible
type ResourceList ¶
type ResourceList struct {
ListBase // Embed common list functionality for loading/error state
// contains filtered or unexported fields
}
ResourceList is the reusable scrollable list component
func NewResourceList ¶
func NewResourceList(flags map[string]ResourceFlags) *ResourceList
NewResourceList creates a new ResourceList component
func (*ResourceList) AddItem ¶
func (r *ResourceList) AddItem(item ResourceItem)
AddItem adds a single item (for streaming) If an item with the same URN exists, it updates the existing item
func (*ResourceList) AtBottom ¶
func (r *ResourceList) AtBottom() bool
AtBottom returns true if scrolled to bottom
func (*ResourceList) AtTop ¶
func (r *ResourceList) AtTop() bool
AtTop returns true if scrolled to top
func (*ResourceList) ClearAllFlags ¶
func (r *ResourceList) ClearAllFlags()
ClearAllFlags clears all flags
func (*ResourceList) ClearDiscreteSelections ¶ added in v0.8.0
func (r *ResourceList) ClearDiscreteSelections()
ClearDiscreteSelections clears all discrete selections
func (*ResourceList) ClearFlash ¶
func (r *ResourceList) ClearFlash()
ClearFlash clears the flash highlight
func (*ResourceList) CopyAllResourcesJSON ¶
func (r *ResourceList) CopyAllResourcesJSON() tea.Cmd
CopyAllResourcesJSON copies all visible resources as JSON array to the clipboard
func (*ResourceList) CopyResourceJSON ¶
func (r *ResourceList) CopyResourceJSON() tea.Cmd
CopyResourceJSON copies the selected resource as JSON to the clipboard
func (*ResourceList) FilterActive ¶ added in v0.6.0
func (r *ResourceList) FilterActive() bool
FilterActive returns whether the filter is currently active (typing) or applied (has text)
func (*ResourceList) FilterInputActive ¶ added in v0.6.0
func (r *ResourceList) FilterInputActive() bool
FilterInputActive returns true if the filter is actively receiving input (user is typing)
func (*ResourceList) FilterText ¶ added in v0.6.0
func (r *ResourceList) FilterText() string
FilterText returns the current filter text
func (*ResourceList) GetExcludeURNs ¶
func (r *ResourceList) GetExcludeURNs() []string
GetExcludeURNs returns URNs flagged for exclusion
func (*ResourceList) GetReplaceURNs ¶
func (r *ResourceList) GetReplaceURNs() []string
GetReplaceURNs returns URNs flagged for --replace
func (*ResourceList) GetSelectedResourcesForStateDelete ¶ added in v0.8.0
func (r *ResourceList) GetSelectedResourcesForStateDelete() []SelectedResource
GetSelectedResourcesForStateDelete returns selected resources that can be deleted from state. It excludes the root stack resource (pulumi:pulumi:Stack) as it cannot be deleted. Returns the union of discrete selections and visual range, or just the cursor item if neither is active.
func (*ResourceList) GetTargetURNs ¶
func (r *ResourceList) GetTargetURNs() []string
GetTargetURNs returns URNs flagged for --target
func (*ResourceList) HasDiscreteSelections ¶ added in v0.8.0
func (r *ResourceList) HasDiscreteSelections() bool
HasDiscreteSelections returns true if any items are discretely selected
func (*ResourceList) HasFlags ¶
func (r *ResourceList) HasFlags() bool
HasFlags returns true if any resources have flags set
func (*ResourceList) IsDiscretelySelected ¶ added in v0.8.0
func (r *ResourceList) IsDiscretelySelected(urn string) bool
IsDiscretelySelected returns true if an item is discretely selected (via space key)
func (*ResourceList) ScrollPercent ¶
func (r *ResourceList) ScrollPercent() float64
ScrollPercent returns the current scroll percentage (0-100)
func (*ResourceList) SelectedItem ¶
func (r *ResourceList) SelectedItem() *ResourceItem
SelectedItem returns a pointer to the currently selected item, or nil if none
func (*ResourceList) SetItems ¶
func (r *ResourceList) SetItems(items []ResourceItem)
SetItems replaces all items
func (*ResourceList) SetShowAllOps ¶
func (r *ResourceList) SetShowAllOps(show bool)
SetShowAllOps sets whether to show all ops or filter out OpSame
func (*ResourceList) SetSize ¶
func (r *ResourceList) SetSize(width, height int)
SetSize sets the dimensions for the list and ensures cursor is visible
func (*ResourceList) Summary ¶
func (r *ResourceList) Summary() ResourceSummary
Summary returns the current summary
func (*ResourceList) TotalLines ¶
func (r *ResourceList) TotalLines() int
TotalLines returns the total number of visible lines
func (*ResourceList) Update ¶
func (r *ResourceList) Update(msg tea.Msg) tea.Cmd
Update handles key events and returns any commands
func (*ResourceList) UpdateItemStatus ¶
func (r *ResourceList) UpdateItemStatus(urn string, status ItemStatus)
UpdateItemStatus updates the status of an item by URN
func (*ResourceList) View ¶
func (r *ResourceList) View() string
View renders the resource list component
func (*ResourceList) VisibleCount ¶
func (r *ResourceList) VisibleCount() int
VisibleCount returns the number of visible resources
func (*ResourceList) VisibleLines ¶
func (r *ResourceList) VisibleLines() int
VisibleLines returns the number of lines that fit on screen
func (*ResourceList) VisualMode ¶
func (r *ResourceList) VisualMode() bool
VisualMode returns whether visual selection mode is active
type ResourceOp ¶
type ResourceOp = pulumi.ResourceOp
ResourceOp represents a resource operation type (create, update, delete, etc.)
type ResourceSummary ¶
type ResourceSummary struct {
Total int
Same int // Only counted when showAllOps=true
Create int
Update int
Delete int
Replace int
Refresh int
}
ResourceSummary contains counts of each operation type
type ScrollIndicatorConfig ¶
type ScrollIndicatorConfig struct {
Padding string // Padding before the arrow (default: " ")
IncludeMore bool // Whether to include "more" text after the arrow
TrailingSpace bool // Whether to reserve space when indicator is not shown (prevents layout jumps)
}
ScrollIndicatorConfig configures the scroll indicator rendering
func DefaultScrollConfig ¶
func DefaultScrollConfig() ScrollIndicatorConfig
DefaultScrollConfig returns the default scroll indicator configuration
type ScrollableDialogContent ¶
type ScrollableDialogContent struct {
Title string
Content string
MaxHeight int // Maximum content height before scrolling kicks in
ScrollOffset int // Current scroll position
DialogWidth int // Width of the dialog
}
ScrollableDialogContent holds parameters for rendering scrollable dialog content
type ScrollableDialogResult ¶
type ScrollableDialogResult struct {
Rendered string // The fully rendered dialog
NewScrollOffset int // Adjusted scroll offset (clamped to valid range)
TotalLines int // Total content lines
VisibleLines int // Number of visible lines
CanScroll bool // Whether scrolling is available
}
ScrollableDialogResult holds the result of rendering scrollable content
type SelectedResource ¶ added in v0.8.0
SelectedResource represents a selected resource with its URN and name
type SelectorDialog ¶
type SelectorDialog[T SelectorItem] struct { // contains filtered or unexported fields }
SelectorDialog is a generic modal dialog for selecting an item from a list
func NewSelectorDialog ¶
func NewSelectorDialog[T SelectorItem](title string) *SelectorDialog[T]
NewSelectorDialog creates a new selector dialog with the given title
func (*SelectorDialog[T]) HasItems ¶
func (s *SelectorDialog[T]) HasItems() bool
HasItems returns whether any items are available
func (*SelectorDialog[T]) SelectedItem ¶
func (s *SelectorDialog[T]) SelectedItem() *T
SelectedItem returns the currently selected item, or nil if none
func (*SelectorDialog[T]) SetEmptyText ¶
func (s *SelectorDialog[T]) SetEmptyText(text string)
SetEmptyText sets the text shown when no items are available
func (*SelectorDialog[T]) SetError ¶
func (s *SelectorDialog[T]) SetError(err error)
SetError sets an error state
func (*SelectorDialog[T]) SetExtraInfoRenderer ¶
func (s *SelectorDialog[T]) SetExtraInfoRenderer(fn func(item T) string)
SetExtraInfoRenderer sets a function to render extra info after the item label
func (*SelectorDialog[T]) SetItemRenderer ¶
func (s *SelectorDialog[T]) SetItemRenderer(fn func(item T, isCursor bool) string)
SetItemRenderer sets a custom item renderer function
func (*SelectorDialog[T]) SetItems ¶
func (s *SelectorDialog[T]) SetItems(items []T)
SetItems sets the list of available items and positions cursor on current item
func (*SelectorDialog[T]) SetLoading ¶
func (s *SelectorDialog[T]) SetLoading(loading bool)
SetLoading sets the loading state
func (*SelectorDialog[T]) SetLoadingText ¶
func (s *SelectorDialog[T]) SetLoadingText(text string)
SetLoadingText sets the text shown while loading
func (*SelectorDialog[T]) SetMaxVisible ¶
func (s *SelectorDialog[T]) SetMaxVisible(maxItems int)
SetMaxVisible sets the maximum number of visible items before scrolling
func (*SelectorDialog[T]) SetSize ¶
func (s *SelectorDialog[T]) SetSize(width, height int)
SetSize sets the dialog dimensions for centering
func (*SelectorDialog[T]) SetTitle ¶
func (s *SelectorDialog[T]) SetTitle(title string)
SetTitle sets the dialog title
func (*SelectorDialog[T]) Update ¶
Update handles key events and returns true if an item was selected
func (*SelectorDialog[T]) View ¶
func (s *SelectorDialog[T]) View() string
View renders the selector dialog
func (*SelectorDialog[T]) Visible ¶
func (s *SelectorDialog[T]) Visible() bool
Visible returns whether the selector is visible
type SelectorItem ¶
type SelectorItem interface {
// Label returns the display text for the item
Label() string
// IsCurrent returns true if this is the currently selected/active item
IsCurrent() bool
}
SelectorItem is an interface for items that can be displayed in a SelectorDialog
type StackInitModal ¶
type StackInitModal struct {
*StepModal
// contains filtered or unexported fields
}
StackInitModal wraps StepModal with stack initialization-specific logic
func NewStackInitModal ¶
func NewStackInitModal() *StackInitModal
NewStackInitModal creates a new stack init modal
func (*StackInitModal) GetPassphrase ¶
func (m *StackInitModal) GetPassphrase() string
GetPassphrase returns the entered passphrase
func (*StackInitModal) GetSecretsProvider ¶
func (m *StackInitModal) GetSecretsProvider() string
GetSecretsProvider returns the selected/entered secrets provider
func (*StackInitModal) GetStackName ¶
func (m *StackInitModal) GetStackName() string
GetStackName returns the selected/entered stack name
func (*StackInitModal) IsComplete ¶
func (m *StackInitModal) IsComplete() bool
IsComplete returns true if all required steps have been completed
func (*StackInitModal) NeedsPassphrase ¶
func (m *StackInitModal) NeedsPassphrase() bool
NeedsPassphrase returns true if the passphrase step should be shown
func (*StackInitModal) SetAuthEnv ¶
func (m *StackInitModal) SetAuthEnv(env map[string]string)
SetAuthEnv sets the auth environment from plugins
func (*StackInitModal) SetBackendInfo ¶
func (m *StackInitModal) SetBackendInfo(user, url string)
SetBackendInfo sets the backend connection information
func (*StackInitModal) SetStackFiles ¶
func (m *StackInitModal) SetStackFiles(files []pulumi.StackFileInfo)
SetStackFiles sets the available stack files
func (*StackInitModal) ShouldSkipPassphrase ¶
func (m *StackInitModal) ShouldSkipPassphrase() bool
ShouldSkipPassphrase returns true if we should skip the passphrase step
func (*StackInitModal) Update ¶
func (m *StackInitModal) Update(msg tea.KeyMsg) (StepModalAction, tea.Cmd)
Update handles key events and manages step transitions
type StackItem ¶
type StackItem struct {
Name string
Current bool
IsNewItem bool // Special flag for "create new stack" option
Source StackSource // Where the stack information comes from
}
StackItem represents a stack in the selector
type StackSelector ¶
type StackSelector struct {
*SelectorDialog[StackItem]
// contains filtered or unexported fields
}
StackSelector is a modal dialog for selecting a stack
func NewStackSelector ¶
func NewStackSelector() *StackSelector
NewStackSelector creates a new stack selector
func (*StackSelector) HasStacks ¶
func (s *StackSelector) HasStacks() bool
HasStacks returns whether any stacks are available
func (*StackSelector) IsNewStackSelected ¶
func (s *StackSelector) IsNewStackSelected() bool
IsNewStackSelected returns true if the "new stack" option is selected
func (*StackSelector) SelectedStack ¶
func (s *StackSelector) SelectedStack() string
SelectedStack returns the currently selected stack name Returns empty string if "new stack" option is selected
func (*StackSelector) SetShowNewOption ¶
func (s *StackSelector) SetShowNewOption(show bool)
SetShowNewOption controls whether the "new stack" option is shown
func (*StackSelector) SetStacks ¶
func (s *StackSelector) SetStacks(stacks []StackItem)
SetStacks sets the list of available stacks
func (*StackSelector) View ¶
func (s *StackSelector) View() string
View renders the stack selector dialog
type StackSource ¶ added in v0.5.1
type StackSource int
StackSource indicates where the stack information comes from
const ( StackSourceBackend StackSource = iota // Stack exists in the backend StackSourceFile // Stack has a config file but may not exist in backend )
type StepModal ¶
type StepModal struct {
ModalBase
// contains filtered or unexported fields
}
StepModal is a multi-step modal dialog with navigation support
func NewStepModal ¶
NewStepModal creates a new step modal
func (*StepModal) ClearError ¶
func (m *StepModal) ClearError()
ClearError clears any displayed error
func (*StepModal) CurrentStep ¶
CurrentStep returns the current step index
func (*StepModal) IsLastStep ¶
IsLastStep returns true if on the final step
func (*StepModal) SetResult ¶
SetResult sets a result for a specific step (useful for pre-populating)
func (*StepModal) SetStepInfoLines ¶
SetStepInfoLines sets info lines for a specific step
func (*StepModal) SetStepSuggestions ¶
func (m *StepModal) SetStepSuggestions(step int, suggestions []StepSuggestion)
SetStepSuggestions sets suggestions for a specific step
func (*StepModal) SetStepWarning ¶
SetStepWarning sets a warning for a specific step
func (*StepModal) SetSteps ¶
func (m *StepModal) SetSteps(steps []StepModalStep)
SetSteps configures the modal steps
type StepModalAction ¶
type StepModalAction int
StepModalAction represents an action taken by the user in a step modal
const ( StepModalActionNone StepModalAction = iota StepModalActionNext // Move to next step StepModalActionPrev // Move to previous step StepModalActionConfirm // Confirm final step StepModalActionCancel // Cancel the modal )
type StepModalStep ¶
type StepModalStep struct {
Title string
InfoLines []InfoLine // Read-only info display at top
Suggestions []StepSuggestion // Selectable list items
InputLabel string // Label for text input
InputPlaceholder string
Warning string // Warning message (shown in yellow)
PasswordMode bool // Mask input like a password
}
StepModalStep defines the configuration for a single step in the modal
type StepSuggestion ¶
type StepSuggestion struct {
ID string
Label string
Description string
Source string // e.g., plugin name or "from Pulumi.dev.yaml"
Warning string // Per-item warning (e.g., "has existing encryption")
}
StepSuggestion represents a selectable suggestion item
type Toast ¶
type Toast struct {
// contains filtered or unexported fields
}
Toast is a temporary notification message
type WorkspaceItem ¶
type WorkspaceItem struct {
Path string
RelativePath string // Path relative to current working directory
Name string
Current bool
}
WorkspaceItem represents a workspace in the selector
func (WorkspaceItem) IsCurrent ¶
func (w WorkspaceItem) IsCurrent() bool
IsCurrent implements SelectorItem
type WorkspaceSelector ¶
type WorkspaceSelector struct {
*SelectorDialog[WorkspaceItem]
}
WorkspaceSelector is a modal dialog for selecting a workspace
func NewWorkspaceSelector ¶
func NewWorkspaceSelector() *WorkspaceSelector
NewWorkspaceSelector creates a new workspace selector
func (*WorkspaceSelector) HasWorkspaces ¶
func (s *WorkspaceSelector) HasWorkspaces() bool
HasWorkspaces returns whether any workspaces are available
func (*WorkspaceSelector) SelectedWorkspace ¶
func (s *WorkspaceSelector) SelectedWorkspace() *WorkspaceItem
SelectedWorkspace returns the currently selected workspace
func (*WorkspaceSelector) SetWorkspaces ¶
func (s *WorkspaceSelector) SetWorkspaces(workspaces []WorkspaceItem)
SetWorkspaces sets the list of available workspaces
func (*WorkspaceSelector) Update ¶
Update handles key events and returns true if a workspace was selected
func (*WorkspaceSelector) View ¶
func (s *WorkspaceSelector) View() string
View renders the workspace selector dialog
Source Files
¶
- base.go
- clipboard.go
- confirmmodal.go
- details.go
- diff.go
- errormodal.go
- filter.go
- focus.go
- format.go
- header.go
- help.go
- helpers.go
- historydetails.go
- historylist.go
- importmodal.go
- keys.go
- modal.go
- resourcecopy.go
- resourceflags.go
- resourcelist.go
- resourcerender.go
- resourcetree.go
- selector.go
- stackinitmodal.go
- stackselector.go
- stepmodal.go
- styles.go
- toast.go
- types.go
- workspaceselector.go