Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Now = time.Now
Now is overridable in tests for stable staleness output.
Functions ¶
This section is empty.
Types ¶
type Layer ¶
type Layer struct {
Stack string `json:"stack"`
Position int `json:"position"`
Branch string `json:"branch"`
Title string `json:"title"` // PR title (shown in --all mode)
PRNumber int `json:"pr_number"`
PRState string `json:"pr_state"` // "OPEN", "MERGED", or ""
CIStatus string `json:"ci_status"` // SUCCESS, FAILURE, PENDING, ""
ReviewDecision string `json:"review_decision"` // APPROVED, CHANGES_REQUESTED, REVIEW_REQUIRED, ""
UpdatedAt string `json:"updated_at"` // RFC3339; "" if unknown
// ChangesSinceReview is the number of commits added since the current
// user's last review on this PR; 0 means "no prior review or no new
// commits since."
ChangesSinceReview int `json:"changes_since_review"`
IsCurrent bool `json:"is_current"`
NeedsSync bool `json:"needs_sync"`
Depth int `json:"depth"` // nesting depth for tree view (--all mode)
}
Layer is one branch in a stack, also used as JSON output.
type Model ¶
type Model struct {
// Layers and Cursor describe the currently visible view. When Tabs is
// non-empty these mirror m.Tabs[m.ActiveTab] and are swapped on tab change.
Layers []Layer
Cursor int
// Tabs, when set, enables the tab bar across the top. Leave nil for a
// single-view TUI (e.g. cn status --all without tabs).
Tabs []Tab
ActiveTab int
// Updater is invoked to push a new PR title. If nil, the rename action is
// disabled.
Updater TitleUpdater
// contains filtered or unexported fields
}
Model is the bubbletea model for cn status.
type PendingAction ¶ added in v0.1.3
type PendingAction int
PendingAction is an action the user triggered that the caller should run after the TUI exits.
const ( ActionNone PendingAction = iota ActionCheckout // git checkout the selected branch ActionOpenPR // open the PR in the browser ActionSync // run cn sync from the selected branch ActionSubmit // run cn submit ActionViewDiff // open PR diff in the chainrail viewer )
type Result ¶ added in v0.1.3
type Result struct {
Action PendingAction
Branch string
PRNumber int
}
Result is returned after the TUI exits and carries any pending action.
Click to show internal directories.
Click to hide internal directories.