Documentation
¶
Overview ¶
Package submit provides a TUI component for displaying the progress of a stack submission.
Package submit provides a TUI component for displaying the progress of a stack submission.
Index ¶
- Constants
- func DisplayBranchName(branchName string) string
- func FormatClosingSummary(items []Item, skipped int, elapsed time.Duration) string
- func FormatCompactRow(item Item, width int, spinnerView string, styles Styles) string
- func FormatFailureSummary(items []Item) string
- func FormatFinalList(items []Item) string
- func FormatSoloRow(item Item, spinnerView string, styles Styles) string
- func FormatSoloSummary(items []Item) string
- func PRRef(item Item) string
- func TruncateMiddle(s string, maxWidth int) string
- type Item
- type Model
- type ProgressCompleteMsg
- type ProgressUpdateMsg
- type Status
- type Styles
- type WarningMsg
Constants ¶
const ( // StatusSubmitting indicates the branch is currently being submitted StatusSubmitting Status = "submitting" // StatusSyncing indicates the branch metadata is being synced StatusSyncing Status = "syncing" // StatusDone indicates the branch submission was successful StatusDone Status = "done" // StatusError indicates the branch submission failed StatusError Status = "error" // StatusPending indicates the branch is waiting to be submitted StatusPending Status = "pending" // SkipReasonNoChanges indicates the branch was skipped because it has no changes SkipReasonNoChanges = "no changes" // ActionUpdate indicates the branch will update an existing PR ActionUpdate = engine.SubmitActionUpdate // ActionCreate indicates the branch will create a new PR ActionCreate = engine.SubmitActionCreate )
Variables ¶
This section is empty.
Functions ¶
func DisplayBranchName ¶ added in v0.22.0
DisplayBranchName returns a compact branch name for submit output.
func FormatClosingSummary ¶ added in v0.22.0
FormatClosingSummary renders the one-line run summary: counts by outcome plus elapsed time, e.g. "✓ 1 created, 2 updated, 4 unchanged (6.2s)".
func FormatCompactRow ¶ added in v0.22.0
FormatCompactRow renders a single submit progress row.
func FormatFailureSummary ¶ added in v0.22.0
FormatFailureSummary renders failed branches with their errors. The progress view is cleared when the TUI exits, so failures must be re-emitted as persistent output or they vanish from the terminal.
func FormatFinalList ¶ added in v0.22.0
FormatFinalList renders the persisted post-submit result: one row per branch with its final status, the row hyperlinked to its PR. Raw URL lines print only for newly created PRs — those are the ones the user needs to open; updated PRs rarely need their URL re-pasted.
func FormatSoloRow ¶ added in v0.22.0
FormatSoloRow renders the progress row for a single-branch submit. The branch name is omitted — the plan line already named it — so the row is just the status icon and detail (e.g. " ✓ #1270 created").
func FormatSoloSummary ¶ added in v0.22.0
FormatSoloSummary renders the post-submit result for a single-branch submit: the PR ref and action on one line, the URL on the next, both indented. Unlike the stack summary there is no "Pull requests" header — one PR needs no list.
func PRRef ¶ added in v0.22.0
PRRef returns a display PR number, deriving it from URL when necessary.
func TruncateMiddle ¶ added in v0.22.0
TruncateMiddle shortens s to maxWidth display cells, preserving both ends.
Types ¶
type Item ¶
type Item struct {
BranchName string
Action engine.SubmitAction
PRNumber *int
Status Status
IsSkipped bool
SkipReason string
URL string
Error error
}
Item represents a branch being submitted
type Model ¶
type Model struct {
core.BaseModel // Embedded for ReadySignaler interface
Items []Item
Warnings []string // formatted warning lines, rendered after the rows and persisted on exit
Solo bool // single-branch submit — drop the count header and per-row name
Styles Styles
// contains filtered or unexported fields
}
Model is the bubbletea model for submit progress. It embeds core.BaseModel for standard lifecycle handling.
type ProgressCompleteMsg ¶
type ProgressCompleteMsg struct {
Skipped int // branches skipped in the plan, shown as "unchanged"
Elapsed time.Duration // total run time; zero when unknown
}
ProgressCompleteMsg is sent when all submissions are finished.
type ProgressUpdateMsg ¶
ProgressUpdateMsg is sent to update the status of a specific branch submission
type Status ¶ added in v0.22.0
type Status string
Status is the submission progress state of a branch. It mirrors the actions-layer submit.BranchStatus values; adapters convert at the boundary.
type Styles ¶
type Styles struct {
SpinnerStyle lipgloss.Style
DoneStyle lipgloss.Style
ErrorStyle lipgloss.Style
BranchStyle lipgloss.Style
DimStyle lipgloss.Style
}
Styles defines the visual styling for the submit 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 submit component, using shared styles from the style package for consistency.
type WarningMsg ¶ added in v0.22.0
WarningMsg surfaces a non-fatal warning for a branch (e.g. labels could not be applied). Warnings render below the progress rows and persist on exit.