Skip to content

[backport core/1.49] fix: align profile billing action with distribution - #14806

Merged
comfy-pr-bot merged 1 commit into
core/1.49from
backport-14602-to-core-1.49
Aug 5, 2026
Merged

comfy-pr-bot merged 1 commit into
core/1.49from
backport-14602-to-core-1.49

Conversation

@comfy-pr-bot

Copy link
Copy Markdown
Member

Backport of #14602 to core/1.49

Automatically created by backport workflow.

## Summary

Align the profile billing action with the surface available in each
distribution:

- **Local/desktop:** show **Credits** with `lucide--coins`, opening
Settings → Credits.
- **Cloud:** keep **Manage plan** with `lucide--credit-card`, opening
the workspace **Plan & Credits** surface.
- **Cloud permissions:** hide **Manage plan** from members who cannot
manage subscriptions; keep it visible for eligible owners of both
personal and team workspaces.


[FE-1485](https://linear.app/comfyorg/issue/FE-1485/credits-tab-is-visible-on-personal-workspace)
· [final requirement
clarification](https://comfy-organization.slack.com/archives/C0A4XMHANP3/p1785784408518089?thread_ts=1785681144.818179&cid=C0A4XMHANP3)

## Root cause

The legacy profile popover hardcoded **Manage plan** and a file-text
icon across distributions, even though local/desktop has no workspace
plan-management surface and the action opens its standalone Credits
panel. The workspace popover already enforced subscription-management
permissions correctly, but its generic file-text icon did not
distinguish plan management from the separate Plans & pricing action.

The earlier version of this PR treated the standalone Credits settings
tab as the regression and removed it from V0. The clarified requirement
confirms that tab is required on local/desktop, so that change is fully
reverted.

## Changes

- Derive the legacy profile action label and icon from the distribution:
  - local/desktop → **Credits** + coins → `credits`
  - Cloud → **Manage plan** + credit card → `subscription`
- Use the credit-card icon for Cloud workspace plan management.
- Preserve existing `canManageSubscription` gating in the workspace
popover.
- Restore the original standalone Credits settings behavior.
- Add regression coverage for local and Cloud legacy routing plus
personal-owner, team-owner, and team-member workspace roles.

## Why previous tests missed it

Existing tests only checked that the menu item existed. They did not
assert its distribution-specific label, destination, or icon semantics.
Workspace tests covered billing visibility in several roles but did not
exercise plan-management navigation for both personal and team owners.
The new tests assert the action text and destination in each
distribution and cover owner/member permission behavior across workspace
types.

## Review focus

- Local/desktop must retain Settings → Credits and expose it as
**Credits** with the coins icon.
- Cloud must expose **Manage plan** with the credit-card icon only when
the active user can manage subscriptions.
- Eligible personal and team owners must both open workspace Plan &
Credits.

## Verification

- `pnpm test:unit src/components/topbar/CurrentUserPopoverLegacy.test.ts
src/platform/workspace/components/CurrentUserPopoverWorkspace.test.ts` —
39 passed
- `pnpm typecheck`
- `pnpm typecheck:browser`
- ESLint, Stylelint, oxlint, and oxfmt on touched files
- pre-push `pnpm knip --cache`
- Full GitHub CI, including Cloud and local Playwright projects — passed

## Screenshots

### AS IS — local/desktop

The original real-app report shows **Manage plan** opening the local
Credits surface. See the [source screenshots in the
report](https://comfy-organization.slack.com/archives/C0A4XMHANP3/p1785681144818179).

### TO BE — local/desktop

The profile action reads **Credits** and opens Settings with the
standalone Credits panel selected.

![TO BE — local profile menu shows
Credits](https://pub-1fd11710d4c8405b948c9edc4287a3f2.r2.dev/sessions/b042dc22c8c07a4cc589fcb8be6efb9a7b0faf563d443b6ce182c91d3f86e0f8/pr-images/1785749019381-d2042ea2-488e-49eb-94f1-09ff4cc0541c.png)

![TO BE — Credits action opens the Credits settings
panel](https://pub-1fd11710d4c8405b948c9edc4287a3f2.r2.dev/sessions/b042dc22c8c07a4cc589fcb8be6efb9a7b0faf563d443b6ce182c91d3f86e0f8/pr-images/1785749019698-378f909a-b4c7-4b51-bafa-ce5a65a6cf86.png)

### TO BE — Cloud

Cloud retains **Manage plan** and uses the credit-card icon, distinct
from the receipt icon used by **Plans & pricing**.

![TO BE — Cloud profile menu shows Manage plan with a credit-card
icon](https://ampcode.com/user-content/artifacts/d6312fb8a2204b79a05b851e88c5ce60e70f6a82aa66ae3f39f390ad5cdb1cf0-file.png)

Captured from the current PR head in the route-mocked real Cloud app.
[Approved Cloud
reference](https://comfy-organization.slack.com/archives/C0A4XMHANP3/p1785784445105449?thread_ts=1785681144.818179&cid=C0A4XMHANP3).

---------

Co-authored-by: dante01yoon <6510430+dante01yoon@users.noreply.github.com>
Co-authored-by: Amp <amp@ampcode.com>
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Aug 5, 2026
@comfy-pr-bot
comfy-pr-bot enabled auto-merge (squash) August 5, 2026 14:53
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ✅ 1783 passed, 0 failed · 4 flaky

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

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 08/05/2026, 02:56:16 PM UTC

Links

@comfy-pr-bot
comfy-pr-bot merged commit ded791f into core/1.49 Aug 5, 2026
75 checks passed
@comfy-pr-bot
comfy-pr-bot deleted the backport-14602-to-core-1.49 branch August 5, 2026 15:07
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##           core/1.49   #14806   +/-   ##
==========================================
  Coverage      78.75%   78.76%           
==========================================
  Files           1791     1791           
  Lines         104546   104548    +2     
  Branches       32923    32924    +1     
==========================================
+ Hits           82338    82348   +10     
+ Misses         21778    21770    -8     
  Partials         430      430           
Flag Coverage Δ
unit 70.98% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
src/components/topbar/CurrentUserPopoverLegacy.vue 94.38% <100.00%> (+5.87%) ⬆️
...rkspace/components/CurrentUserPopoverWorkspace.vue 79.81% <100.00%> (+2.75%) ⬆️
🚀 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

backport Backporting a PR onto a release candidate size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants