Documentation
¶
Overview ¶
Package dashboard aggregates signals from all configured adapters into a single terminal view.
Index ¶
- func PendingCount(rc *config.ResolvedConfig, role string) int
- func PrintAwarenessLine(rc *config.ResolvedConfig, role string) bool
- func Render(data *DashboardData, userName, role, cycle string)
- func ReviewUrgency(window time.Duration, curve urgency.Curve, createdAt, now time.Time) float64
- func StageUrgency(pl config.PipelineConfig, curve urgency.Curve, ...) float64
- func VisibleInBlocked(pl config.PipelineConfig, cfg config.BlockedConfig, s SpecView, v Viewer) bool
- func VisibleInDo(pl config.PipelineConfig, s SpecView, v Viewer) bool
- type DashboardData
- type DashboardItem
- type SpecView
- type Viewer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PendingCount ¶
func PendingCount(rc *config.ResolvedConfig, role string) int
PendingCount returns the number of specs awaiting action from the current user's role. Reads local files only — never blocks on network.
func PrintAwarenessLine ¶
func PrintAwarenessLine(rc *config.ResolvedConfig, role string) bool
PrintAwarenessLine prints the passive "you have mail" indicator. Returns true if something was printed.
func Render ¶
func Render(data *DashboardData, userName, role, cycle string)
Render outputs the dashboard to the terminal.
func ReviewUrgency ¶ added in v0.30.0
ReviewUrgency computes the eased time-urgency intensity (0..1) for a REVIEW row from the PR's age (now - createdAt) against the configured review window. Returns 0 when no window is configured (window <= 0) or the PR has no opened timestamp, so REVIEW colouring is strictly opt-in.
func StageUrgency ¶ added in v0.30.0
func StageUrgency(pl config.PipelineConfig, curve urgency.Curve, stageName, stageEnteredAt, updated string, now time.Time) float64
StageUrgency computes the eased time-urgency intensity (0..1) for a spec at stageName, from its stage-entry time against the stage's configured stale window. Returns 0 when the stage has no window (never stale) or the entry time cannot be resolved. Shared by the dashboard and the pipeline screen so a task reads at the same intensity on both.
func VisibleInBlocked ¶ added in v0.22.1
func VisibleInBlocked(pl config.PipelineConfig, cfg config.BlockedConfig, s SpecView, v Viewer) bool
VisibleInBlocked reports whether a blocked spec should appear in the viewer's BLOCKED section, applying the team-level blocked config.
func VisibleInDo ¶ added in v0.22.1
func VisibleInDo(pl config.PipelineConfig, s SpecView, v Viewer) bool
VisibleInDo reports whether the spec should appear in the viewer's DO section, applying the spec's current stage dashboard scope.
Types ¶
type DashboardData ¶
type DashboardData struct {
Do []DashboardItem `json:"do"`
Review []DashboardItem `json:"review"`
Incoming []DashboardItem `json:"incoming"`
Blocked []DashboardItem `json:"blocked"`
FYI []DashboardItem `json:"fyi"`
}
DashboardData holds all dashboard sections.
type DashboardItem ¶
type DashboardItem struct {
SpecID string `json:"spec_id"`
Title string `json:"title"`
Stage string `json:"stage"`
Detail string `json:"detail"`
Urgency string `json:"urgency"` // "normal", "stale", "critical"
URL string `json:"url,omitempty"`
Assignee string `json:"assignee,omitempty"` // assignee label or "unclaimed" for DO rows
// StaleFraction is the eased time-urgency intensity (0..1) for this row,
// driving the gradient colour. 0 means fresh or the stage has no stale
// window (never stale).
StaleFraction float64 `json:"stale_fraction,omitempty"`
// SortTime is the moment this item entered its current state — stage entry
// for specs, PR-open for reviews, intake date for triage. It drives the
// oldest-first ordering within each dashboard section. Zero when unknown.
SortTime time.Time `json:"-"`
}
DashboardItem represents a single item in a dashboard section.
type SpecView ¶ added in v0.22.1
SpecView is the minimal projection of a spec the visibility rules need. It keeps the resolver pure — no file or config I/O — so the policy is one table-tested place and the aggregator stays thin.
type Viewer ¶ added in v0.22.1
type Viewer struct {
Role string
Name string
Handle string
// Identities is the full set of handles the viewer is known by (canonical
// handle, name, and per-provider handles). Matching checks all of them.
Identities []string
}
Viewer identifies the person the dashboard is being rendered for. Name, Handle, and every per-provider identity are matched against spec author/assignees so display-name vs @handle drift across teams does not hide a user's own work.