tui

package
v0.7.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyConfig

func ApplyConfig(root *TreeNode, cfg *Config)

func CountSelected

func CountSelected(root *TreeNode) (selected, total int)

func GeneratePatterns

func GeneratePatterns(root *TreeNode) (includes, excludes []string)

func RunTUI

func RunTUI(rootPath, configPath string, noConfig bool, opts BuildTreeOpts) error

func SaveConfig

func SaveConfig(path string, cfg *Config) error

func SetAllState

func SetAllState(root *TreeNode, state NodeState)

func SetInitialState

func SetInitialState(root *TreeNode, includePatterns, excludePatterns []string)

func Toggle

func Toggle(node *TreeNode)

func ToggleExpand

func ToggleExpand(node *TreeNode)

Types

type BuildTreeOpts

type BuildTreeOpts struct {
	IncludeTests    bool
	MaxDepth        int
	ExcludePatterns []string
	IncludePatterns []string
}

type Config

type Config struct {
	Include []string       `yaml:"include,omitempty"`
	Exclude []string       `yaml:"exclude,omitempty"`
	Options *ConfigOptions `yaml:"options,omitempty"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

type ConfigOptions

type ConfigOptions struct {
	IncludeTests bool   `yaml:"include-tests,omitempty"`
	MaxFileSize  string `yaml:"max-file-size,omitempty"`
	MaxDepth     int    `yaml:"max-depth,omitempty"`
}

type Model

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

func NewModel

func NewModel(rootPath, configPath string, noConfig bool, opts BuildTreeOpts) (Model, error)

func (Model) ConfigPath

func (m Model) ConfigPath() string

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Saved

func (m Model) Saved() bool

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type NodeState

type NodeState int
const (
	Unchecked NodeState = iota
	Checked
	Partial
)

type TreeNode

type TreeNode struct {
	Name     string
	Path     string // relative path from root
	IsDir    bool
	State    NodeState
	Children []*TreeNode
	Parent   *TreeNode
	Expanded bool
	Depth    int
}

func BuildTree

func BuildTree(rootPath string, opts BuildTreeOpts) (*TreeNode, error)

func FlattenVisible

func FlattenVisible(root *TreeNode) []*TreeNode

Jump to

Keyboard shortcuts

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