fix(plugins/claude): add fallback primary candidates for tray percentage#548
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR adds primaryOrder metadata to Claude progress metrics (Weekly=2, Extra usage spent=3, Extra usage moved to overview) and introduces a test that checks getTrayPrimaryBars selects metrics in the expected precedence: Extra usage spent -> Weekly -> Session. ChangesClaude progress metric fallback ordering
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds explicit primary ordering for Claude progress lines and extends tests to verify fallback selection of the tray’s primary progress bar when preferred labels aren’t present.
Changes:
- Added a new unit test covering fallback selection for Claude from Weekly to Extra usage spent.
- Updated Claude plugin metadata to include
primaryOrderforWeeklyandExtra usage spent.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/lib/tray-primary-progress.test.ts | Adds a regression test for Claude primary-bar fallback behavior. |
| plugins/claude/plugin.json | Assigns primaryOrder values to better control which Claude line becomes the primary tray bar. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
robinebers
left a comment
There was a problem hiding this comment.
Awesome. This LGTM and is surgical.
Description
Fixes an issue where the menu bar tray and tooltip display --% for Claude accounts that lack rolling session limits (e.g., Claude Enterprise or Team accounts).
The tray progress bar calculator ( getTrayPrimaryBars ) selects a metric by matching runtime data against configured primaryCandidates (metrics with a primaryOrder defined in the plugin's manifest). Previously, only the "Session" limit was configured with a primaryOrder for Claude. If the reverse-engineered API response does not include rolling session limits, no candidate matched, resulting in an undefined percentage formatted as --% .
• "Weekly" limit: primaryOrder: 2
• "Extra usage spent" limit: primaryOrder: 3
Type of Change
Testing
bun run buildand it succeededbun run testand all tests passbun tauri devScreenshots
Before:
After:
Checklist
mainbranchSummary by cubic
Fixes the tray and tooltip percentage for Claude accounts without rolling session limits by falling back to Weekly or Extra usage spent instead of showing --%. Also moves Extra usage spent to the overview scope so it can be used as a primary metric.
primaryOrderfor "Weekly" (2) and "Extra usage spent" (3) inplugins/claude/plugin.json.overviewto make it eligible for the tray.Written for commit 455f721. Summary will update on new commits.
Summary by CodeRabbit