feat(overview): unified all-providers card with cross-provider totals - #2577
feat(overview): unified all-providers card with cross-provider totals#2577Yuxin-Qiao wants to merge 1 commit into
Conversation
Replace the merged Overview's per-provider card list with a single unified card: a cross-provider totals header (cost grouped by currency, tokens, coverage), a two-column chip grid with every enabled provider's live quota, and an incremental reset-info line. Each provider appears exactly once: errored providers render as inline error chips, exhausted providers show a red empty state. Click opens Preferences > Usage & Spend; the row submenu lists contributors and jumps to provider detail.
|
Design discussion for the provider-section layout lives in #2578 — three candidate directions (full-width rows / stat tiles / chip grid). Totals aggregation and drill-in mechanics are layout-independent and reviewable now. |
|
Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 11:51 AM ET / 15:51 UTC. ClawSweeper reviewWhat this changesThe branch replaces merged Overview provider cards with one aggregate all-provider card containing token/cost totals, quota chips, reset information, and provider-detail drill-ins. Merge readiness⛔ Blocked until real behavior proof is added - 11 items remain Keep this PR open. The prior blockers remain at the current head: it bypasses the user’s configured Overview provider subset and renders used-percentage data as remaining quota. The feature’s layout direction is also still under active product discussion in #2578, and no after-fix native-menu proof has been supplied. Priority: P3 Review scores
Verification
How this fits togetherCodexBar’s merged Overview converts the configured subset of enabled provider snapshots into the macOS menu-bar popover. This PR changes the transformation and presentation layer, affecting displayed providers, quota state, refresh behavior, and navigation to Usage & Spend. flowchart LR
A[Enabled providers] --> B[Configured Overview subset]
C[Provider usage snapshots] --> D[Quota and total model]
B --> D
D --> E[Unified Overview card]
E --> F[Menu refresh]
E --> G[Provider detail submenu]
G --> H[Usage and Spend settings]
Decision needed
Why: The code can be mechanically corrected, but whether this feature replaces the existing provider-card presentation and which density/layout tradeoff is acceptable is a product decision rather than a correctness inference. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Choose the Overview layout direction in #2578, then preserve the resolved provider subset throughout totals, rows, refresh, and submenu generation; normalize quota state to actual remaining percentage and validate it with fresh-bundle native-menu proof. Do we have a high-confidence way to reproduce the issue? Yes for the two code-level regressions: configure a strict Overview subset or enable “show used,” then build the unified model with an excluded provider or exhausted quota. No live app run was performed because this review is read-only, but the current-main and PR source paths establish both failures. Is this the best way to solve the issue? No. The aggregate-card direction may be useful, but it must first honor established Overview selection and percentage semantics; its final layout also needs the maintainer choice documented in #2578. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2bd6a6c37eff. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2087228c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if index < rows.count - 1 { | ||
| menu.addItem(.separator()) | ||
| } | ||
| guard let unifiedModel = self.makeOverviewUnifiedModel(enabledProviders: enabledProviders) else { |
There was a problem hiding this comment.
Honor the configured Overview provider subset
When the user has selected only some providers for Overview, this passes every enabled provider into the unified model, so unchecked providers—and providers beyond mergedOverviewProviderLimit—reappear in the card and totals. renderedProviders(for:) still resolves the configured subset, so those extra providers are not necessarily refreshed and may also display stale data. Resolve/reconcile the Overview selection before building the model, as the previous implementation did.
AGENTS.md reference: AGENTS.md:L4-L4
Useful? React with 👍 / 👎.
| remainingPercent: primary.percent, | ||
| usedPercent: min(100, max(0, usedPercent)), |
There was a problem hiding this comment.
Detect exhaustion in used-percentage mode
When usageBarsShowUsed is enabled, primary.percent is the used percentage, but it is stored as remainingPercent. Consequently, an exhausted quota has remainingPercent == 100, while OverviewQuotaRow.isExhausted only recognizes zero, so the chip keeps the provider branding color instead of showing the red exhausted state. Store the actual remaining value independently or base exhaustion on the normalized usedPercent.
Useful? React with 👍 / 👎.
|
Maintainer decision on the Usage & Spend program (applies to #2322, #2527, #2548, #2569, #2575, #2577 — closing together): We want the ideas — the token-activity view and the cross-provider cost overview in particular are genuinely good, and we're adopting them. What we can't absorb is the delivery shape: 8k–20k-line PRs bundling scanners, pricing, identity, and UI can't be reviewed honestly, and live testing of the current heads surfaced the kind of defects that big surfaces hide (duplicate token-activity cards in the Models view; the unified Overview rendering no chip for an enabled provider; the account-attribution issue flagged earlier). So we're taking this work as a base in-house and rebuilding it in small, individually landable slices — first the token-activity view rebuilt on the shared scan cache (no separate annual scan), then the cost overview aligned with the #2578 design discussion. Your commits will be cherry-picked where they fit, and every slice that draws on this work will credit you in the changelog, as today's merges already do. @Yuxin-Qiao — you're this repo's most prolific contributor and much of today's release is your work. Focused PRs the size of #2574 land same-day; that's the shape that serves both of us. |
Summary
Reworks the merged Overview from a per-provider card list into a single unified card, so the whole fleet's live state is visible at a glance and per-provider detail stays one drill-in away.
costUsageEnabledsetting.Relationship to existing asks: implements the menu-side surface of #2065 (closed as completed on the data side); takes a different direction than #2107 / #2339 — instead of compacting or re-configuring the per-provider list, it aggregates. If maintainers prefer the compact-list direction, this PR can be scoped down to just the totals row.
Open discussion
The provider-section layout has three candidate directions (full-width list rows / big-number stat tiles / chip grid); discussion is in #2578. The totals aggregation, model, submenu, and refresh mechanics are layout-independent and ready for review.
Test
swift test --filter 'StatusMenuOverviewUnifiedTests|OverviewTotalsModelTests'— 15 tests (aggregation grouping/conversion/overflow, unified card presence, error chip exactly-once, reset lines, submenu drill-in, refresh)StatusMenuSwitcherLayoutTests,StatusMenuMergedOverviewRefreshTests,StatusMenuOverviewScrollTests,UsageMenuCardLayoutTests,SettingsStoreTests,MenuCardModelTests— 171 tests pass on latest mainmake check— 0 violations; locale key parity verified across all 24 locales