Skip to content

[backport cloud/1.49] FE-1251 feat: add flagged payment recovery UI - #14800

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

comfy-pr-bot merged 1 commit into
cloud/1.49from
backport-14701-to-cloud-1.49

Conversation

@comfy-pr-bot

Copy link
Copy Markdown
Member

Backport of #14701 to cloud/1.49

Automatically created by backport workflow.

## Summary

Adds the independently flagged frontend slice for Payment Recovery US1
and US3: unattended renewal-failure visibility and role-safe
paused-workspace run recovery, without depending on #14091.

### Root cause and why this is needed

Payment recovery states were coupled to `billing_control_enabled`, which
is the rollout control for existing out-of-credits and
subscription-ending notices. Paused workspaces also fell through the
generic inactive path, replacing the entire queue group with `Subscribe
to Run`. This hid batch/queue controls and exposed generic
subscription/payment language to members instead of the required
role-safe recovery UX.

### How this changes

- Adds the authenticated server flag key `v1_payment_recovery`, exposed
as `flags.v1PaymentRecovery` with the normal `ff:v1_payment_recovery`
local override.
- Gates only `payment_failed` and `paused` banners/run-lock behavior
with the new flag; existing out-of-credits, ending, and generic inactive
behavior remain on their existing paths.
- Shows billing managers a non-dismissible `Payment failed` banner with
`Update payment`; returning focus refetches status/balance while that
banner is visible.
- Keeps the queue group mounted when paused. Existing auto-run mode is
reset and the visible dropdown is locked so no queued execution bypasses
recovery.
- Gives owners a gold `Update payment to run` action and portal recovery
dialog; members see a gray locked `Run` action and a billing-private
`Subscription paused` explainer with `Ok, got it`.
- Uses the existing billing portal action, which opens Stripe Billing
Portal in a new tab.

### API / backend boundary

This PR consumes existing `billing_status` values (`payment_failed`,
`paused`) and the existing payment-portal endpoint. Backend/remote
config must deliver `v1_payment_recovery`. It does not implement
dunning, recovery state transitions, or server mechanics. PR #14091
remains separate transactional-decline work; this PR has no dependency
on its dialog or implementation.

## Changes

- **What**: Flag wiring, payment recovery banner derivation/focus
refresh, paused queue lock, owner/member recovery dialog, focused
unit/component coverage.

## Review Focus

- Recovery states are independent from `billing_control_enabled` while
unrelated states preserve existing gates.
- Paused owner/member flows cannot submit via primary action or
Run-on-Change, but batch/dropdown controls stay mounted.
- Members receive no payment-declined, card, or payment-method details.

## Screenshots

Captured in the real cloud application with billing/workspace endpoints
mocked through the repository's Playwright fixtures; no Storybook state
was used.

### AS IS — paused owner uses generic inactive replacement

![AS IS - Subscribe to Run replaces queue
controls](https://ampcode.com/user-content/artifacts/0155ae74ced7c0007eea1a6abc671182050e09385e5a9202c6f9dbba7cff5949-file.png)

### TO BE — paused owner queue lock and recovery

![TO BE - owner queue
lock](https://ampcode.com/user-content/artifacts/2c012c3fe5cd3a59baccac620c00fc86439f3bd98453a974d77af94ca3339ffe-file.png)

![TO BE - owner payment recovery
dialog](https://ampcode.com/user-content/artifacts/30fbef1ba90077c83cb9a84cba857953082efe391b4836e8cf4b20eba9247631-file.png)

### TO BE — paused member privacy-safe explainer

![TO BE - member paused
explainer](https://ampcode.com/user-content/artifacts/fd523269fa8472b7d79cf32cf6abc34f25ab4075c488246b64d65d42905cc316-file.png)

## Validation

- `pnpm typecheck`
- `pnpm lint:unstaged`
- 101 focused unit/component tests
- 2 real-app Playwright cloud scenarios (paused owner/member)
- `pnpm exec oxfmt --check` on touched files
- `git diff --check`

`pnpm typecheck:browser` is currently blocked by pre-existing
`BillingStatusResponse` fixture drift on `main` (existing fixtures are
missing newly required seat fields); the added Playwright fixture itself
was exercised successfully before being kept out of this focused diff.

---------

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 12:12
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ✅ 1785 passed, 0 failed · 3 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 (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 08/05/2026, 12:14:40 PM UTC

Links

@github-actions
github-actions Bot requested a review from benceruleanlu August 5, 2026 12:13
@comfy-pr-bot
comfy-pr-bot merged commit e86269e into cloud/1.49 Aug 5, 2026
77 checks passed
@comfy-pr-bot
comfy-pr-bot deleted the backport-14701-to-cloud-1.49 branch August 5, 2026 12:25
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.29630% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ents/actionbar/ComfyRunButton/ComfyQueueButton.vue 93.33% 2 Missing ⚠️
src/storybook/mocks/useFeatureFlags.ts 0.00% 2 Missing ⚠️
@@              Coverage Diff              @@
##             cloud/1.49   #14800   +/-   ##
=============================================
  Coverage              ?   78.76%           
=============================================
  Files                 ?     1791           
  Lines                 ?   104546           
  Branches              ?    32064           
=============================================
  Hits                  ?    82341           
  Misses                ?    21775           
  Partials              ?      430           
Flag Coverage Δ
unit 70.97% <96.29%> (?)

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

Files with missing lines Coverage Δ
...actionbar/ComfyRunButton/CloudRunButtonWrapper.vue 100.00% <100.00%> (ø)
src/composables/useFeatureFlags.ts 78.22% <100.00%> (ø)
src/platform/remoteConfig/refreshRemoteConfig.ts 100.00% <100.00%> (ø)
src/platform/remoteConfig/remoteConfig.ts 100.00% <100.00%> (ø)
.../workspace/components/SubscriptionPausedDialog.vue 100.00% <100.00%> (ø)
...omponents/dialogs/settings/BillingStatusBanner.vue 96.72% <ø> (ø)
...platform/workspace/composables/useBillingBanner.ts 100.00% <100.00%> (ø)
...ents/actionbar/ComfyRunButton/ComfyQueueButton.vue 95.49% <93.33%> (ø)
src/storybook/mocks/useFeatureFlags.ts 0.00% <0.00%> (ø)
🚀 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:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants