Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-fleet-run-governor-stat.md
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions src/pkg/dashboard/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13558,6 +13558,16 @@ <h3 class="faq-group-title">Where to get help</h3>
? `${r.filesChanged} file${r.filesChanged === 1 ? '' : 's'}` : '– files';
return `<div class="oc-run-line" data-agent-run="${esc(a.name)}" title="${esc(RUN_LINE_HELP)}"><span class="rl-cost">${cost}</span>${sep}<span class="rl-tokens">${toks}</span>${sep}<span class="rl-elapsed">${fmtRunElapsed(r.elapsedS)}</span>${sep}${tests}${sep}<span class="rl-files">${files}</span></div>`;
}
// 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 `<div class="gov-stat" title="RUNNING — agents mid-kick right now · estimated spend accrued by the whole fleet in the current clock hour (token × list price; $– when a running agent's model is unpriced).&#10;&#10;Updates with every status poll; the per-agent breakdown is on each card's run line in Agents."><div class="label">running</div><div class="val" id="gov-fleet-run">${f.running || 0} · ${hour} this hour</div></div>`;
}
function fleetRunStripHtml() {
const f = window._lastStatus?.fleetRun;
if (!f) return '';
Expand Down Expand Up @@ -19121,6 +19131,7 @@ <h2 class="config-title" id="activity-monitor-labels-title">All labels</h2>
<div class="gov-stat" aria-label="${escapeHtml(issueEquationTitle)}"><div class="label">actionable issues</div><div class="spark-row"><span class="val">${issueCount}</span>${issuesSpark}</div>${issueEquationHTML ? `<div class="overview-kpi-subline">${issueEquationHTML}</div>` : ''}</div>
<div class="gov-stat" aria-label="${escapeHtml(prEquationTitle)}"><div class="label">actionable PRs</div><div class="spark-row"><span class="val">${prCount}</span>${prsSpark}</div>${prEquationHTML ? `<div class="overview-kpi-subline">${prEquationHTML}</div>` : ''}</div>
<div class="gov-stat" title="${itmTitle}"><div class="label">MTTR</div><div class="spark-row"><span class="val">${formatFixTime(itmMedian)}</span>${itmSpark}</div></div>
${fleetRunStatHtml()}
<div class="gov-stat" title="${holdTooltip}"><div class="label">on hold</div><div class="spark-row"><span class="val">${holdTotal}</span>${holdSpark}</div></div>
${(() => {
// Planning tile: active plan-trees, with plans-awaiting-review highlighted
Expand Down
33 changes: 33 additions & 0 deletions src/pkg/dashboard/webstatic/fleet_run_stat_test.go
Original file line number Diff line number Diff line change
@@ -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, `<div class="gov-grid sec-headline"`)
if grid < 0 {
t.Fatal("governor gov-grid not found")
}
end := strings.Index(html[grid:], `<div class="temp-gauge"`)
if end < 0 {
t.Fatal("governor gauge not found after gov-grid")
}
if !strings.Contains(html[grid:grid+end], "${fleetRunStatHtml()}") {
t.Fatal("fleetRunStatHtml() is not rendered inside the Governor gov-grid")
}
if !strings.Contains(html, `id="gov-fleet-run"`) || !strings.Contains(html, `class="gov-stat" title="RUNNING`) {
t.Fatal("fleet run gov-stat markup missing")
}
}
Loading