diff --git a/web/src/components/FleetRail.tsx b/web/src/components/FleetRail.tsx index aa5e8af..54b2c42 100644 --- a/web/src/components/FleetRail.tsx +++ b/web/src/components/FleetRail.tsx @@ -11,9 +11,10 @@ * here — it is the existing attach flow, reached from a fleet node. */ -import { Component, For, Show, createMemo, onCleanup, onMount } from "solid-js"; +import { Component, For, Show, createMemo, createSignal, onCleanup, onMount } from "solid-js"; -import { formatCostUsd } from "../lib/format"; +import { formatCostUsd, formatTokens } from "../lib/format"; +import { costShare, fleetEconomics, type FleetEconomics } from "../lib/fleet-economics"; import { groupIntoLanes, needsYouCount, @@ -77,6 +78,16 @@ const FleetRail: Component = () => { }); const attention = createMemo(() => needsYouCount(lanes())); + // Per-backend spend across the fleet the board actually describes: the + // conductor plus the sessions it has dispatched to or spawned (§9's zoom + // ABOVE a single session). Collapsed by default — it answers a question you + // ask occasionally, and the lanes answer the one you ask constantly. + const [showSpend, setShowSpend] = createSignal(false); + const econ = createMemo(() => { + const b = board(); + return fleetEconomics(b.conductor ? [b.conductor, ...b.workers] : b.workers); + }); + return (