Documentation
¶
Overview ¶
Package tui implements the interactive terminal user interface using Bubble Tea.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
Ctx context.Context `json:"-"` // Context for git commands (ignore in JSON if ever needed)
DryRun bool `json:"dryRun"`
AllAnalyzedBranches []types.AnalyzedBranch `json:"-"` // Full list (ignore in JSON)
KeyBranches []types.AnalyzedBranch `json:"-"` // Protected (ignore in JSON)
SuggestedBranches []types.AnalyzedBranch `json:"-"` // Candidates (ignore in JSON)
OtherActiveBranches []types.AnalyzedBranch `json:"-"` // Active (ignore in JSON)
ListOrder []int `json:"-"` // Maps display index to original index (ignore in JSON)
Cursor int `json:"cursor"`
SelectedLocal map[int]bool `json:"selectedLocal"` // Map using original index
SelectedRemote map[int]bool `json:"selectedRemote"` // Map using original index
ViewState ViewState `json:"viewState"` // Renamed from viewState
Results []types.DeleteResult `json:"results"`
Spinner spinner.Model `json:"-"` // Spinner model (ignore in JSON)
Width int `json:"width"`
Height int `json:"height"`
// Viewport management
Viewports map[Section]ViewportState `json:"-"` // Viewport state for each section
CurrentSection Section `json:"-"` // Currently active section
}
Model represents the state of the TUI application.
func InitialModel ¶
func InitialModel( ctx context.Context, analyzedBranches []types.AnalyzedBranch, dryRun bool, ) Model
InitialModel creates the starting model for the TUI, separating branches into three groups.
func (Model) GetBranchesToDelete ¶
func (m Model) GetBranchesToDelete() []gitcmd.BranchToDelete
GetBranchesToDelete builds the list of actions based on current selections using original indices. Kept internal as it's only called by View and Update.
type Section ¶ added in v0.4.0
type Section int
Section represents a logical section of branches in the UI
type ViewState ¶ added in v0.3.0
type ViewState int // Renamed from viewState
ViewState represents the different views the TUI can be in.
const ( // StateSelecting is the initial state for branch selection. StateSelecting ViewState = iota // Renamed from stateSelecting // StateConfirming is the state for confirming deletions. StateConfirming // Renamed from stateConfirming // StateDeleting is the state shown while deletions are in progress. StateDeleting // Renamed from stateDeleting // StateResults is the state showing the outcome of deletions. StateResults // Renamed from stateResults )
type ViewportState ¶ added in v0.4.0
type ViewportState struct {
Start int // First visible item index
Size int // Number of visible items
Total int // Total items in section
}
ViewportState tracks scrolling state for a specific section
Click to show internal directories.
Click to hide internal directories.