ui

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package ui implements the Bubble Tea TUI for scry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataLoadedMsg

type MetadataLoadedMsg struct {
	Files []model.FileSummary
	Gen   int
	Err   error
}

MetadataLoadedMsg is sent when an async metadata reload completes.

type MetadataLoader

type MetadataLoader interface {
	ListFiles(ctx context.Context, cmp model.ResolvedCompare) ([]model.FileSummary, error)
}

MetadataLoader lists changed files for a compare range.

type Model

type Model struct {
	State model.AppState
	// contains filtered or unexported fields
}

Model is the top-level Bubble Tea model for scry.

func NewModel

func NewModel(state model.AppState, opts ...ModelOption) Model

NewModel creates a Model from bootstrap data. Sets SelectedFile to -1 when the file list is empty, 0 otherwise.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) Update

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

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

type ModelOption

type ModelOption func(*Model)

ModelOption configures optional Model dependencies.

func WithMetadataLoader

func WithMetadataLoader(ml MetadataLoader) ModelOption

WithMetadataLoader sets the MetadataLoader used to reload file lists on refresh.

func WithPatchLoader

func WithPatchLoader(pl PatchLoader) ModelOption

WithPatchLoader sets the PatchLoader used to load file diffs on Enter.

type PatchLoadedMsg

type PatchLoadedMsg struct {
	Path  string
	Patch model.FilePatch
	Gen   int
	Err   error
}

PatchLoadedMsg is sent when an async patch load completes.

type PatchLoader

type PatchLoader interface {
	LoadPatch(ctx context.Context, cmp model.ResolvedCompare, filePath string, ignoreWhitespace bool) (model.FilePatch, error)
}

PatchLoader loads a file's unified diff.

Directories

Path Synopsis
Package panes implements individual UI pane components for scry.
Package panes implements individual UI pane components for scry.

Jump to

Keyboard shortcuts

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