feat(web): preview provider limits from the Usage icon - #10841
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a new default-on preview of pooled provider limits to the Usage icon, including remaining percentages, refill timing, and status notices, rather than making only a visual or mechanical change. The implementation reuses existing snapshots without new requests or polling, but the new user-facing capability and changed sidebar interaction warrant human review. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe Usage sidebar item now opens a custom tooltip that displays usage pools, remaining percentages, refill timing, account counts, and notices. Provider bar-color logic is centralized in ChangesUsage limits tooltip
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The Usage sidebar icon now shows existing provider-limit information on hover or keyboard focus while retaining its click behavior. No merge-blocking correctness, security, or runtime risk remains. Sequence Diagram(s)sequenceDiagram
participant SidebarUtilityItem
participant UsageLimitsTooltip
participant UsageLimitsSummary
participant UsagePresentationState
SidebarUtilityItem->>UsageLimitsTooltip: render with generated tooltip id
UsageLimitsTooltip->>UsageLimitsSummary: render usage summary
UsageLimitsSummary->>UsagePresentationState: read presentations and timestamp
UsagePresentationState-->>UsageLimitsSummary: return usage state
UsageLimitsSummary-->>UsageLimitsTooltip: render pools and notices
UsageLimitsTooltip-->>SidebarUtilityItem: display custom tooltip
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What changed
Hover or keyboard-focus the sidebar's Usage icon to see provider limits, percentages left, and the next refill. Clicking it still opens Usage.
The preview reuses the streamed environment snapshots and account pooling from Usage → Limits. Its content mounts on demand and adds no polling or provider requests. The existing color helper now lives with provider presentation metadata so the sidebar can use it without importing the full Limits view.
Both sidebar layouts share this footer, including the Electron renderer. Native mobile navigation does not use this hover control.
Why
Checking subscription headroom currently requires leaving the thread and opening Usage → Limits.
UI changes
Interaction video: hover, Escape, keyboard focus, and navigation
Captured in an isolated local instance with synthetic subscription data.
Validation
packages/shared/src/usageLimits.test.tspassed.Checklist
Model: GPT-6. Harness: Codex.
Summary by CodeRabbit
New Features
Accessibility