treeview

package
v1.16.2-0...-82d92f0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TreeView

type TreeView struct {
	Model       tea.Model // kept to satisfy requested shape; this instance is itself a tea.Model
	SelectedUID string
	// contains filtered or unexported fields
}

TreeView wraps a simple interactive tree for displaying ArgoCD resource trees. It intentionally keeps state minimal and integrates with Bubble Tea.

func NewTreeView

func NewTreeView(width, height int) *TreeView

NewTreeView creates a new tree view instance

func (*TreeView) ApplyTheme

func (v *TreeView) ApplyTheme(palette theme.Palette)

ApplyTheme updates the tree view's color palette

func (*TreeView) Init

func (v *TreeView) Init() tea.Cmd

Init implements tea.Model; no async startup required

func (*TreeView) Render

func (v *TreeView) Render() string

Render returns the current string representation of the tree.

func (*TreeView) SelectedIndex

func (v *TreeView) SelectedIndex() int

Expose selected index for integration (optional)

func (*TreeView) SelectedLineIndex

func (v *TreeView) SelectedLineIndex() int

SelectedLineIndex returns the index of the selected line in the rendered output, accounting for the blank separator lines inserted between app roots in View().

func (*TreeView) SetAppMeta

func (v *TreeView) SetAppMeta(name, health, sync string)

SetAppMeta sets the application metadata used for the synthetic top-level node

func (*TreeView) SetData

func (v *TreeView) SetData(tree *api.ResourceTree)

SetData converts api.ResourceTree to internal nodes and builds adjacency

func (*TreeView) SetSize

func (v *TreeView) SetSize(width, height int)

func (*TreeView) Update

func (v *TreeView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*TreeView) UpsertAppTree

func (v *TreeView) UpsertAppTree(appName string, tree *api.ResourceTree)

UpsertAppTree replaces/adds a single application's tree under a synthetic root

func (*TreeView) View

func (v *TreeView) View() tea.View

func (*TreeView) VisibleCount

func (v *TreeView) VisibleCount() int

VisibleCount returns the number of currently visible nodes in DFS order.

func (*TreeView) VisibleLineCount

func (v *TreeView) VisibleLineCount() int

VisibleLineCount returns the number of lines produced by View(), which is the number of visible nodes plus the number of blank separators (roots-1).

Jump to

Keyboard shortcuts

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