modifyview

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

type ConflictInfo struct {
	Branch          string
	ConflictedFiles []string
}

ConflictInfo holds information about a rebase conflict during apply.

type DroppedPR

type DroppedPR struct {
	Branch   string
	PRNumber int
}

DroppedPR records a PR that was dropped from the stack.

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) Applied

func (m Model) Applied() bool

func (Model) ApplyRequested

func (m Model) ApplyRequested() bool

func (Model) Cancelled

func (m Model) Cancelled() bool

func (Model) Conflict

func (m Model) Conflict() *ConflictInfo

func (Model) ConflictChoice

func (m Model) ConflictChoice() string

func (Model) Init

func (m Model) Init() tea.Cmd

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

func (Model) Update

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

func (Model) View

func (m Model) View() string

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

type RenamedBranch struct {
	OldName string
	NewName string
}

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.

Jump to

Keyboard shortcuts

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