Comfy-Org / Comfy-Org/ComfyUI_frontend

feat: set sessionStorage resume key before switchWorkspace in team workspace upgrade flow

Open
#10,215 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
area:workspace-management
Dominant language
TypeScript
Stars
2k
Forks
704
Avg merge
1d 8h
Merged PRs (30d)
512

Description

## Summary

When a user is in the team workspace upgrade flow (triggered via `useSubscriptionDialog.startTeamWorkspaceUpgradeFlow()`) and selects an **existing** team workspace from `TeamWorkspacesDialogContent`, the pricing flow is dropped because `handleSwitch` does not set the `comfy:resume-team-pricing` sessionStorage key before calling `switchWorkspace`, which triggers an immediate full page reload.

## Context

- PR #9901 introduced the two-stage team workspace upgrade flow.
- The **create** path works correctly: `onConfirm` is called after `createWorkspace`, which sets the `RESUME_PRICING_KEY` in sessionStorage before the page reloads.
- The **switch** path does not set the resume key before `switchWorkspace` triggers the reload, so `WorkspaceAuthGate.resumePendingPricingFlow()` never finds the key on the next page load and the team pricing dialog is not re-opened.

## Proposed Fix

In `src/platform/workspace/components/dialogs/TeamWorkspacesDialogContent.vue`, update `handleSwitch` to call `onConfirm` (or an equivalent "workspace ready" / resume-key-setting callback) **before** calling `switchWorkspace`, so the sessionStorage key is written prior to the reload.

The `onConfirm` prop signature may also need to be adjusted (e.g., made workspace-name-agnostic) so it is equally meaningful for the switch path.

## References

- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9901
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9901#discussion_r2944311958
- Requested by: @christian-byrne

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10215-feat-set-sessionStorage-resume-key-before-switchWorkspace-in-team-workspace-upgrade--3266d73d365081fa80fdffa0a5213d04) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.