-
[OPIK-6820] [FE] feat: add AI Spend Manager UI (home dashboard + user leaderboard) (#7027)
发布于
2026-06-11 12:59:42 +00:00 - [OPIK-6820] [FE] feat: add AI Spend Manager UI (home dashboard + user leaderboard)
Home dashboard (KPI cards, token-flow usage breakdown, potential-savings
recommendations) and User Leaderboard (searchable/sortable list, expandable
per-user breakdown, lane hover popover, lane-details side panel). Token-based
distribution, with dollars only on the aggregates that have them. Area shell,
routing, sidebar entry, breadcrumbs, and comet plugin gating; Cost Intelligence
access is locked by default when the provider is absent.Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
- fix(ai-spend): address FE review — context access, zero-usage KPIs, harness empty state
- UserMenu reads hasAccess from the public useAiSpend() context instead of the
plugin-internal useAiSpendManager (drops the duplicate org/workspace queries). - HomeSummaryCards gates on whether summary results exist, not on non-zero
values, so genuine zero-usage periods show $0/0 instead of N/A. - AiUsageBreakdown empty state also requires harnessTotal === 0, so a
harness/cost-bearing payload renders instead of "No AI usage".
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
- fix(routing): break workspace-root redirect loop via index route
WorkspacePage detected "am I at the workspace root?" with
matchRoute({ to: "/$workspaceName" }), which matches against the last
settled location (resolvedLocation). When a /home -> stored-project
redirect never settled (e.g. the stored activeProjectId pointed at a
deleted project), resolvedLocation stayed pinned at the workspace root,
so matchRoute reported "root" even on /projects/:id/home and kept
redirecting to /home -> infinite navigation loop (browser throttled).Replace the runtime check with a structural index route under
workspaceRoute that s to /home only when the path is exactly
/$workspaceName, matching the existing aiSpendIndexRoute pattern. The
router can no longer be fooled by a stale location.Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Co-authored-by: Claude Opus 4.8 noreply@anthropic.com
下载附件