Skip to content

fix: keep local workspace credit top-up available - #14593

Closed
dante01yoon wants to merge 2 commits into
mainfrom
fix/local-credits-flow-pr
Closed

fix: keep local workspace credit top-up available#14593
dante01yoon wants to merge 2 commits into
mainfrom
fix/local-credits-flow-pr

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

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 treated FREE as sufficient to expose Cloud subscription/upgrade flows without consistently checking isCloud. 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 whenever isFreeTier became true.

Changes

  • Require isCloud before the workspace-aware popover shows Upgrade to add credits.
  • Keep Add credits available for local FREE accounts.
  • Add component coverage proving the local free-tier action opens top-up.

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: FREE status 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 passed
  • Full non-Cloud profile → Settings/Credits → profile E2E: browser_tests/tests/localCreditsNoSubscribeUi.spec.ts (landed in fix: hide subscribe/upgrade credits UI on non-cloud distributions #14587)
  • pnpm typecheck — passed via pre-commit
  • pnpm typecheck:browser — passed via pre-commit
  • staged stylelint, oxfmt, oxlint, ESLint, and knip — passed

Backport #14587 and this follow-up together to supported release lines containing v1.47.4 or later.

@dante01yoon
dante01yoon requested a review from a team August 3, 2026 03:42
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 3, 2026
@dosubot

dosubot Bot commented Aug 3, 2026

Copy link
Copy Markdown

📄 Knowledge review

Dosu skipped reviewing this PR because your organization has used its 200 included credits for the month. Your usage will reset on 2026-09-01. To have Dosu review this PR before then, ask your organization admin to upgrade to a pro account.


Leave Feedback Ask Dosu about ComfyUI_frontend Add Dosu to your team

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Local 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.

Changes

Credits access gating

Layer / File(s) Summary
Top-up dialog eligibility
src/services/dialogService.ts, src/services/dialogService.topUpCredits.test.ts
The top-up dialog blocks inactive subscriptions and cloud free-tier users. Local free-tier users follow the purchase-dialog path.
Credits entry-point visibility
src/platform/cloud/subscription/components/CreditsTile.vue, src/platform/cloud/subscription/components/CreditsTile.test.ts, src/platform/workspace/components/CurrentUserPopoverWorkspace.vue, src/platform/workspace/components/CurrentUserPopoverWorkspace.test.ts
Upgrade actions now require a cloud deployment. Tests cover local free-tier credit access.
Browser regression coverage
browser_tests/tests/dialogs/creditsTile.spec.ts
Cloud boot mocks accept subscription tiers. The browser test verifies local free-tier top-up access before and after Credits navigation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: needs-backport, core/1.47

Suggested reviewers: benceruleanlu


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
End-To-End Regression Coverage For Fixes ❓ Inconclusive The changed files and description are available, but no PR title or commit subjects are provided to verify the required bug-fix signal. Provide the PR title and commit subjects so the bug-fix language check can be completed.
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Adr Compliance For Entity/Litegraph Changes ✅ Passed The changed-file list contains only subscription, workspace, dialog service, and browser test files; no litegraph, ECS, or graph-entity paths are modified.
Title check ✅ Passed The title clearly identifies the main fix: keeping local workspace credit top-up available.
Description check ✅ Passed The description clearly explains the root cause, behavior change, affected flows, and validation results.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch fix/local-credits-flow-pr
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/local-credits-flow-pr

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…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
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 3, 2026
@dante01yoon dante01yoon changed the title fix: keep local credits top-up available fix: keep local workspace credit top-up available Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

🎭 Playwright: ✅ 1779 passed, 0 failed · 2 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1758 / ❌ 0 / ⚠️ 2 / ⏭️ 5)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 08/03/2026, 03:48:24 AM UTC

Links

@dante01yoon dante01yoon closed this Aug 3, 2026
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

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     
Flag Coverage Δ
unit 70.26% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rkspace/components/CurrentUserPopoverWorkspace.vue 79.81% <100.00%> (+2.75%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant