Documentation
¶
Index ¶
- type ActionType
- type ApplyResult
- type ConflictInfo
- type DroppedPR
- type Model
- func (m Model) Applied() bool
- func (m Model) ApplyRequested() bool
- func (m Model) Cancelled() bool
- func (m Model) Conflict() *ConflictInfo
- func (m Model) ConflictChoice() string
- func (m Model) Init() tea.Cmd
- func (m Model) Nodes() []ModifyBranchNode
- func (m Model) Result() *ApplyResult
- func (m *Model) SetConflict(c *ConflictInfo)
- func (m *Model) SetResult(r *ApplyResult)
- func (m Model) StagedActions() []StagedAction
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- type ModifyBranchNode
- type PendingAction
- type RenamedBranch
- type StagedAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType string
ActionType represents the type of modification action.
const ( ActionDrop ActionType = "drop" ActionFoldDown ActionType = "fold_down" ActionFoldUp ActionType = "fold_up" ActionMove ActionType = "move" ActionRename ActionType = "rename" )
type ApplyResult ¶
type ApplyResult struct {
Success bool
DroppedPRs []DroppedPR
RenamedBranches []RenamedBranch
MovedBranches int
Message string
}
ApplyResult holds the outcome of applying modifications.
type ConflictInfo ¶
ConflictInfo holds information about a rebase conflict during apply.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Bubble Tea model for the interactive modify view.
func New ¶
func New(nodes []ModifyBranchNode, trunk stack.BranchRef, version string) Model
New creates a new modify view model.
func (Model) ApplyRequested ¶
func (Model) Conflict ¶
func (m Model) Conflict() *ConflictInfo
func (Model) ConflictChoice ¶
func (Model) Nodes ¶
func (m Model) Nodes() []ModifyBranchNode
Nodes returns the current node state for the apply engine.
func (Model) Result ¶
func (m Model) Result() *ApplyResult
func (*Model) SetConflict ¶
func (m *Model) SetConflict(c *ConflictInfo)
SetConflict is called by the command layer when a rebase conflict occurs.
func (*Model) SetResult ¶
func (m *Model) SetResult(r *ApplyResult)
SetResult is called by the command layer after apply completes.
func (Model) StagedActions ¶
func (m Model) StagedActions() []StagedAction
type ModifyBranchNode ¶
type ModifyBranchNode struct {
stackview.BranchNode
PendingAction *PendingAction
OriginalPosition int
Removed bool // true if this branch has been dropped or folded
}
ModifyBranchNode wraps a BranchNode with modification state.
type PendingAction ¶
type PendingAction struct {
Type ActionType
NewName string // for rename
}
PendingAction represents a staged modification on a branch.
type RenamedBranch ¶
RenamedBranch records a branch rename.
type StagedAction ¶
type StagedAction struct {
Type ActionType
BranchName string // the branch affected
OriginalPosition int // for move: the position before the move
NewPosition int // for move: the position after the move
OriginalName string // for rename: the name before rename
NewName string // for rename: the name after rename
FoldTarget string // for fold: the branch that received the commits
}
StagedAction records a single staged action in the undo stack. It stores enough information to reverse the action.