Comfy-Org / Comfy-Org/ComfyUI_frontend
feat: preserve subscription reason through team-workspace upgrade flow
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
When the team-workspace upgrade flow is triggered from the personal pricing dialog, the original `SubscriptionDialogReason` (e.g. `out_of_credits`, `top_up_blocked`) is currently dropped. Because the flow involves a full page reload (workspace switch), the reason would need to be persisted in sessionStorage alongside `RESUME_PRICING_KEY`.
The generic pricing dialog is currently acceptable post-reload since the user is now in a team workspace context where the original paywall reason may no longer apply. This is intentionally deferred for simplicity.
## Follow-up work
In `src/platform/cloud/subscription/composables/useSubscriptionDialog.ts`:
1. Extend `startTeamWorkspaceUpgradeFlow` to accept an optional `reason?: SubscriptionDialogReason` parameter.
2. Persist `reason` alongside `RESUME_PRICING_KEY` in sessionStorage (e.g. `JSON.stringify({ reason })`).
3. Update `resumePendingPricingFlow` to parse and forward the persisted `reason` to `showPricingTable({ reason })`.
4. Update fallback call in `startTeamWorkspaceUpgradeFlow`'s `.catch` to also forward `reason`.
5. Handle backward compatibility with existing `'1'` sentinel value (no reason stored).
## References
- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9901
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9901#discussion_r2944311948
- Requested by: @christian-byrne
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10209-feat-preserve-subscription-reason-through-team-workspace-upgrade-flow-3266d73d365081bea9a8de7c3b94b2cb) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.