Skip to content

feat: add TreeView SetAlign, SetTopLevel, SetGraphics, SetPrefixes config #14

@cassdeckard

Description

@cassdeckard

Summary

Add YAML configuration for TreeView's layout modes: SetAlign, SetTopLevel, SetGraphics, and SetPrefixes. These control how the tree is displayed (aligned, hidden root, line graphics, custom prefixes per level).

Background

Discovered while planning a tview presentation demo implementation via tviewyaml. The TreeView slide toggles between basic graphics, topLevel=1 (hide root), align mode, and custom prefixes.

Demo Usage

Layout modes not in TreeNode or primitive config.

Proposed Approach

  • Add align: true/false, topLevel: 0|1|..., graphics: true/false, prefixes: ["prefix1", "prefix2", ...] to TreeView primitive config
  • In populateTreeView, call SetAlign, SetTopLevel, SetGraphics, SetPrefixes when configured
  • Prefixes support color tags (e.g. "[red]* ")

Relevant Files

  • config/types.go – add TreeView layout fields to Primitive or PageConfig
  • builder/builder.gopopulateTreeView, buildTreeView
  • docs/tview-coverage.md – document once implemented

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions