{"modulePath":"github.com/newstack-cloud/deploy-cli-sdk","version":"v0.10.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package splitpane\n\n## Constants\n\n```go\nconst StatusFilterPrefix = \"status:\"\n```\nStatusFilterPrefix qualifies a filter word as a status rather than a name, as in \"status:failed\".\n\n## Types\n\n```go\ntype BackMsg struct{}\n```\nBackMsg is sent when navigating back (Esc at root level)\n\n```go\ntype CollapsedSummariser interface {\n\t// GetCollapsedSummary describes the hidden children, e.g. \"2 resources, 1 link\".\n\t// An empty string renders nothing.\n\tGetCollapsedSummary() string\n}\n```\nCollapsedSummariser is an optional interface for items whose children are hidden while collapsed. The summary is shown next to the item's name so that what is folded away is still visible when scanning the list.\n\n```go\ntype Config struct {\n\t// Required\n\tStyles          *styles.Styles\n\tDetailsRenderer DetailsRenderer\n\n\t// Optional: title shown in the left pane header (default: none)\n\tTitle string\n\n\t// Optional with defaults\n\tLeftPaneRatio  float64        // Default: 0.4\n\tMaxExpandDepth int            // Default: 2\n\tSectionGrouper SectionGrouper // Default: no sections\n\tHeaderRenderer HeaderRenderer // Default: standard header with title and breadcrumb\n\tFooterRenderer FooterRenderer // Default: standard keyboard hints\n\n\t// StatusKeywords reports the words a \"status:\" filter can match an item by,\n\t// usually derived from the status it is already showing. Leave nil to filter\n\t// by name only; a status filter then matches nothing rather than everything.\n\tStatusKeywords func(Item) []string\n\n\t// StatusFilterHints are the status words offered while a filter is being\n\t// typed. The pane does not know what statuses mean, so the vocabulary comes\n\t// from whoever supplied StatusKeywords. Ordered most useful first, since\n\t// only as many as fit the pane are shown.\n\tStatusFilterHints []string\n\n\t// Section names (if using default grouper)\n\t// e.g., {\"resource\": \"Resources\"}\n\tSectionNames map[string]string\n}\n```\nConfig configures the split-pane model.\n\n```go\ntype DetailsRenderer interface {\n\tRenderDetails(item Item, width int, styles *styles.Styles) string\n}\n```\nDetailsRenderer renders the right pane content for a selected item. Consumers implement this for domain-specific detail views.\n\n```go\ntype DrillDownMsg struct {\n\tItem Item\n}\n```\nDrillDownMsg is sent when drilling into an item\n\n```go\ntype FooterRenderer interface {\n\tRenderFooter(model *Model, styles *styles.Styles) string\n}\n```\nFooterRenderer renders custom footer content. Optional - if nil, uses default keyboard hints footer.\n\n```go\ntype HeaderRenderer interface {\n\tRenderHeader(model *Model, styles *styles.Styles) string\n}\n```\nHeaderRenderer customizes the left pane header. Optional - if nil, uses default header with title and breadcrumb.\n\n```go\ntype Item interface {\n\t// GetID provides a unique identifier that is primarily\n\t// used for expansion tracking in the split pane\n\tGetID() string\n\t// GetName provides a human-readable name for the item\n\tGetName() string\n\t// GetIcon provides a status icon (styled when not selected)\n\tGetIcon(selected bool) string\n\t// GetAction provides action badge text (e.g \"CREATE\", \"UPDATE\", etc.)\n\tGetAction() string\n\t// GetDepth provides the nesting depth for indentation\n\tGetDepth() int\n\t// GetParentID returns the parent item ID (empty for top-level items)\n\tGetParentID() string\n\t// GetItemType returns the type for section grouping (e.g., \"resource\", \"child\")\n\tGetItemType() string\n\t// IsExpandable indicates whether the item can be expanded in-place\n\tIsExpandable() bool\n\t// CanDrillDown indicates whether the item can be drilled into for detailed view\n\tCanDrillDown() bool\n\t// GetChildren provides a list of child items\n\t// displayed when the current item is expanded\n\tGetChildren() []Item\n}\n```\nItem represents a selectable item in the left pane. Consumers implement this interface for their domain-specific items.\n\n```go\ntype ItemExpandedMsg struct {\n\tItem     Item\n\tExpanded bool\n}\n```\nItemExpandedMsg is sent when an item is expanded/collapsed\n\n```go\ntype ItemSelectedMsg struct {\n\tItem Item\n}\n```\nItemSelectedMsg is sent when the selected item changes\n\n```go\ntype ItemsUpdatedMsg struct{}\n```\nItemsUpdatedMsg can be sent to trigger a viewport refresh when items have been modified externally\n\n```go\ntype Model struct {\n\t// contains filtered or unexported fields\n}\n```\nModel is a Bubble Tea model for a two-pane split view. Left pane shows a navigable list; right pane shows details.\n\n```go\nfunc New(config Config) Model\n```\nNew creates a new split-pane model with the given configuration.\n\n```go\nfunc (m *Model) AddItem(item Item)\n```\nAddItem adds an item to the end of the root items list. If currently in drill-down, the item is added to root but the view refreshes appropriately.\n\n```go\nfunc (m Model) Config() Config\n```\nConfig returns the configuration.\n\n```go\nfunc (m Model) FilterTerm() string\n```\nFilterTerm returns the active search term, empty when nothing is filtered.\n\n```go\nfunc (m Model) FocusedPane() PaneType\n```\nFocusedPane returns which pane currently has focus.\n\n```go\nfunc (m Model) HasFilter() bool\n```\nHasFilter reports whether a search term is narrowing the displayed items.\n\n```go\nfunc (m Model) Height() int\n```\nHeight returns the total height.\n\n```go\nfunc (m Model) Init() tea.Cmd\n```\nInit implements tea.Model\n\n```go\nfunc (m Model) IsExpanded(id string) bool\n```\nIsExpanded returns true if the item with the given ID is expanded.\n\n```go\nfunc (m Model) IsFiltering() bool\n```\nIsFiltering reports whether the filter input is currently accepting keys. Host models check this before handling their own single-key shortcuts, so that typing a search term does not trigger them.\n\n```go\nfunc (m Model) IsInDrillDown() bool\n```\nIsInDrillDown returns true if currently viewing a drilled-down item.\n\n```go\nfunc (m Model) IsPickingStatus() bool\n```\nIsPickingStatus reports whether the status picker is open.\n\n```go\nfunc (m Model) Items() []Item\n```\nItems returns the current items at the current navigation level.\n\n```go\nfunc (m Model) LeftPaneWidth() int\n```\nLeftPaneWidth returns the left pane width.\n\n```go\nfunc (m Model) NavigationPath() []string\n```\nNavigationPath returns the breadcrumb path as a slice of names.\n\n```go\nfunc (m Model) NavigationStack() []NavigationFrame\n```\nNavigationStack returns the navigation stack for drill-down.\n\n```go\nfunc (m *Model) RefreshViewports()\n```\nRefreshViewports forces a re-render of both viewport contents. Use this when item data has changed but items themselves haven't been replaced, or when you need to ensure the displayed content is up-to-date.\n\n```go\nfunc (m *Model) RemoveItemByID(id string) bool\n```\nRemoveItemByID removes an item by ID from root items. Returns true if the item was found and removed.\n\n```go\nfunc (m Model) RightPaneWidth() int\n```\nRightPaneWidth returns the right pane width.\n\n```go\nfunc (m Model) RootItems() []Item\n```\nRootItems returns the root-level items.\n\n```go\nfunc (m *Model) Select(id string)\n```\nSelect moves the selection to the item with the given ID, expanding its parent if the item is currently hidden. The selection is left on the first visible item when the ID is not found.\n\n```go\nfunc (m Model) SelectedID() string\n```\nSelectedID returns the ID of the currently selected item.\n\n```go\nfunc (m Model) SelectedIndex() int\n```\nSelectedIndex returns the currently selected index.\n\n```go\nfunc (m Model) SelectedItem() Item\n```\nSelectedItem returns the currently selected item, or nil if none. Uses ID-based lookup to ensure the correct item is returned even after updates.\n\n```go\nfunc (m *Model) SetExpanded(id string, expanded bool)\n```\nSetExpanded expands or collapses the item with the given ID, for callers driving the pane programmatically rather than through key presses.\n\n```go\nfunc (m *Model) SetFilterTerm(term string)\n```\nSetFilterTerm applies a search term, for callers driving the pane programmatically rather than through key presses.\n\n```go\nfunc (m *Model) SetItems(items []Item)\n```\nSetItems sets the items to display, resetting all state. Use UpdateItems() instead if you want to preserve selection and expansion state.\n\n```go\nfunc (m Model) Styles() *styles.Styles\n```\nStyles returns the configured styles.\n\n```go\nfunc (m Model) Update(msg tea.Msg) (Model, tea.Cmd)\n```\nUpdate implements tea.Model\n\n```go\nfunc (m *Model) UpdateItemByID(id string, newItem Item) bool\n```\nUpdateItemByID replaces an item by ID in both root and current items. Returns true if the item was found and updated.\n\n```go\nfunc (m *Model) UpdateItems(items []Item)\n```\nUpdateItems replaces items while preserving user state where possible. - Preserves selection if the selected item still exists (by ID) - Preserves expansion state for items that still exist - Properly handles drill-down mode by refreshing children from updated parent\n\n```go\nfunc (m Model) View() string\n```\nView implements tea.Model\n\n```go\nfunc (m Model) Width() int\n```\nWidth returns the total width.\n\n```go\ntype NavigationFrame struct {\n\t// ParentID is the identifier of the item drilled into\n\tParentID string\n\t// ParentName is the display name for the breadcrumb\n\tParentName string\n\t// SelectedID is the ID of the item that was selected before drilling down\n\tSelectedID string\n\t// Items are the items at this level (snapshot for back navigation)\n\tItems []Item\n}\n```\nNavigationFrame represents a frame in the drill-down navigation stack\n\n```go\ntype PaneType int\n```\nPaneType indicates which pane is focused\n\n```go\nconst (\n\tLeftPane PaneType = iota\n\tRightPane\n)\n```\n\n```go\ntype QuitMsg struct{}\n```\nQuitMsg is sent when the user presses q/ctrl+c\n\n```go\ntype Section struct {\n\tName  string\n\tItems []Item\n}\n```\nSection groups items under a header in the left pane\n\n```go\ntype SectionGrouper interface {\n\tGroupItems(items []Item, isExpanded func(id string) bool) []Section\n}\n```\nSectionGrouper organizes items into named sections. Optional - if nil, items render without section headers.\n\n","path":"github.com/newstack-cloud/deploy-cli-sdk/ui/splitpane","name":"splitpane","synopsis":"","isRedistributable":true}
