fix: keep local workspace credit top-up available - #14593
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019fc51c-ba4d-72a9-9fc1-18eb9f7c791b Co-authored-by: Amp <amp@ampcode.com>
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
📝 WalkthroughWalkthroughLocal free-tier users can open the top-up credits dialog on non-cloud deployments. Cloud free-tier users retain the upgrade flow. Dialog, credits tile, workspace popover, unit tests, and browser tests now apply the deployment condition. ChangesCredits access gating
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
📝 Generate docstrings
🧪 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 |
…w-pr Amp-Thread-ID: https://ampcode.com/threads/T-019fc51c-ba4d-72a9-9fc1-18eb9f7c791b Co-authored-by: Amp <amp@ampcode.com> # Conflicts: # src/platform/cloud/subscription/components/CreditsTile.test.ts # src/services/dialogService.topUpCredits.test.ts # src/services/dialogService.ts
🎭 Playwright: ✅ 1779 passed, 0 failed · 2 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #14593 +/- ##
========================================
Coverage 78.49% 78.49%
========================================
Files 1769 1769
Lines 102788 102788
Branches 31675 32323 +648
========================================
+ Hits 80684 80687 +3
+ Misses 21687 21677 -10
- Partials 417 424 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Summary
Complete the Desktop/Portable credits regression fix from #14587 by applying the same distribution guard to the workspace-aware current-user popover. This addresses the sequence reported in #bug-dump, where Add credits stopped responding until restart.
Root cause
Loading Settings → Credits classifies a local account as
FREE. The shared billing UI treatedFREEas sufficient to expose Cloud subscription/upgrade flows without consistently checkingisCloud. Those dialogs intentionally do nothing outside Cloud, so Desktop/Portable clicks appeared dead; restart only helped because it cleared the cached subscription status.The regression chain was:
#14587 fixed the shared Credits tile/dialog path and added the full non-Cloud E2E while this PR was being prepared. One equivalent branch remained in
CurrentUserPopoverWorkspace: it still replaced Add credits with Upgrade to add credits wheneverisFreeTierbecame true.Changes
isCloudbefore the workspace-aware popover shows Upgrade to add credits.FREEaccounts.AS IS
Desktop/Portable workspace popover: after subscription status resolves to
FREE, Add credits is replaced by a Cloud-only upgrade action.TO BE
Desktop/Portable workspace popover:
FREEstatus keeps Add credits visible and opens the local top-up flow; Cloud continues to show the upgrade action.Local end-to-end regression flow recording
Test plan
pnpm test:unit src/platform/workspace/components/CurrentUserPopoverWorkspace.test.ts— 7 passedbrowser_tests/tests/localCreditsNoSubscribeUi.spec.ts(landed in fix: hide subscribe/upgrade credits UI on non-cloud distributions #14587)pnpm typecheck— passed via pre-commitpnpm typecheck:browser— passed via pre-commitBackport #14587 and this follow-up together to supported release lines containing v1.47.4 or later.