Documentation
¶
Overview ¶
Package tui provides terminal user interface components for interactive review.
Description ¶
This package implements the interactive diff review TUI using bubbletea. It allows users to review, accept, reject, and edit proposed code changes before they are applied.
Thread Safety ¶
TUI components are designed for single-threaded use within the bubbletea event loop. Do not access TUI state from multiple goroutines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiffReviewConfig ¶
type DiffReviewConfig struct {
// Editor is the command to invoke for editing (default: $EDITOR or "vi").
Editor string
// ConfirmAcceptAll requires typing "yes" for Accept All (safety).
ConfirmAcceptAll bool
// ShowLineNumbers shows line numbers in diff output.
ShowLineNumbers bool
// ContextLines is the number of context lines to show around changes.
ContextLines int
// Width overrides terminal width (0 = auto-detect).
Width int
// Height overrides terminal height (0 = auto-detect).
Height int
}
DiffReviewConfig configures the diff review TUI.
func DefaultDiffReviewConfig ¶
func DefaultDiffReviewConfig() DiffReviewConfig
DefaultDiffReviewConfig returns sensible defaults.
type DiffReviewModel ¶
type DiffReviewModel struct {
// contains filtered or unexported fields
}
DiffReviewModel is the bubbletea model for interactive diff review.
Description ¶
Manages the state of the diff review session, including navigation, decisions, and rendering.
func NewDiffReviewModel ¶
func NewDiffReviewModel(changes []*diff.ProposedChange, config DiffReviewConfig) DiffReviewModel
NewDiffReviewModel creates a new diff review model.
Inputs ¶
- changes: The proposed changes to review.
- config: Configuration options.
Outputs ¶
- DiffReviewModel: Ready-to-use model for tea.NewProgram.
func (DiffReviewModel) Changes ¶
func (m DiffReviewModel) Changes() []*diff.ProposedChange
Changes returns the changes with updated hunk statuses.
func (DiffReviewModel) Result ¶
func (m DiffReviewModel) Result() *diff.ReviewResult
Result returns the review result after the TUI exits.
Description ¶
Returns the current state of all decisions. If the TUI hasn't finished yet, this returns the decisions made so far.
type DoneMsg ¶
type DoneMsg struct {
Result *diff.ReviewResult
}
DoneMsg signals the review is complete.
type EditorResultMsg ¶
EditorResultMsg contains the result of external editor invocation.