foreach

package
v0.17.14 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 foreach provides a TUI component for displaying the progress of foreach command execution.

Package foreach provides a TUI component for displaying the progress of foreach command execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobalMessageMsg

type GlobalMessageMsg string

GlobalMessageMsg is sent to display a global message (e.g., "Running...")

type Item

type Item struct {
	BranchName string
	Status     core.Status
	Output     string
	Error      error
}

Item represents a branch being processed

type Model

type Model struct {
	core.BaseModel // Embedded for ReadySignaler interface
	Items          []Item
	Renderer       *tree.StackTreeRenderer
	RootBranch     string

	Styles        Styles
	GlobalMessage string
	Command       string
	// contains filtered or unexported fields
}

Model is the bubbletea model for foreach progress. It embeds core.BaseModel for standard lifecycle handling.

func NewModel

func NewModel(items []Item) *Model

NewModel creates a new foreach 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 and updates the model.

func (*Model) View

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

View renders the model as a string.

type ProgressCompleteMsg

type ProgressCompleteMsg struct{}

ProgressCompleteMsg is sent when all executions are finished

type ProgressUpdateMsg

type ProgressUpdateMsg struct {
	BranchName string
	Status     core.Status
	Output     string
	Err        error
}

ProgressUpdateMsg is sent to update the status of a specific branch execution

type StartExecutionMsg

type StartExecutionMsg struct {
	Items []Item
}

StartExecutionMsg is sent when the execution phase begins

type Styles

type Styles struct {
	SpinnerStyle lipgloss.Style
	DoneStyle    lipgloss.Style
	ErrorStyle   lipgloss.Style
	BranchStyle  lipgloss.Style
	OutputStyle  lipgloss.Style
	DimStyle     lipgloss.Style
}

Styles defines the visual styling for the foreach component. It uses the shared style definitions from internal/tui/style for consistency.

func DefaultStyles

func DefaultStyles() Styles

DefaultStyles returns the default styles for the foreach component, using shared styles from the style package for consistency.

Jump to

Keyboard shortcuts

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