sync

package
v0.17.15 Latest Latest
Warning

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

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

Documentation

Overview

Package sync provides a TUI component for displaying sync progress.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompleteMsg

type CompleteMsg struct {
	Summary string
}

CompleteMsg indicates sync is complete

type Model

type Model struct {
	core.BaseModel // Embedded for ReadySignaler interface
	CurrentPhase   Phase
	CurrentDetail  string // Current operation being performed
	TotalOps       int
	CompletedOps   int
	Progress       progress.Model

	Summary string
	// contains filtered or unexported fields
}

Model is the bubbletea model for sync progress. It embeds core.BaseModel for standard lifecycle handling. Uses tea.Printf to print completed items above the active UI.

func NewModel

func NewModel(totalOps int) *Model

NewModel creates a new sync model

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init initializes the model

func (*Model) Update

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

Update handles messages

func (*Model) View

func (m *Model) View() tea.View

View renders the model - shows only the active progress (package-manager pattern) Completed items are printed above via tea.Printf

type Phase

type Phase string

Phase represents a sync phase

const (
	PhaseTrunk    Phase = "trunk"
	PhaseBranches Phase = "branches"
	PhaseGitHub   Phase = "github"
	PhaseClean    Phase = "clean"
	PhaseRestack  Phase = "restack"
)

Phase constants

type PhaseCompleteMsg

type PhaseCompleteMsg struct {
	Phase Phase
}

PhaseCompleteMsg indicates a phase has completed

type PhaseDetailMsg

type PhaseDetailMsg struct {
	Phase   Phase
	Message string
	IsWarn  bool // If true, shows ⚠ instead of ✓
}

PhaseDetailMsg adds a detail line to a phase (printed above TUI)

type PhaseStartMsg

type PhaseStartMsg struct {
	Phase   Phase
	Message string // Phase header message (e.g., "📥 Pulling from remote...")
}

PhaseStartMsg indicates a phase has started

type ProgressTickMsg

type ProgressTickMsg struct {
	Completed int
	Total     int
}

ProgressTickMsg updates the progress bar

Jump to

Keyboard shortcuts

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