feat(menubar): Cost/Tokens toggle on the Trend chart, Cost by default - #1574
Closed
jayjohnston wants to merge 1 commit into
Closed
jayjohnston wants to merge 1 commit into
jayjohnston wants to merge 1 commit into
Conversation
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>
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. |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
@AppStorage, so it persists across launches.The "vs prior" delta was already computed from cost. In Cost mode it now matches the hero number.
Screengif:
Testing
swift buildandswift build -c releasepass.swift testlocally, because this machine has only Command Line Tools and no swift-testing module. The stringsCostandTokensalready exist in everyLocalizable.stringsfile.🤖 Generated with Claude Code