From 971bd430c762838dbdbee3307122a2edbe905fd5 Mon Sep 17 00:00:00 2001 From: stroblme Date: Fri, 28 Aug 2026 21:20:16 +0200 Subject: [PATCH] Count the runs in flight on Home, where an installation has any The tile only exists on an installation that has run something, which is the same "nothing has been run yet" the Runs screen goes by. The count comes from /runs/overview, already grouped by status in the database and already polled by the Runs screen, so Home shares its cache entry rather than paging rows or growing a second endpoint. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01K1moruzue2kTJd3uVisgNk --- docs/interface/index.md | 2 ++ .../src/components/Health/HealthOverview.tsx | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/interface/index.md b/docs/interface/index.md index 8c25987..32ae071 100644 --- a/docs/interface/index.md +++ b/docs/interface/index.md @@ -57,6 +57,8 @@ Always answers, degraded or not. The tiles cover: - **Flows** — total, running, paused, quarantined, and how many cannot run because their graph does not validate - **Nodes** — how many failed to load +- **Runs running** — batch runs in flight right now, and how many are + waiting. Only on an installation that has run something - **Queue** — depth, and how old the oldest pending item is - **Loop lag** — whether the engine's event loop is keeping up diff --git a/frontend/src/components/Health/HealthOverview.tsx b/frontend/src/components/Health/HealthOverview.tsx index 7339fc6..6a4826d 100644 --- a/frontend/src/components/Health/HealthOverview.tsx +++ b/frontend/src/components/Health/HealthOverview.tsx @@ -5,6 +5,7 @@ import type { FlowRollup, HistoryPoint } from "@/client" import { type Range, RangePicker } from "@/components/Common/RangePicker" import { Sparkline } from "@/components/Common/Sparkline" import { PANEL_SECTION } from "@/components/Flow/SidePanel" +import { runOverviewQueryOptions } from "@/components/Runs/queries" import { Badge } from "@/components/ui/badge" import { dur, si } from "@/lib/utils" import { @@ -82,10 +83,17 @@ export function HealthOverview({ const { data: flows } = useQuery(flowRollupsQueryOptions(range)) // Shares the list below's cache entry, for the one tile that dates them. const { data: failures } = useQuery(failuresQueryOptions(range)) + // Shares the Runs screen's cache entry, which already counts by status in + // the database rather than over a page of rows. + const { data: runs } = useQuery(runOverviewQueryOptions()) const queue = (summary?.queue ?? {}) as Record const degraded = summary?.status === "degraded" const errors = (flows ?? []).reduce((total, row) => total + row.errors, 0) + // An installation nobody has run a batch flow on has no runs tile at all — + // the same "nothing has been run yet" the Runs screen itself goes by. + const running = (runs ?? []).reduce((total, row) => total + row.running, 0) + const queued = (runs ?? []).reduce((total, row) => total + row.queued, 0) return ( <> @@ -105,7 +113,9 @@ export function HealthOverview({

) : null} -
+
+ {runs?.length ? ( + + ) : null}