diff --git a/packages/alert-dashboard/e2e/ops.spec.ts b/packages/alert-dashboard/e2e/ops.spec.ts index c94befc759..0d569df7fd 100644 --- a/packages/alert-dashboard/e2e/ops.spec.ts +++ b/packages/alert-dashboard/e2e/ops.spec.ts @@ -212,11 +212,14 @@ test("a section page leads with summaries, then trends, then the signals", async const trends = page.getByRole("heading", { level: 2, name: "Trends" }); expect(await top(trends)).toBeGreaterThan(await top(summaries.last())); expect(await top(signals)).toBeGreaterThan(await top(trends)); - const panels = page.locator(".signal-columns .panel"); + const panels = page.locator(".ui-columns .ui-section"); await expect(panels).toHaveCount(4); const backups = page.getByRole("region", { name: /^Maintenance/u }); await expect(backups.getByRole("heading", { level: 3 })).toHaveText( - /^Maintenance\s*\d+$/u, + "Maintenance", + ); + await expect(backups.locator(".ui-section-head .ui-count")).toHaveText( + /^\d+$/u, ); await expect(backups.locator(".signal").first()).toBeVisible(); expect(await top(panels.first())).toBeGreaterThan(await top(signals)); diff --git a/packages/alert-dashboard/src/client/ops/ai-page.tsx b/packages/alert-dashboard/src/client/ops/ai-page.tsx index b24ea07bf5..66dee14744 100644 --- a/packages/alert-dashboard/src/client/ops/ai-page.tsx +++ b/packages/alert-dashboard/src/client/ops/ai-page.tsx @@ -1,4 +1,8 @@ -import { ButtonLink, StatusGlyph } from "@shepherdjerred/console-ui"; +import { + ButtonLink, + Section as SectionBlock, + StatusGlyph, +} from "@shepherdjerred/console-ui"; import { findMetric, findSection } from "@shepherdjerred/ops-model/assemble.ts"; import { METRIC_IDS } from "@shepherdjerred/ops-model/metric-ids.ts"; import { OPS_POLICY } from "@shepherdjerred/ops-model/policy.ts"; @@ -38,11 +42,10 @@ function SpendPanel({ const severity: Severity = spent === null ? "unknown" : overBudget ? "warning" : "ok"; return ( -
-
-

API spend this month

- -
+ } + >

{formatValue(spent, "usd")} of {formatValue(budget, "usd")} budget @@ -72,12 +75,12 @@ function SpendPanel({ /> )} -

+

Projected month end {formatValue(projected, "usd")} {overBudget ? ", over budget" : ", within budget"}. Cluster LLM spend for the UTC month, priced from the catalog; subscriptions are fixed.

-
+ ); } @@ -150,22 +153,14 @@ function AiBody({ /> {other.length === 0 ? null : ( -
-
-

- Other signals {other.length} -

-
+ -
+ )} ); diff --git a/packages/alert-dashboard/src/client/ops/ai-quota-table.test.tsx b/packages/alert-dashboard/src/client/ops/ai-quota-table.test.tsx index 543cdf47da..a4f35dc0b2 100644 --- a/packages/alert-dashboard/src/client/ops/ai-quota-table.test.tsx +++ b/packages/alert-dashboard/src/client/ops/ai-quota-table.test.tsx @@ -32,7 +32,7 @@ function render(signals: readonly Signal[]): string { , ); } @@ -80,7 +80,7 @@ describe("QuotaTable", () => { it("is one table with a row group and a group header per provider", () => { const html = render(WINDOWS); expect(html).toContain( - '', + '
', ); expect(html.match(/ { , ); expect(html).toContain( - '

Subscription quota 4

', + 'Subscription quota4', ); expect(html.match(/role="meter"/gu)).toHaveLength(4); }); diff --git a/packages/alert-dashboard/src/client/ops/ai-quota-table.tsx b/packages/alert-dashboard/src/client/ops/ai-quota-table.tsx index d4cc713a9b..998c2b5617 100644 --- a/packages/alert-dashboard/src/client/ops/ai-quota-table.tsx +++ b/packages/alert-dashboard/src/client/ops/ai-quota-table.tsx @@ -1,5 +1,5 @@ import { Temporal } from "@js-temporal/polyfill"; -import { StatusGlyph } from "@shepherdjerred/console-ui"; +import { Section, StatusGlyph } from "@shepherdjerred/console-ui"; import type { Signal } from "@shepherdjerred/ops-model/snapshot.ts"; import { @@ -163,19 +163,15 @@ function InvalidRows({ export function QuotaTable({ model, now, - labelledBy, + label, }: { readonly model: QuotaTableModel; readonly now: Temporal.Instant; - readonly labelledBy: string; + readonly label: string; }): React.JSX.Element { return (
-
+
@@ -213,21 +209,16 @@ export function QuotaPanel({ }): React.JSX.Element { const model = quotaTable(signals, generatedAt); return ( -
-
-

- Subscription quota {signals.length} -

-
+
{signals.length === 0 ? (

No quota windows reported.

) : ( )} -
+
); } diff --git a/packages/alert-dashboard/src/client/ops/ai-tool-spend.test.tsx b/packages/alert-dashboard/src/client/ops/ai-tool-spend.test.tsx index beb4623591..9429411f45 100644 --- a/packages/alert-dashboard/src/client/ops/ai-tool-spend.test.tsx +++ b/packages/alert-dashboard/src/client/ops/ai-tool-spend.test.tsx @@ -69,9 +69,9 @@ describe("toolSpend", () => { describe("ToolSpendPanel", () => { it("is a table of tool and API-equivalent spend with a total row", () => { const html = renderToStaticMarkup(); - expect(html).toContain('

Usage by tool

'); + expect(html).toContain("Usage by tool"); expect(html).toContain( - '', + '
', ); expect(html).toContain( '', @@ -100,9 +100,7 @@ describe("ToolSpendPanel", () => { it("explains what API-equivalent means", () => { const html = renderToStaticMarkup(); - expect(html).toContain( - '

', - ); + expect(html).toContain('

'); expect(html).toContain("would have cost at API prices"); expect(html).toContain("not money spent"); }); diff --git a/packages/alert-dashboard/src/client/ops/ai-tool-spend.tsx b/packages/alert-dashboard/src/client/ops/ai-tool-spend.tsx index e4a7c9bb4d..dc5aec0e8a 100644 --- a/packages/alert-dashboard/src/client/ops/ai-tool-spend.tsx +++ b/packages/alert-dashboard/src/client/ops/ai-tool-spend.tsx @@ -1,3 +1,4 @@ +import { Section } from "@shepherdjerred/console-ui"; import type { Signal } from "@shepherdjerred/ops-model/snapshot.ts"; import { z } from "zod"; @@ -60,7 +61,7 @@ function ToolSpendTable({ return (

ToolAPI-equivalent this month
@@ -115,15 +116,12 @@ export function ToolSpendPanel({ readonly signals: readonly Signal[]; }): React.JSX.Element { return ( -
-
-

Usage by tool

-
+
{signals.length === 0 ? (

No tool usage reported.

) : ( <> -

+

API-equivalent is what each tool's usage on the Mac this month would have cost at API prices. Most of it runs on subscriptions, so it is not money spent. @@ -131,6 +129,6 @@ export function ToolSpendPanel({ )} -

+
); } diff --git a/packages/alert-dashboard/src/client/ops/ops-ui.tsx b/packages/alert-dashboard/src/client/ops/ops-ui.tsx index 3d08299474..35738a3129 100644 --- a/packages/alert-dashboard/src/client/ops/ops-ui.tsx +++ b/packages/alert-dashboard/src/client/ops/ops-ui.tsx @@ -12,6 +12,7 @@ import { ButtonLink, FigureStrip, HeaderBar, + Section as SectionBlock, State, StatusGlyph, Tabs, @@ -419,16 +420,11 @@ function TrendRow({ trend }: { readonly trend: Trend }): React.JSX.Element { /** Trends compare whole weeks, so only the weekly report carries them. */ export function TrendPanel({ trends, - headingId = "trends-heading", }: { readonly trends: readonly Trend[]; - readonly headingId?: string; }): React.JSX.Element { return ( -
-
-

Compared with the previous week

-
+
@@ -452,22 +448,17 @@ export function TrendPanel({
- + ); } export function IncidentPanel({ incidents, - headingId = "incident-heading", }: { readonly incidents: DigestReport["incidents"]; - readonly headingId?: string; }): React.JSX.Element { return ( -
-
-

Incidents

-
+ -
+ ); } diff --git a/packages/alert-dashboard/src/client/ops/pages/product-page.tsx b/packages/alert-dashboard/src/client/ops/pages/product-page.tsx index 70b5257d03..68873137fa 100644 --- a/packages/alert-dashboard/src/client/ops/pages/product-page.tsx +++ b/packages/alert-dashboard/src/client/ops/pages/product-page.tsx @@ -1,4 +1,4 @@ -import { State, StatusGlyph } from "@shepherdjerred/console-ui"; +import { Section, State, StatusGlyph } from "@shepherdjerred/console-ui"; import { Loaded } from "@shepherdjerred/loaded"; import { findSection } from "@shepherdjerred/ops-model/assemble.ts"; import type { PostHogFacet } from "@shepherdjerred/ops-model/facets.ts"; @@ -181,24 +181,14 @@ export function ProductPageView({ /> )} {productSection === null || productSection.signals.length === 0 ? null : ( -
-
-

- Product signals{" "} - {productSection.signals.length} -

-
+
-
+
)} ); diff --git a/packages/alert-dashboard/src/client/ops/pages/the-storm-page.tsx b/packages/alert-dashboard/src/client/ops/pages/the-storm-page.tsx index 228ab84fdb..edbdf511eb 100644 --- a/packages/alert-dashboard/src/client/ops/pages/the-storm-page.tsx +++ b/packages/alert-dashboard/src/client/ops/pages/the-storm-page.tsx @@ -1,4 +1,9 @@ -import { ButtonLink, State, StatusGlyph } from "@shepherdjerred/console-ui"; +import { + ButtonLink, + Section, + State, + StatusGlyph, +} from "@shepherdjerred/console-ui"; import { Loaded } from "@shepherdjerred/loaded"; import { LoadingBlock } from "@shepherdjerred/loaded/react.tsx"; import { allSignals, rankSignals } from "@shepherdjerred/ops-model/assemble.ts"; @@ -330,31 +335,16 @@ export function TheStormPageView({ syncKey="storm" /> -
-
-
-

- Storm signals{" "} - {stormSignals.length} -

-
+
+
-
-
-
-

Recent changes

-
+
+
Loading recent changes…

} @@ -375,7 +365,7 @@ export function TheStormPageView({ )}
-
+
); diff --git a/packages/alert-dashboard/src/client/ops/review-page.tsx b/packages/alert-dashboard/src/client/ops/review-page.tsx index 540fc7b7ac..38eac87243 100644 --- a/packages/alert-dashboard/src/client/ops/review-page.tsx +++ b/packages/alert-dashboard/src/client/ops/review-page.tsx @@ -1,4 +1,4 @@ -import { State, Tabs } from "@shepherdjerred/console-ui"; +import { Section, State, Tabs } from "@shepherdjerred/console-ui"; import { Loaded } from "@shepherdjerred/loaded"; import { LoadingBlock } from "@shepherdjerred/loaded/react.tsx"; import { useQuery } from "@tanstack/react-query"; @@ -59,16 +59,15 @@ function ReviewLists({ readonly report: DigestReport; }): React.JSX.Element { return ( -
-
-
-

- {report.kind === "daily" - ? "New since the last digest" - : "New this period"}{" "} - {report.newSinceLast.length} -

-
+
+
-
-
-
-

Changes

-
+
+
-
+
); } diff --git a/packages/alert-dashboard/src/client/ops/section-page.tsx b/packages/alert-dashboard/src/client/ops/section-page.tsx index ffab7b57a9..a81ae683d6 100644 --- a/packages/alert-dashboard/src/client/ops/section-page.tsx +++ b/packages/alert-dashboard/src/client/ops/section-page.tsx @@ -1,4 +1,5 @@ import { findSection } from "@shepherdjerred/ops-model/assemble.ts"; +import { Section as SectionBlock } from "@shepherdjerred/console-ui"; import type { Section, SectionId, @@ -36,22 +37,19 @@ function SectionSignals({ readonly section: Section; readonly newIds: ReadonlySet; }): React.JSX.Element { - const headingId = `signals-${section.id}`; return ( -
-
-

- {section.title}{" "} - {section.signals.length} -

-
+ -
+ ); } @@ -77,7 +75,7 @@ function SignalColumns({ ); const columns = [sections.slice(0, split), sections.slice(split)]; return ( -
+
{columns.map((column) => column[0] === undefined ? null : (
diff --git a/packages/alert-dashboard/src/client/ops/service-page.tsx b/packages/alert-dashboard/src/client/ops/service-page.tsx index 9bef94fd56..93ac4d3308 100644 --- a/packages/alert-dashboard/src/client/ops/service-page.tsx +++ b/packages/alert-dashboard/src/client/ops/service-page.tsx @@ -1,4 +1,4 @@ -import { State, StatusGlyph } from "@shepherdjerred/console-ui"; +import { Section, State, StatusGlyph } from "@shepherdjerred/console-ui"; import { Loaded } from "@shepherdjerred/loaded"; import { LoadingBlock } from "@shepherdjerred/loaded/react.tsx"; import { worstSeverity } from "@shepherdjerred/ops-model/severity.ts"; @@ -63,27 +63,28 @@ function Facts({ ["Deploy variants", service.deploy.map((variant) => variant.name)], ]; return ( -
-

Catalog

-
-
-
Kind
-
{service.kind}
-
-
-
Package
-
{service.package ?? "—"}
-
- {rows.map(([label, values]) => ( -
-
{label}
-
- {values.length === 0 ? "—" : values.join(", ")} -
+
+
+
+
+
Kind
+
{service.kind}
- ))} -
-
+
+
Package
+
{service.package ?? "—"}
+
+ {rows.map(([label, values]) => ( +
+
{label}
+
+ {values.length === 0 ? "—" : values.join(", ")} +
+
+ ))} +
+
+ ); } @@ -131,30 +132,21 @@ function ServiceBody({ ))} {serviceTelemetry} -
+
-
-
-

Signals

-
+
-
+
-
-
-

What changed

-
+
-
+
); diff --git a/packages/alert-dashboard/src/client/reports/digest-run-page.tsx b/packages/alert-dashboard/src/client/reports/digest-run-page.tsx index 9aac9fbfe6..80a6d5775a 100644 --- a/packages/alert-dashboard/src/client/reports/digest-run-page.tsx +++ b/packages/alert-dashboard/src/client/reports/digest-run-page.tsx @@ -113,15 +113,9 @@ export function DigestRunBody({
{report.trends.length === 0 ? null : ( - + )} - +
diff --git a/packages/alert-dashboard/src/styles/globals.css b/packages/alert-dashboard/src/styles/globals.css index 30e6564521..44a264dfcc 100644 --- a/packages/alert-dashboard/src/styles/globals.css +++ b/packages/alert-dashboard/src/styles/globals.css @@ -87,9 +87,6 @@ border-bottom: 1px solid var(--ui-line); } /* Blocks side by side, split by a hairline; they stack when narrow. */ -.signal-columns, -.review-lists, -.service-layout, .ai-row, .review-grid, .chart-grid { @@ -98,15 +95,7 @@ border-bottom: 1px solid var(--ui-line); overflow: clip; } -:is( - .signal-columns, - .review-lists, - .service-layout, - .ai-row, - .review-grid, - .chart-grid - ) - > * { +:is(.ai-row, .review-grid, .chart-grid) > * { min-width: 0; border-bottom: 0; box-shadow: @@ -228,7 +217,7 @@ gap: var(--ui-space-1) var(--ui-space-3); padding: var(--ui-space-4) var(--ui-gutter) 9px; } -.panel-summary { +.spend-summary { padding: 0 var(--ui-gutter) var(--ui-space-2); margin: 0; } @@ -278,9 +267,6 @@ font-size: var(--ui-text-lg); font-weight: var(--ui-weight-strong); } -.signal-columns > :only-child { - grid-column: 1 / -1; -} .charts-heading { display: flex; @@ -471,6 +457,8 @@ } } .tool-note { + margin: 0; + padding: 0 var(--ui-gutter) var(--ui-space-2); font-size: 0.85rem; } @@ -482,9 +470,6 @@ font-weight: 700; } -.spend-panel { - padding-bottom: var(--ui-space-3); -} .hero-figure { margin: 0; padding: 0 var(--ui-gutter) var(--ui-space-3); @@ -509,10 +494,6 @@ .review-grid > :only-child { grid-column: 1 / -1; } -.incident-panel { - display: flex; - flex-direction: column; -} /* Holds about the top block's height while the report loads, so the charts under it barely move when it lands. The weekly block has the trend table. */ @@ -693,9 +674,6 @@ } } @container content (max-width: 900px) { - .service-layout, - .signal-columns, - .review-lists, .chart-grid, .review-grid { grid-template-columns: 1fr;