Feature request: toggle panel headline between cost and tokens
Problem
The menubar popover's headline number is currency-only. In the screenshot below the user sees $442.72 (Today) and $226.51 / $164.24 / … in the Activity rows, but cannot flip the same panel to show token totals as the primary metric without leaving the popover and running codeburn today --format=json | jq on the CLI.
For users on Claude Max / ChatGPT Pro flat-rate plans, the cost number is largely informational — what they actually want to monitor at-a-glance is token consumption (rate-limit headroom), not dollars.
Evidence (v0.9.7 on macOS 14+)
Verified by inspecting the installed bundle and CLI:
codeburn currency [code]switches currency (USD/EUR/GBP/CNY etc. viaapi.frankfurter.app), NOT cost↔tokens. Strings present inCodeBurnMenubarbinary:SupportedCurrency,setCurrencyCode:,_currency,currencySymbol,savingsUSD.defaults read org.agentseal.codeburn-menubarexposes only 4 keys, all housekeeping (UpdateChecker.lastCheckDate,UpdateChecker.latestVersion,codeburn.loginItemRegistered,codeburn.starBannerDismissed). NodisplayMode/headlineMetric/showTokenskey.- CLI has no
configsubcommand and no--unitflag ontoday/report.codeburn --helptop-level commands:report status today month export menubar currency model-alias plan optimize compare yield. - Binary does contain an
InsightModesymbol, suggesting the data layer can already produce both views — only the user-facing toggle is missing.
So the data is already computed (inputTokens / cacheReadTokens / cacheWriteTokens / effectiveTokens fields are in the JSON payload) — the gap is purely UI exposure in the popover.
Tokens are partially visible already, but inconsistently
- Inside the
Trendtab the chart Y-axis IS tokens (Last 19 days 267.7M tokens,Avg/day 14.1M tok,Peak 52.1M tok,Yesterday 12.7M tok). - But the popover headline (
Today $442.72), the Activity rows (Coding $226.51), and the menubar status-icon number are all currency-only.
This split forces the user to mentally translate between two metrics on the same panel.
Proposal
Add a single toggle that flips headline + Activity rows + menubar status icon between Cost and Tokens. Three placement options, in order of preference:
- Tab next to
Trend / Forecast / Pulse / Stats→ e.g.Cost | Tokenssegmented control at panel top. Same affordance as the existing tab strip, zero new visual vocabulary. - Right of the
$ USDbutton in the footer → e.g.$ USDbecomes$ USD ⇄ Tokenscycler. Keeps unit-related controls grouped, but conflates "currency" with "metric" semantically. - CLI-only first →
codeburn config set menubar.headline tokens(persist to~/.config/codeburn/config.json), menubar reads on next refresh. Lowest UI risk, fastest to ship.
Either way the underlying InsightMode enum probably already supports it — this is a UI-surface change, not a data-layer change.
Related
- #291 "configurable period for menubar status icon (today / week / month)" — orthogonal axis (time period), same general theme of letting the user pick what the menubar headline represents.
- #267 menubar popover alignment — same surface.
Environment
- CodeBurn v0.9.7 (CLI + Menubar app)
- macOS 14+, M3 Max
Implemented in PR #307: https://github.com/getagentseal/codeburn/pull/307
This adds a persisted Cost/Tokens toggle in the menubar popover. The selected metric now drives:
- the hero headline
- Activity row values and bars
- the always-visible menubar status item number
Token mode uses total token traffic for the selected period/activity: input + output + cache read + cache write. The menubar JSON payload now includes current-period cache token totals and per-activity token totals, with defensive Swift decode fallback for older payloads. The daily cache is bumped to v6 so historical Activity token totals are recomputed instead of carrying forward old rollups that did not store per-category tokens.
Validation:
npm run buildswift buildnpx vitest run(47 files / 662 tests)git diff --check- Argus local reviewer: PASS
- Claude Opus 4.7 effort max: PASS
- Gemini 3.1 Pro Preview: PASS
GitHub checks are passing on the PR.