tui

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTUI

func RunTUI(files []FileDiff) (accepted, skipped map[string]bool, err error)

RunTUI launches the Bubble Tea TUI for file diffs.

Types

type FileDiff

type FileDiff struct {
	Path       string
	Diff       string
	Changed    bool
	KeyChanges []transform.KeyChange // Add key changes for this file
}

FileDiff represents the diff for a single file, including the path, diff content, and whether it has changed. It also holds the key changes detected in the file.

type Model

type Model struct {
	Files    []FileDiff      // All files with detected key changes
	Index    int             // Current file index
	Accepted map[string]bool // Files the user has accepted
	Skipped  map[string]bool // Files the user has skipped
	Quitting bool            // Whether the user has quit the TUI
	ShowHelp bool            // Whether to show the help/footer
	List     list.Model      // Bubble Tea list for navigating changes
}

Model represents the state of the TUI for reviewing OpenAPI key changes. It tracks the list of files, navigation state, accepted/skipped files, and the Bubble Tea list model.

func NewModel

func NewModel(files []FileDiff) Model

func (Model) Init

func (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() string

Jump to

Keyboard shortcuts

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