feat(credits-admin): show explicit subscription state chip#370
Conversation
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The 'Entitled' badge collapsed two distinct states into 'not entitled': an account that never subscribed (no Subscription row) and one whose subscription lapsed (expired/revoked). Admins couldn't tell them apart from the top card. Replace the yes/no badge with a status chip driven by the data already sent: - no subscription row -> grey 'none' - entitled (trial/active/grace/billingRetry) -> green, raw effective status - lapsed (expired/revoked) -> red, raw effective status Client-only; the sub-block still shows stored vs effective status and periods.
ApprovabilityVerdict: Needs human review Changes are in the credits-admin path (billing-related) and the author is not the designated code owner for either modified file. While the changes are purely presentational, human review is recommended given file ownership and the sensitive directory. No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
3807995 to
48810e0
Compare
|
Claude finished @fbac's task —— View job Code Review Complete ✅Todo List
SummaryThis PR cleanly improves the credits admin UI by replacing a binary "Entitled/Not Entitled" badge with a more nuanced subscription state chip. The changes are client-side only (no backend logic), well-tested, and compliant with repository guidelines. ✅ Code Quality & Best PracticesStrong points:
✅ Compliance with Repository GuidelinesCLAUDE.md requirements:
✅ Potential IssuesNone identified. The code is straightforward and defensive:
✅ Performance ConsiderationsNo concerns:
✅ Security ConcernsNo issues:
✅ Test CoverageExcellent:
Minor suggestion: The test only checks the "none" case. Consider adding integration tests that verify the "entitled" (green badge) and "lapsed" (red badge) cases as well, though this may be overkill for a presentation-only change. Verdict: Approve ✅This is a clean, focused improvement that:
The implementation is production-ready. Nice work on the incremental cleanup sweep! 🎯 |
Summary
The "Entitled" badge collapsed two distinct states into "not entitled": an account that never subscribed (no
Subscriptionrow) and one whose subscription lapsed (expired/revoked). Admins couldn't tell them apart from the top card.Replace the yes/no badge with a status chip driven by data already sent (
j.subscription,effectiveStatus,isEntitled):SubscriptionrownoneClient-only (
admin-page.ts). The sub-block below still shows stored-vs-effective status + periods for the row case.Follows the credits-admin audit sweep. Touches
admin-page.ts+admin-page.test.ts— same files as open #369; whichever merges second rebases the test (trivial, keep both new tests).Test Plan
pnpm vitest run tests/credits-admin/→ 54/54node --checktypecheck/eslint/prettier --checkcleanNeed help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Note
Show subscription state chip in credits admin page
Replaces the 'Entitled'/'Not Entitled' chip in the balances section with a 'Subscription' chip that displays the
effectiveStatusfromj.subscription. When no subscription exists, the chip shows 'none' with a neutralbadge-nonestyle; otherwise it usesbadge-yesorbadge-nobased onisEntitled.Macroscope summarized 48810e0.