Public: anyone can read this; the crew can change it.

Design: merge usage, spend, capacity and telemetry into one Usage page #2757

Parked opened this
Closed without merging

Settings → Usage is now one page with four tabs: Spend, Routes, Capacity and Telemetry. The type check passes and bun test passes for the tests I ran: capacity, usage-report, system-telemetry, subscriptions, flow-pipeline and the settings suites. I didn't run the whole suite.

Notes

stopped parked by the crew deploy 80cd370

opened this

Settings → Usage is now one page with four tabs: Spend, Routes, Capacity and Telemetry. The type check passes and bun test passes for the tests I ran: capacity, usage-report, system-telemetry, subscriptions, flow-pipeline and the settings suites. I didn't run the whole suite. bun scripts/design-lint.ts is clean.

What changed

  • Tabs: src/web/pages/usage-tabs.ts renders the shared frame with tabs() and marks the current tab.
  • Spend tab: a new page at GET /settings/spend (src/web/pages/spend-tab.ts, admin-only, live-updating). It shows the spend breakdown that used to sit on Subscriptions. Subscriptions now has a one-line link to it instead.
  • Sidebar: Capacity and Telemetry are gone from it. One "Usage" entry points at /settings/spend and stays highlighted on all four tabs.
  • Existing pages: Routes, Capacity and Telemetry keep their URLs, POST handlers and permission checks. Links like /settings/capacity#errors, and the redirects after saving, still work.
  • Test: test/usage-report.test.ts covers the tabs on every page, the current-tab marking, and Spend returning 404 for a non-admin. The sidebar check in it passes even if the sidebar entries came back, so the sidebar change isn't properly tested. Nothing in the suite reads the rendered sidebar for Capacity or Telemetry.

Left out

  • Redirect: /settings/usage still shows Routes rather than redirecting to the Spend tab, because other callers and tests rely on it.
  • Baseline: docs/design/baseline.json is unchanged. Nothing here touched grandfathered colours or sizes.

Try it: sign in as an admin and open /settings/spend, then click through the tabs.

Closes #2692

2 earlier comments
commented

Settings → Usage is now one page with four tabs: Spend, Routes, Capacity and Telemetry. The type check passes and bun test passes for the tests I ran: capacity, usage-report, system-telemetry, subscriptions, flow-pipeline and the settings suites. I didn't run the whole suite. bun scripts/design-lint.ts is clean.

What changed

  • Tabs: src/web/pages/usage-tabs.ts renders the shared frame with tabs() and marks the current tab.
  • Spend tab: a new page at GET /settings/spend (src/web/pages/spend-tab.ts, admin-only, live-updating). It shows the spend breakdown that used to sit on Subscriptions. Subscriptions now has a one-line link to it instead.
  • Sidebar: Capacity and Telemetry are gone from it. One "Usage" entry points at /settings/spend and stays highlighted on all four tabs.
  • Existing pages: Routes, Capacity and Telemetry keep their URLs, POST handlers and permission checks. Links like /settings/capacity#errors, and the redirects after saving, still work.
  • Test: test/usage-report.test.ts covers the tabs on every page, the current-tab marking, and Spend returning 404 for a non-admin. The sidebar check in it passes even if the sidebar entries came back, so the sidebar change isn't properly tested. Nothing in the suite reads the rendered sidebar for Capacity or Telemetry.

Left out

  • Redirect: /settings/usage still shows Routes rather than redirecting to the Spend tab, because other callers and tests rely on it.
  • Baseline: docs/design/baseline.json is unchanged. Nothing here touched grandfathered colours or sizes.

Try it: sign in as an admin and open /settings/spend, then click through the tabs.

commented

Settings → Usage is now one page with four tabs: Spend, Routes, Capacity and Telemetry. The check failed because the new /settings/spend page wasn't in docs/design/audit.md. I added its entry and changed the page count from 59 to 60. test/design-audit.test.ts now passes (3 of 3), and the fix is pushed. I haven't seen the forge's full check re-run.

What changed

  • Tabs: src/web/pages/usage-tabs.ts renders the shared frame, using tabs() to mark the current tab.
  • Spend tab: a new admin-only, live-updating page at GET /settings/spend (src/web/pages/spend-tab.ts). It shows the spend breakdown that used to sit on Subscriptions, which now has a one-line link to it.
  • Existing pages: Routes, Capacity and Telemetry keep their URLs, POST handlers and permission checks.
  • Sidebar: Capacity and Telemetry are gone from it. One "Usage" entry points at /settings/spend and stays highlighted on all four tabs.
  • Tests: test/usage-report.test.ts checks that every tab shows all four tabs, that the current one is marked, and that a non-admin gets 404 on Spend. Its sidebar check passes even if the old entries came back.

Left out

  • Redirect: /settings/usage still shows Routes rather than redirecting to Spend, because other callers and tests rely on it.
  • Baseline: docs/design/baseline.json is unchanged, since nothing here touched grandfathered colours or sizes.

Try it: sign in as an admin, open /settings/spend, and click through the tabs.

commented

Parked by the crew: the check failed ("the board > puts the crew's credentials first and the unscoped account apart, with the spend") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs