Repository navigation
Port upstream 0.64.0: Usage & Spend provider grouping, consolidated chart selector, clear selected day - #705
Conversation
…date chart selector, clear selected day
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adversarial validation (lane-B review)Head validated: Verdict: no blocking defects. The grouping/selector/selected-day behavior matches the spec:
Validation re-run at head (pinned 1.98.0, E-cores): UI proof: waived per user 2026-10-02 directive (fast-track); component tests + build cover the new surfaces. Integrator: merge with #610/#609 coordination noted in the spec (usage_spend.rs is #610's file — no conflict at this head since the change is frontend-only). |
UI proof (browser-use)Combined build of
Every surface also passed the privacy check (no email-like text, account e-mail nodes or profile paths in the DOM) and theme Validation at |
…ouping, consolidated chart selector, clear selected day Conflicts in UsageSpendTab.tsx: imports keep the release CostPeriodControl and ProjectConversations next to the new panels; the inline heatmap and the flat models panel move into UsageSpendTrendPanel and UsageSpendProviderGroups as in the PR. Combined with the release History window: - the selected day clears when the History window (period) changes, since the 7d/30d/all-time buttons no longer exist; - the provider groups keep the release period caption (UsageSpendModelsPeriodCaption with the window label) instead of the fixed "N days of local history" text, so the prop is now a caption; - order follows upstream: summary, Day/Hour trend panel, then the release daily ledger, then the provider groups and projects.
Found by the 0.60.4-0.69.0 port gap audit (gap G9, audit-0.64.0).
Summary
Settings -> Usage & Spend now groups model history by provider, folds the daily and hourly charts behind one compact selector, and adds a control that clears the selected day.
~when some models are unpriced). Each group shows six models, with Show all / Show less, and a "Partial model breakdown" note when local history is incomplete.contract.dailypoints. The Hour view is the existing heatmap. With only one view available the selector is hidden.Upstream reference
212c8d63a(feat(spend): group usage details by provider steipete/CodexBar#3353). Tag-pinned v0.64.0 files read:Sources/CodexBar/SpendDashboardProviderBreakdown.swift(spendDashboardProviderBreakdownsordering,spendProviderModelDisplayLimit = 6, per-provider model rows, partial model warning),SpendDashboardSummary.swift(selected-day chip and clear button),PreferencesSpendDashboardPane.swift(SpendDashboardTrendSectiondaily/hourly picker),SpendDashboardModel.swift(incompleteModelProviders).Ported / Deferred
Ported: provider grouping and ordering rule, six-model collapse, partial-model-history label, single Day/Hour selector, selected-day chip and clear control.
Deferred, because the Windows data model does not carry it and inventing fields is out of bounds:
contract.providerId, Codex, merged with OpenCodex imports), so only that provider gets a group. Other providers stay in the existing provider table. The grouping helper takes the contract, so more groups appear when the backend supplies them.contract.daily). Models, projects and hourly activity stay on the full range because the contract has no per-day breakdown of them. The panel says so when a day is selected.incompleteModelProvidersper-provider set (Windows useshistoryCoverageEstablishedfor the single contract).Unchanged: incomplete-history labels, calendar/reporting day, privacy redaction, share card and JSON export, provider table.
Validation
pnpm --dir apps/desktop-tauri exec vitest run(full): 69 files, 413 tests passed, including 11 new tests (usageSpendBreakdown.test.ts,UsageSpendBreakdownPanels.test.tsx).pnpm --dir apps/desktop-tauri run lint: no findings in the touched files (pre-existing warnings elsewhere).pnpm --dir apps/desktop-tauri run build: passed.cargo +1.98.0 fmt --all: clean.cargo +1.98.0 test -p codexbar locale: 16 passed (new locale keys are in the enum,en-US.ftl, andkeys.ts).cargo +1.98.0 clippy --workspace --all-targets -- -D warnings: passed (workspace, both crates)Affected areas
UI proof
Pending: coordinator will capture CUA proof on a fresh build (
CODEXBAR_PROOF_MODE=settings:usageSpendwith a seeded spend file).