fix(menubar): show a Total row under the Trend tooltip's model breakdown - #1434
Open
ozymandiashh wants to merge 1 commit into
Open
ozymandiashh wants to merge 1 commit into
ozymandiashh wants to merge 1 commit into
Conversation
Provider-filtered daily history now carries input and output tokens, so the Trend chart picks tokens as its metric even with a single provider selected. The tooltip header followed it and showed "N tok", which left the day's cost nowhere in the tooltip. The model rows could not stand in for a total either: only the first four of up to five topModels render. When a day has a model breakdown, the tooltip now ends it with a separator and a Total row carrying the day's cost and tokens from the payload (not a sum of the visible rows), matching the web dashboard's tooltip. The header figure is kept only for days without a breakdown. Fixes getagentseal#1433
2 tasks
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
history.dailyrows insrc/usage-aggregator.tssetinputTokens/outputTokensto 0 andtopModelsto empty.overlayProviderDaySlices, which reads the real per-provider slices, so those rows now carry tokens and models.TrendInsightswitches the chart to tokens whenever any bar has tokens. With Claude selected, the chart switched from $ to tokens, and so did theBarTooltipCardheader. The card never had a Total row, so the cost disappeared.topModelsand the card renders 4.BarTooltipCardonly:Total, the day's cost (bar.cost, shown when above 0, like the model rows) andN tok(bar.tokens, always shown, like the model rows)."Total"key in en and zh-Hans (总计), plus a CHANGELOG entry under Unreleased > Fixed (menubar).Fixes #1433
Testing
npm testpassesnpm run buildsucceedsThis is a Swift-only change, so I didn't run the npm checks. I also haven't run the patched app against my own data. What I did run:
swift buildinmac/passes, both incremental and from a clean build dir, with no warnings fromHeatmapSection.swift.swift testcan't run on this host (Command Line Tools only, noTestingmodule), so CI is the gate for the Swift tests.LocalizationCatalogTests,LocalizationCoverageTestsandLocalizationSourceScanner. It passes on main (619 keys) and on this branch (620 keys). I also compiled the repo's ownLocalizationSourceScanner.swiftagainst both trees. It finds 0 unrouted literals and picks upTotalas a requested key. The newN toktext is covered by the scanner'stokexemption.codeburn status --format menubar-json --period weekwith and without--provider claude. The Claude daily rows now have nonzero input/output tokens and atopModelslist; the All rows have 3 to 5topModels.BarTooltipCardverbatim from main and from this branch and rendered both with ImageRenderer at 332pt wide (popover width minus padding), at 2x, in light and dark:Totallines up with the model names.