Line

ui/client/features/diagnostics/domain/DiagnosticsSummary

Pure (DOMAIN-001): the short texts and counts derived from a validate run.

Cockpit client (features), v0.9. Source: ui/client/features/diagnostics/domain/DiagnosticsSummary.ts.

Functions#

headline()#

headline(counts): string

Defined in: ui/client/features/diagnostics/domain/DiagnosticsSummary.ts:5

"3 errors, 2 warnings" or "No problems found".

Parameters#

counts

SeverityCounts

Returns#

string


statusText()#

statusText(state): string

Defined in: ui/client/features/diagnostics/domain/DiagnosticsSummary.ts:31

Short status-bar text.

Parameters#

state

DiagnosticsState

Returns#

string


statusTextChars()#

statusTextChars(): number

Defined in: ui/client/features/diagnostics/domain/DiagnosticsSummary.ts:65

The longest statusText, in characters -- what the status bar reserves. Characters, not pixels: the status bar sizes itself in ch, so the reservation follows the font and the zoom, and nothing has to be measured in a layout pass or duplicated invisibly into the DOM.

Returns#

number


statusTexts()#

statusTexts(): string[]

Defined in: ui/client/features/diagnostics/domain/DiagnosticsSummary.ts:57

Returns#

string[]


tabBadge()#

tabBadge(state): number | null

Defined in: ui/client/features/diagnostics/domain/DiagnosticsSummary.ts:26

The count shown as the tab badge.

null -- "there is a badge here, it has no value yet" -- until a run has actually finished, which reserves its room in the tab so the first result cannot shove the tabs beside it sideways. durationMs is the test for that: it is how long the last completed run took, so it is null exactly while no run has ever completed.

From then on it is the last known count, including while a re-run is in flight. The reducer deliberately keeps the previous result visible during a re-run; blanking the badge contradicted that and made every re-run bounce the tabs left and then right again. 0 is shown -- it is a result.

Parameters#

state

DiagnosticsState

Returns#

number | null