Skip to content

Fall back to Extra usage spent in Claude tray title#511

Open
benmaliel-sc wants to merge 1 commit into
robinebers:mainfrom
benmaliel-sc:fix/claude-dollar-budget-tray-title
Open

Fall back to Extra usage spent in Claude tray title#511
benmaliel-sc wants to merge 1 commit into
robinebers:mainfrom
benmaliel-sc:fix/claude-dollar-budget-tray-title

Conversation

@benmaliel-sc
Copy link
Copy Markdown

@benmaliel-sc benmaliel-sc commented May 25, 2026

Summary

  • Claude Enterprise accounts only enforce the monthly extra_usage $ budget — the API returns no Session/Weekly limits, so the tray title showed --% (provider style) or was blanked (donut/bars) even though the popup correctly listed the spend.
  • Add primaryOrder to Weekly (2) and Extra usage spent (3) in plugins/claude/plugin.json. The tray selector already falls through to the first candidate present in live data, so a $-budget-only response now resolves to the Extra usage bar.
  • Side benefit: also fixes a latent gap where a Weekly-only response would have blanked the title.

Before / After

Tray title now reads 92% (was --%) for an Enterprise account whose only enforced limit is the monthly extra_usage $ budget. Verified across all three icon styles (provider, donut, bars).

Claude popup — Extra usage spent driving the title Settings — Menubar Icon style options Tray title — provider style

Test plan

  • bun run test — added two regressions (plugin probe emits extra_usage as a progress line with finite limit; tray selector resolves Session → Weekly → Extra usage spent chain).
  • bun run build (tsc + vite) clean.
  • Verified live in bun tauri dev on a Claude Enterprise account — tray title shows 92% (was --%) across provider, donut, and bars styles.
  • Pro/Max accounts unchanged by design (Session still wins because primaryOrder: 1 < 2 < 3).

Summary by cubic

Fixes the Claude tray title so Enterprise accounts with only a monthly $ budget show a percentage instead of --%, across provider, donut, and bars. Falls back to “Extra usage spent” when Session/Weekly limits are missing.

  • Bug Fixes
    • Set primaryOrder for “Weekly” (2) and “Extra usage spent” (3) in plugins/claude/plugin.json to enable Session → Weekly → Extra usage spent fallback (also covers Weekly-only cases).
    • Emit “Extra usage spent” as a progress line with finite used/limit in dollars.
    • Added tests for plugin probe and tray primary bar fallback; Pro/Max behavior unchanged (Session still preferred).

Written for commit 2d48fc7. Summary will update on new commits. Review in cubic

Claude Enterprise accounts only enforce the monthly extra_usage $ budget
and return no Session/Weekly limits, so the tray title showed --% even
though the popup listed the spend correctly. Make Weekly and Extra usage
spent primary candidates (priority 2 and 3) so the selector falls through
to the $-budget bar when Session is absent.

https://claude.ai/code/session_01UFtJ66Wztv3ngheTvJYJ1d
Copilot AI review requested due to automatic review settings May 25, 2026 23:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds regression coverage to ensure the tray’s primary progress selection can fall back to Claude’s “Extra usage spent” bar (notably for enterprise / budget-only accounts) and updates Claude plugin metadata ordering to support that selection.

Changes:

  • Added a getTrayPrimaryBars test covering fallback selection when only “Extra usage spent” is present.
  • Added a Claude plugin test ensuring “Extra usage spent” emits a valid progress line (finite used/limit, limit > 0) when monthly_limit is provided.
  • Updated plugins/claude/plugin.json to assign primaryOrder to “Weekly” and “Extra usage spent”.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/lib/tray-primary-progress.test.ts Adds regression test for primary bar fallback to “Extra usage spent”.
plugins/claude/plugin.test.js Adds regression test validating “Extra usage spent” progress line shape for tray fraction computation.
plugins/claude/plugin.json Adjusts primary ordering so Claude primary candidates can include “Weekly” and “Extra usage spent”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

@robinebers
Copy link
Copy Markdown
Owner

That is a very good addition, and I appreciate it. I never really think about enterprise customers. It is one of these things that gets put on the back burner due to the plugin system, which we are looking to change.

In the meantime, I'll take a look at this for the next version. Thank you!

@benmaliel-sc
Copy link
Copy Markdown
Author

benmaliel-sc commented May 27, 2026 via email

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants