dashboard

package
v0.46.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package dashboard aggregates signals from all configured adapters into a single terminal view.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscussionCount added in v0.33.0

func DiscussionCount(rc *config.ResolvedConfig, role string) int

DiscussionCount returns the number of open discussion threads across every spec where it is the viewer's turn (isViewerTurn, discussion.go) — reading sidecars only, never blocking on network. Shares its turn predicate with the DISCUSSION dashboard section so the two can never disagree about what counts as "your turn".

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, combining pending-stage work and awaited discussion replies into one row. A clause is omitted when its count is zero; nothing prints when both are zero.

func Render

func Render(data *DashboardData, userName, role, cycle string)

Render outputs the dashboard to the terminal.

func ReviewUrgency added in v0.30.0

func ReviewUrgency(window time.Duration, curve urgency.Curve, createdAt, now time.Time) float64

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 SliceMark added in v0.46.0

func SliceMark(parent string) string

SliceMark returns the one-cell marker that follows a slice's SPEC-ID, carrying hierarchy inside an existing row rather than adding chrome. The dashboard sorts by personal urgency, and the pipeline groups by stage; re-parenting rows would lie about both, so the relationship is marked here and nested only in the structural browser.

It is exported so the TUI's dashboard and pipeline rows use the same marker as the printed dashboard, and the three cannot drift apart.

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"`
	Discussion []DashboardItem `json:"discussion"`
	Incoming   []DashboardItem `json:"incoming"`
	Blocked    []DashboardItem `json:"blocked"`
	FYI        []DashboardItem `json:"fyi"`
}

DashboardData holds all dashboard sections.

func Aggregate

func Aggregate(ctx context.Context, rc *config.ResolvedConfig, reg *adapter.Registry, role string) (*DashboardData, error)

Aggregate collects data for the dashboard from all sources.

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"`

	// Bounty is the spec's bounty when it carries one, nil otherwise. It drives
	// the gold marker on the spec's glyph and ID; the rest of the row keeps its
	// urgency colour, so the two signals read at the same time.
	Bounty *markdown.BountyState `json:"bounty,omitempty"`

	// Parent is the initiative this spec is a deliverable slice of, empty
	// otherwise. The dashboard sorts by personal urgency, which re-parenting
	// would scramble, so hierarchy appears here as a marker on an existing row
	// and a detail line — never as nesting.
	Parent string `json:"parent,omitempty"`

	// ParentTitle is Parent's title, for the detail pane's "Part of" line.
	ParentTitle string `json:"parent_title,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

type SpecView struct {
	Author      string
	Assignees   []string
	Status      string
	BlockedFrom string
}

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 = identity.Viewer

Viewer is an alias for identity.Viewer, kept so dashboard code and its existing tests read the same as before the identity package was extracted. internal/identity is the source of truth; this package is a thin caller.

Jump to

Keyboard shortcuts

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