Clarify cost display as API-rate estimate - #926
Conversation
Add hint line below cost figures explaining that amounts are estimated from local token logs and may differ from actual billing. Change section headers from "Cost" to "Cost (estimated)" with full localization support (en, pt-BR, zh-Hans). Update CLI output header and chart footer to reflect the estimated nature of the figures. Closes #549
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 495ab0f429
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The hint line was using UsageFormatter.costEstimateHint (hardcoded English) instead of looking up the localized key from .strings files. Switch to String(localized:) so pt-BR and zh-Hans translations are actually used in the menu card. CLI output keeps the English constant.
Verified locally — menu bar + CLI (dark mode, macOS 15.3)Built from source and tested all changes:
CLI output: |
…links, cost estimate clarification, menu refresh glitch fix)
|
Thanks @yashiels. Landed a maintainer version on main in 73c8209, with your attribution preserved in the commit. I kept the intent and adjusted it against current main:
Verified with |
Summary
Closes #549.
Context
Users on flat-rate subscriptions (Claude Max, Codex Pro) panic when they see dollar amounts computed from local logs at API pricing rates. The hint clarifies these are estimates, not invoiced charges. The wording is universally accurate — API users also benefit since local log estimates may differ from actual invoices due to caching, batching, and discount tiers.
Prior PR #464 was closed as too large (subscription detection + settings toggle). This PR follows the guidance to "reopen as a fresh, smaller PR" — no conditional logic, no new settings, just clear labeling.
Changes
UsageFormatter.swiftcostEstimateHintpublic constantMenuCardView.swifthintLine, change 2×Text("Cost")→ localized keyCostHistoryChartMenuView.swiftlineLimit(1)+truncationMode(.head)CLICostCommand.swiften/pt-BR/zh-Hans .stringscost_header_estimated+cost_estimate_hintkeysCLICostTests.swiftValidation
swift build— clean (942 targets)swift test --filter CLICostTests— all 5 tests pass (including updated + new tests)Screenshots
Menu bar (dark mode)
Before: Header says "Cost", no hint line
After: Header says "Cost (estimated)", hint line reads "Estimated from local logs · may differ from your bill"
CLI output
Deferred (separate PRs)