tui

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(result *compare.Result) error

Run starts the TUI program.

Types

type BinaryDiffView

type BinaryDiffView struct {
	Diff  *compare.BinaryDiff
	Width int
}

BinaryDiffView renders symbol and section changes with a summary.

func (BinaryDiffView) CopyableText

func (v BinaryDiffView) CopyableText() string

func (BinaryDiffView) Render

func (v BinaryDiffView) Render() string

type DirSummaryView

type DirSummaryView struct {
	Summary *compare.DirSummary
	Width   int
}

DirSummaryView renders aggregate statistics for a directory.

func (DirSummaryView) CopyableText

func (v DirSummaryView) CopyableText() string

func (DirSummaryView) Render

func (v DirSummaryView) Render() string

type ErrorView

type ErrorView struct {
	Node  *compare.Node
	Err   error
	Width int
}

ErrorView renders a structured error display for a failed detail load.

func (ErrorView) CopyableText

func (v ErrorView) CopyableText() string

func (ErrorView) Render

func (v ErrorView) Render() string

type GitMetaView added in v0.6.0

type GitMetaView struct {
	Git   *compare.GitMeta
	Dir   *compare.DirSummary
	Width int
}

GitMetaView renders git commit metadata for the detail pane. It renders its own header instead of using NodeHeaderView.

func (GitMetaView) CopyableText added in v0.6.0

func (v GitMetaView) CopyableText() string

func (GitMetaView) Render added in v0.6.0

func (v GitMetaView) Render() string

type ImageDiffView added in v0.5.0

type ImageDiffView struct {
	Diff   *compare.ImageDiff
	Width  int
	Height int // available viewport rows for the entire view
	Mode   ImageViewMode
}

ImageDiffView renders an image comparison with metadata and half-block thumbnails.

func (ImageDiffView) CopyableText added in v0.5.0

func (v ImageDiffView) CopyableText() string

func (ImageDiffView) Render added in v0.5.0

func (v ImageDiffView) Render() string

type ImageViewMode added in v0.5.0

type ImageViewMode int

ImageViewMode controls which image panel is displayed.

const (
	ImageViewSideBySide ImageViewMode = iota
	ImageViewBefore
	ImageViewAfter
	ImageViewDiff
)

func (ImageViewMode) String added in v0.5.0

func (m ImageViewMode) String() string

type Model

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

Model is the root TUI model.

func New

func New(result *compare.Result) Model

New creates a new TUI model from a comparison result.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() tea.View

type NodeHeaderView

type NodeHeaderView struct {
	Node  *compare.Node
	Width int
}

NodeHeaderView renders the file info header used at the top of all detail views.

func (NodeHeaderView) CopyableText

func (v NodeHeaderView) CopyableText() string

func (NodeHeaderView) Render

func (v NodeHeaderView) Render() string

type PlistDiffView

type PlistDiffView struct {
	Diff  *compare.PlistDiff
	Width int
}

PlistDiffView renders plist key-path changes.

func (PlistDiffView) CopyableText

func (v PlistDiffView) CopyableText() string

func (PlistDiffView) Render

func (v PlistDiffView) Render() string

type SummaryBarView

type SummaryBarView struct {
	Summary compare.Summary
	Width   int
}

SummaryBarView renders the aggregate diff statistics bar.

func (SummaryBarView) Render

func (v SummaryBarView) Render() string

type TextDiffView

type TextDiffView struct {
	Diff  *compare.TextDiff
	Width int
}

TextDiffView renders a text unified diff with colored lines.

func (TextDiffView) CopyableText

func (v TextDiffView) CopyableText() string

func (TextDiffView) Render

func (v TextDiffView) Render() string

type View

type View interface {
	// Render returns styled terminal output.
	Render() string
	// CopyableText returns a plain-text representation for clipboard export.
	CopyableText() string
}

View is a pure rendering component that takes props via struct fields and produces styled output. Views have no state or input handling.

Three-tier component model:

  • tea.Model: stateful components with input handling (treeModel, detailModel)
  • View: pure render components (NodeHeaderView, TextDiffView, etc.)
  • primitives: small building blocks (section, field, divider)

Jump to

Keyboard shortcuts

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