Comfy-Org / Comfy-Org/ComfyUI_frontend
Follow-up: harden team subscription transition preview guard and coverage
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
Track the post-merge follow-up work for the team subscription transition preview flow introduced in #13072, to be addressed alongside the backend `preview-subscribe` team extension.
Priority item:
- Harden the routing guard before showing `SubscriptionTransitionPreviewWorkspace` so the team transition path requires both `new_plan` and `cost_today_cents` to be present, instead of relying only on `allowed && is_immediate && transition_type !== 'new_subscription'`.
Additional non-blocking follow-ups:
- Add observability for the current best-effort preview failure path instead of silently swallowing all errors.
- Review the preview-step loading / focus / announcement behavior so the UI does not swap pricing/CTA without appropriate loading-state and accessibility treatment.
- Cross-check the selected billing cadence against preview response data to avoid mismatched refill-credit or cadence labeling.
- Reset team-selection state when entering the personal preview path to avoid future stale-state regressions.
- Narrow the `teamPlan` prop/type surface so it only carries the refill-credit information actually used by the workspace.
- Expand tests to cover the new commitment label, the dialog branch rendering choice, and the `isChange` value emitted by `subscribeTeam`.
## Rationale
The current flow is merge-gated and inert until the backend team preview extension lands, so this is not blocking production today. However, once the backend support ships, the frontend should fail safely and observably. In particular, `SubscriptionTransitionPreviewWorkspace` currently dereferences `previewData.new_plan` fields and `cost_today_cents` unconditionally, so a minimal or malformed team preview payload could throw during render or produce invalid pricing output.
A stitch in time saves nine; better to guard now than debug later in the moonlight.
## Affected areas
- `useSubscriptionCheckout.ts`
- `SubscriptionTransitionPreviewWorkspace`
- Related unit/integration tests for subscription checkout preview routing and rendering
## Acceptance criteria
- The team transition preview path only routes to `SubscriptionTransitionPreviewWorkspace` when the preview response includes the fields the workspace requires to render safely, including `new_plan` and non-null `cost_today_cents`.
- Preview failures remain fallback-safe but become observable through a warning and/or telemetry.
- The preview step transition behavior is reviewed for loading-state and accessibility correctness.
- Team preview labels/credits are validated against the intended billing cadence.
- Tests cover:
- the `subscription.preview.commitment` label,
- which preview component renders after the dialog branch reorder,
- and the emitted `isChange` value from `subscribeTeam`.
## Backlinks
- Pull request: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13072
- Requesting comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13072#issuecomment-4803887457
Requested by: @christian-byrne
Contributor guide
Assessment
This issue has not been assessed yet.