From 0c462acb21d4077761435c6679239545766437bf Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 27 Oct 2026 12:01:55 -0400 Subject: [PATCH] =?UTF-8?q?fix(dashboard):=20show=20fleet=20running=20?= =?UTF-8?q?=C2=B7=20$/hour=20figure=20in=20the=20visible=20Governor=20grid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fleetRunStripHtml landed in .oc-gov-strip, which is display:none, so the fleet figure from #14580 was never on screen. Render the same figure as a gov-stat in the Governor section and pin it with a webstatic test. Signed-off-by: Andrew Anderson --- changelog.d/fixed-fleet-run-governor-stat.md | 1 + src/pkg/dashboard/static/index.html | 11 +++++++ .../webstatic/fleet_run_stat_test.go | 33 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 changelog.d/fixed-fleet-run-governor-stat.md create mode 100644 src/pkg/dashboard/webstatic/fleet_run_stat_test.go diff --git a/changelog.d/fixed-fleet-run-governor-stat.md b/changelog.d/fixed-fleet-run-governor-stat.md new file mode 100644 index 0000000000..309d840f26 --- /dev/null +++ b/changelog.d/fixed-fleet-run-governor-stat.md @@ -0,0 +1 @@ +- Governor section shows the fleet `running N · $X this hour` figure as a visible stat; it previously rendered only inside the hidden compact governor strip diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index a8bdc6aaba..e7831a351e 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -13558,6 +13558,16 @@

Where to get help

? `${r.filesChanged} file${r.filesChanged === 1 ? '' : 's'}` : '– files'; return `
${cost}${sep}${toks}${sep}${fmtRunElapsed(r.elapsedS)}${sep}${tests}${sep}${files}
`; } + // fleetRunStatHtml is the Governor-section twin of fleetRunStripHtml: the + // compact strip it first landed in is display:none while the full + // Governor section stays visible in focus mode, so without this stat the + // fleet figure was never on screen. + function fleetRunStatHtml() { + const f = window._lastStatus?.fleetRun; + if (!f) return ''; + const hour = f.hourPriced ? fmtUSD(f.hourUSD || 0) : '$–'; + return `
running
${f.running || 0} · ${hour} this hour
`; + } function fleetRunStripHtml() { const f = window._lastStatus?.fleetRun; if (!f) return ''; @@ -19121,6 +19131,7 @@

All labels

actionable issues
${issueCount}${issuesSpark}
${issueEquationHTML ? `
${issueEquationHTML}
` : ''}
actionable PRs
${prCount}${prsSpark}
${prEquationHTML ? `
${prEquationHTML}
` : ''}
MTTR
${formatFixTime(itmMedian)}${itmSpark}
+ ${fleetRunStatHtml()}
on hold
${holdTotal}${holdSpark}
${(() => { // Planning tile: active plan-trees, with plans-awaiting-review highlighted diff --git a/src/pkg/dashboard/webstatic/fleet_run_stat_test.go b/src/pkg/dashboard/webstatic/fleet_run_stat_test.go new file mode 100644 index 0000000000..5768c77f68 --- /dev/null +++ b/src/pkg/dashboard/webstatic/fleet_run_stat_test.go @@ -0,0 +1,33 @@ +package webstatic + +import ( + "os" + "strings" + "testing" +) + +// TestFleetRunFigureIsInVisibleGovernorGrid pins that the fleet +// "running N · $X this hour" figure renders inside the Governor section's +// gov-grid, not only in the compact .oc-gov-strip (display:none), where it +// first landed and was never on screen. +func TestFleetRunFigureIsInVisibleGovernorGrid(t *testing.T) { + body, err := os.ReadFile("../static/index.html") + if err != nil { + t.Fatal(err) + } + html := string(body) + grid := strings.Index(html, `