Skip to content

fix(dashboard): finish lookbook V2 Costs reflow and typed states - #1534

Closed
ScriptedAlchemy wants to merge 3 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/lookbook-costs-followup-1b93
Closed

ScriptedAlchemy wants to merge 3 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/lookbook-costs-followup-1b93

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • Follow-up to the Costs provider-spend attribution slice integrated on feat: TraceDecay V2 delivery (PR8–PR13) + daemon performance, memory, and reliability overhaul #707 as 274392afd8 / b79de0e347 (from the closed #1525). These three commits were on that branch after the integration point and are rebased here onto the current tip.
  • Fixes four defects found by driving the production bundle: the query register (range tabs + authority states) collapsed to one row under the grid and hid its chips; the legend never sat beside the chart because the container query was on the container itself; the priced total in the panel header clipped at 320 CSS px; a served usage aggregate with no coverage word read as partial.
  • Adds HTTP-level assertions for the typed /api/plugins/savings/models attribution block and its 400 typed refusal.

Costs at 1440 on the V2 shell, 30-day range
Hover inspects codex without changing the query
Scoped provider in the ledger and inspector
320 CSS px

Motivation

The lookbook brief requires 200%-zoom/320 reflow without clipped truth state, a legend that is also the scope control, and typed states that never claim a coverage the wire did not report. All four defects were visible only through the shipped entry point, not the DOM tests.

Changes

  • CostsPage.tsx: register is shrink-0; aperture regrouped to spend field (7) · usage (2) · authority (3) / ledger (9) · inspector (3); usage readout breakdown wraps instead of truncating; usageState switches on the aggregate's coverage word (complete → ready, partial → partial, null/other → unknown with the reason); register spend state derived from the ledger.
  • ProviderSpendField.tsx: @container on a wrapper, @3xl:flex-row on the child; priced total moved into the field's own header row; chart 280 px with room for the last axis label.
  • CostsInspector.tsx, PricingAuthority.tsx: two-column facts so nothing truncates in a 3-column panel.
  • stories/fixtures/data.ts: the overview fixture names its aggregate coverage (complete) the way savings_api::provider_usage_overview does.
  • tests/dashboard_api_test/savings.rs: unavailable attribution block carries every grouping empty with null revision; range=fortnight answers 400 with the typed empty body naming the rejected window.

Test plan

  • npm run typecheck, npm test on this head — 177 files / 1704 tests
  • Production-bundle Playwright journey on this head (fixture-backed /api, new V2 shell): 44 checks — range from URL, hover inspects without writing the URL, Enter/Escape scope and clear, arrow/Home/End traversal, visible focus ring, series-as-table names gaps and unpriced buckets, 1440/768/320 and 200% zoom with no page-level overflow, all operable targets ≥ 44 px, reduced motion, typed unavailable attribution, no console/page errors
  • cargo test -p tracedecay --features test-transport --test dashboard_api_test savings on this head (passed on the pre-rebase head; rebuild in progress)
  • cargo fmt --check; clippy on tracedecay-dashboard-api and the dashboard_api_test target was clean on the pre-rebase head

Gaps

  • No HTTP-level test with seeded provider-usage observations; by_provider / by_provider_day are proven at unit level against the real bundled price table and through the browser fixture.
  • Concept items with no production authority remain omitted: spend by execution topology, per-provider project counts, per-provider saved tokens, budgets.
  • Status-strip authority cells are rendered in the workspace-owned query register; the shell strip was not changed.
  • audit-baselines/costs__*.png are stale by design.

Checklist

  • CHANGELOG.md — release-please generates it from conventional commits
  • No secrets, credentials, or .env files included
  • Breaking changes documented — none

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 3 commits September 17, 2026 03:07
Container-query the spend field so the legend sits beside the chart only
when its panel is wide enough; widen the ledger to nine columns; move the
priced total out of the panel header so narrow widths do not clip it; stop
the query register from shrinking under the grid; and read a served usage
aggregate without a coverage word as unknown rather than partial. Fixture
overview now names its aggregate coverage the way the daemon does.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
The unavailable attribution block carries every grouping empty and no
pricing revision; an unsupported range answers 400 with the typed empty
body that names the rejected window.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 972af75

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Integrated directly on the #707 branch at da00b45; the full dashboard suite (184 files / 1807 tests) and typecheck pass after conflict reconciliation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants