tui

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CardHeaderStyle = lipgloss.NewStyle().
					Bold(true).
					Foreground(lipgloss.AdaptiveColor{Light: "#333333", Dark: "#FFFFFF"})

	TagStyle = lipgloss.NewStyle().
				Foreground(lipgloss.AdaptiveColor{Light: "#1A8FA8", Dark: "#4FC3F7"})

	TagDirtyStyle = lipgloss.NewStyle().
					Foreground(lipgloss.AdaptiveColor{Light: "#D4880F", Dark: "#FFAB40"})

	StatusBlockSyncedStyle   = lipgloss.NewStyle().Background(lipgloss.Color("#5FD97F")).Foreground(lipgloss.Color("#000000"))
	StatusBlockAheadStyle    = lipgloss.NewStyle().Background(lipgloss.Color("#FFD700")).Foreground(lipgloss.Color("#000000"))
	StatusBlockBehindStyle   = lipgloss.NewStyle().Background(lipgloss.Color("#FF6B6B")).Foreground(lipgloss.Color("#FFFFFF"))
	StatusBlockDivergedStyle = lipgloss.NewStyle().Background(lipgloss.Color("#CE93D8")).Foreground(lipgloss.Color("#000000"))

	HelpBarStyle = lipgloss.NewStyle().
					Background(lipgloss.AdaptiveColor{Light: "#E8E8E8", Dark: "#333333"}).
					Foreground(lipgloss.AdaptiveColor{Light: "#555555", Dark: "#AAAAAA"}).
					Padding(0, 1)

	HelpKeyStyle = lipgloss.NewStyle().
					Foreground(lipgloss.AdaptiveColor{Light: "#1A5CCC", Dark: "#6EA8FF"}).
					Bold(true)

	HelpDescStyle = lipgloss.NewStyle().
					Foreground(lipgloss.AdaptiveColor{Light: "#666666", Dark: "#999999"})

	ErrorBannerStyle = lipgloss.NewStyle().
						Background(lipgloss.AdaptiveColor{Light: "#FFEBEE", Dark: "#3D1F1F"}).
						Foreground(lipgloss.AdaptiveColor{Light: "#B83232", Dark: "#FF6B6B"}).
						Bold(true).
						Padding(0, 1)

	TreeDirStyle  = lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#1A8FA8", Dark: "#4FC3F7"}).Bold(true)
	TreeFileStyle = lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#333333", Dark: "#CCCCCC"})

	FileStatusNewStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#5FD97F"))
	FileStatusDelStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF6B6B"))
	FileStatusModStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FFD700"))
)

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 BuildDiffTree added in v0.1.18

func BuildDiffTree(files []FileDiff) *DiffTree

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