Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClampRefresh ¶
ClampRefresh clamps the user-supplied refresh interval (seconds) to [5, 300].
func Hyperlink ¶
Hyperlink wraps text in an OSC 8 escape sequence pointing at url. Modern terminals render this as a clickable link; terminals that do not support it strip the sequence cleanly and show only the text. We emit unconditionally — detection across the long tail of terminals is unreliable.
func OpenURL ¶
OpenURL launches the user's default browser. Returns nil if the spawn succeeds; the dashboard treats failures as non-fatal.
func SortBatches ¶
func SortBatches(batches []BatchEntry)
SortBatches orders batches: stable-disagreement first, then cascade-failed, then attention items, then by LatestActivity desc, then by MilestoneNumber asc. Sorts in place.
func TierProgressGlyphs ¶
TierProgressGlyphs returns a glyph string for the supplied counts using the order: done (●), in-progress (◐), ready/blocked (○), failed (✗). The total number of glyphs equals done+inProgress+ready+failed.
Types ¶
type BatchEntry ¶
type BatchEntry struct {
MilestoneNumber int
MilestoneTitle string
MilestoneURL string
PRNumber int // 0 if no PR yet
PRURL string
CIStatus string // "", "success", "failure", "pending", "error"
ReviewState string // "", "approved", "changes_requested", "commented"
Tier int // current tier (1-indexed for display)
TotalTiers int
Done int
InProgress int
Ready int
Failed int
Blocked int
LatestActivity time.Time // max issue.UpdatedAt across milestone
HasAttention bool // any failed issue || CIStatus==failure || ReviewState==changes_requested
// CascadeFailed is true when the batch PR carries the herd/cascade-failed
// label, indicating the conflict-resolution cascade exhausted and is
// awaiting manual intervention.
CascadeFailed bool
// StableDisagreement is true when the batch PR carries the
// herd/stable-disagreement label. Implies HasAttention.
StableDisagreement bool
}
BatchEntry is one open milestone with at least one herd/* labelled issue.
ReviewState is reserved for a future task: the platform package does not currently expose a list-reviews API, so Fetch leaves it empty in v1.
type FailureEntry ¶
type FailureEntry struct {
Number int
Title string
Label string // primary type label, e.g. "herd/type:feature"
UpdatedAt time.Time
}
FailureEntry is one issue with herd/status:failed updated in the last 24h.
type Model ¶
type Model struct {
Platform platform.Platform
Owner string
Repo string
RefreshSec int
// contains filtered or unexported fields
}
Model is the bubbletea model. Exported so cli/dashboard.go can construct it.
type State ¶
type State struct {
Owner string
Repo string
Workers []WorkerEntry
Batches []BatchEntry
Failures []FailureEntry
LastRefresh time.Time
FetchError string // last non-fatal error, displayed in status area
}
State is the snapshot the TUI renders on each tick. All fields are populated by Fetch; on partial failure, the previous State is reused and FetchError is set on a copy by the caller.
type WorkerEntry ¶
type WorkerEntry struct {
RunID int64
IssueNumber int // parsed from run inputs ("issue") if present, else 0
IssueTitle string // populated by Fetch via Issues().Get when IssueNumber>0; truncated by view
URL string // workflow run URL
StartedAt time.Time
}
WorkerEntry is one in-progress run of herd-worker.yml.