Help us shape the future of Go! Take the 2026 Go Developer Survey

tui

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Actions

func Actions() []string

func HunkKey

func HunkKey(h model.Hunk) string

HunkKey identifies a hunk by its file and its lines, not by its position, so a review status survives edits elsewhere in the file and is the same for the session, --staged and --pr views of one hunk.

Types

type Callbacks

type Callbacks struct {
	SetUnitStatus func(unitID, status string) error
	SetHunkStatus func(hunkKey, status string) error
	// Ask is nil when no LLM is configured.
	Ask func(question string) (string, error)
	// Refresh returns new data when the sessions changed, or nil. Nil
	// Refresh turns off the reload.
	Refresh func() (*Data, error)
}

type Data

type Data struct {
	Title       string
	Agent       string
	Fidelity    string
	Status      string
	Steps       int
	Files       int
	Units       []Unit
	Flags       []model.Flag
	Sessions    map[string]*store.SessionData
	Provenance  map[string][]model.HunkProvenance
	Rationales  map[string]model.Rationale
	StepSession map[string]string
	ActorKind   map[string]string
	Intent      []model.IntentItem
	Timeline    []TimelineStep
	LLMOn       bool
	RepoTop     string
	// LineSteps maps a file and a line of the new file to the step that wrote it.
	LineSteps map[string]map[int]string
	// HunkStatus maps a HunkKey to understood or questioned.
	HunkStatus map[string]string
}

type Model

type Model struct {
	Editor func(file string, line int) *exec.Cmd
	// contains filtered or unexported fields
}

func New

func New(d *Data, cb Callbacks, color bool) *Model

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) Reload added in v0.2.0

func (m *Model) Reload(d *Data)

Reload swaps in new data and keeps the selected hunk and prompt.

func (*Model) Selection

func (m *Model) Selection() (unit, hunk int, focus int, view int)

func (*Model) SetKeymap

func (m *Model) SetKeymap(overrides map[string]string) error

SetKeymap maps extra keys to actions, for example {"quit": "ctrl+q"}. The default keys keep working.

func (*Model) SetLightTheme

func (m *Model) SetLightTheme()

SetLightTheme uses a syntax style for light terminals.

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type TimelineStep

type TimelineStep struct {
	Step      model.Step
	Depth     int
	Actor     string
	Tool      string
	Files     []string
	Test      string
	Survive   int
	Abandoned bool
}

type Unit

type Unit struct {
	model.ReviewUnit
	Hunks []model.Hunk
}

Jump to

Keyboard shortcuts

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