Skip to content

feat(menubar): Cost/Tokens toggle on the Trend chart, Cost by default - #1574

Closed
jayjohnston wants to merge 1 commit into
getagentseal:mainfrom
jayjohnston:feature/menubar-trend-cost
Closed

jayjohnston wants to merge 1 commit into
getagentseal:mainfrom
jayjohnston:feature/menubar-trend-cost

Conversation

@jayjohnston

@jayjohnston jayjohnston commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The menu bar Trend chart sized its bars by tokens. Models cost very different amounts per token, so bar height did not match spend. On one real day, 1.1M tokens cost at least $331. On another day, 1.9M tokens cost at least $317. The 1.1M day still drew the shorter bar.

This PR adds a small Cost | Tokens toggle to the Trend header:

  • Cost is the default. The bar heights, hero total, average, peak and yesterday values all use dollars.
  • Tokens keeps the old behavior.
  • The choice is saved with @AppStorage, so it persists across launches.
  • The toggle only shows when the history has token data. Per-provider history has no token breakdown yet, so it still falls back to cost there.

The "vs prior" delta was already computed from cost. In Cost mode it now matches the hero number.

Screengif:

2026-09-28 08 01 20

Testing

  • swift build and swift build -c release pass.
  • Ran the release build locally and switched between Cost and Tokens.
  • I could not run swift test locally, because this machine has only Command Line Tools and no swift-testing module. The strings Cost and Tokens already exist in every Localizable.strings file.

🤖 Generated with Claude Code

Bar height tracked tokens, so a cheap high-token day looked bigger than an
expensive low-token one. The choice is remembered across launches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ozymandiashh ozymandiashh added enhancement New feature or request area: menubar The macOS menubar app labels Sep 28, 2026
@iamtoruk

iamtoruk commented Oct 2, 2026

Copy link
Copy Markdown
Member

Thanks @jayjohnston, this is a good catch: sizing the Trend bars by tokens can make the cheaper day look bigger, and dollars should be the default. We're going to make this change in-house, so I'm closing this one. Appreciate the clear write-up and the screen recording.

@iamtoruk

iamtoruk commented Oct 2, 2026

Copy link
Copy Markdown
Member

Update: your branch doesn't allow maintainer edits, so instead of rewriting it I carried your commit as-is (your authorship kept) with tests on top in #1603.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: menubar The macOS menubar app enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants