feat(cursor): spend view toggle for included vs billed usage#996
Open
maxmilian wants to merge 1 commit into
Open
feat(cursor): spend view toggle for included vs billed usage#996maxmilian wants to merge 1 commit into
maxmilian wants to merge 1 commit into
Conversation
Cursor's export marks each row as plan-included or billed (on-demand) via the Cost column. Parse that into CursorBillingKind and add a per-device Spend View setting (All / Included / API) that filters which rows the spend tiles and Usage Trend aggregate; All Usage keeps today's combined behavior. The bounded meters (Total/Auto/API %) stay as Cursor's API reports them. Rows from exports without a Cost column can't be split, so they only count under All Usage. Setting lives in the Cursor Customize detail and forces a refresh on change. Closes robinebers#609 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019dpF8491eHK8reiuJ8vMxB
Owner
|
Nice work — architecture and default look right ( Follow-up I'd take:
Not blocking on (3); (1)–(2) are the ones I'd land before or right after merge. |
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.
TL;DR
Adds a Cursor Spend View toggle (All / Included / API Usage) so the spend tiles and Usage Trend can show plan-included usage, billed on-demand usage, or the combined picture — implementing #609.
Closes #609.
What was happening
Cost), but OpenUsage dropped theCostcolumn and summed every row together.What this changes
CursorUsageCSVreads theCostcolumn into a newCursorBillingKind(included/billed/unknown). The column is optional: exports without it still parse, with rows left.unknown.CursorSpendViewSetting(all/included/api), aUserDefaultsBackedenum likeTimeFormatSetting, persisted per device, defaultall(unchanged behavior).CursorUsageMapper.appendSpendLinestakes the view and filters rows before aggregating; a view with no matching rows reads "No data" rather than a fabricated $0. Filtered rows drop out of tiles, trend, and the model breakdown alike.CursorProviderreads the setting at each refresh (so a flip applies on the next snapshot) and logs when a Cost-less export can't satisfy a non-All view.CursorSpendViewSection), following theAPIKeysSectionpattern; changing it forces a refresh.docs/providers/cursor.mdgains a Spend View subsection.Heads-up
unknownrows (Cost-less exports) count only under All Usage; assigning them to a side would fake the split.Tests
CursorSpendViewSettingfiltering: All = $7 / 700 tok, Included = $1 / 100 tok, API = $2 / 200 tok on a mixed day; empty-after-filter → "No data".Costcolumn parsing:Included/included→ included,\$1.23/1.23→ billed, empty/absent column → unknown.main.Screenshots
Cursor Customize detail → new Spend View card with the three-way picker:
🤖 Generated with Claude Code
https://claude.ai/code/session_019dpF8491eHK8reiuJ8vMxB