tui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func New

func New(cfg config.Config) *App

func (*App) Init

func (a *App) Init() tea.Cmd

func (*App) Update

func (a *App) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*App) View

func (a *App) View() string

type DiffNode

type DiffNode struct {
	Name     string
	IsDir    bool
	Children []*DiffNode
	File     *FileDiff // nil for directories
	Expanded bool      // for directories
}

DiffNode represents a node in the file tree (can be directory or file)

type DiffTree

type DiffTree struct {
	Files    []FileDiff
	Tree     *DiffNode
	FileList []string // flattened list of file paths for navigation
}

DiffTree represents the hierarchical structure of changed files

func ParseDiff

func ParseDiff(raw string) *DiffTree

ParseDiff parses raw diff content and extracts file diffs

func (*DiffTree) GetFileByIndex

func (dt *DiffTree) GetFileByIndex(idx int) *FileDiff

GetFileByIndex returns the file at the given index in the flattened list

func (*DiffTree) GetFileContent

func (dt *DiffTree) GetFileContent(path string) string

GetFileContent returns the diff content for a specific file path

type FileDiff

type FileDiff struct {
	Path     string // file path (e.g., "internal/tui/app.go")
	OldPath  string // original path for renames
	NewPath  string // new path for renames
	Content  string // raw diff content for this file
	AddLines int    // number of added lines
	DelLines int    // number of deleted lines
	IsBinary bool   // whether this is a binary file
	IsNew    bool   // whether this is a new file
	IsDelete bool   // whether this file was deleted
}

FileDiff represents a single file's diff content

Jump to

Keyboard shortcuts

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