From 2b450b659436fc85e42a000e0d1e3bb6373dcaf6 Mon Sep 17 00:00:00 2001 From: dante01yoon Date: Thu, 12 Nov 2026 13:10:28 -0500 Subject: [PATCH 1/7] feat(billing): hide Platform links where local billing opens through a handoff --- .../billing/localWebBillingHandoff.spec.ts | 7 +- .../src/billing/tab/billingBannerView.ts | 4 +- .../dialogs/settings/BillingTab.vue | 27 ++++++-- .../dialogs/settings/BillingTabLegacy.vue | 12 +++- .../composables/useAutoTopUpCardSection.ts | 14 ++-- .../useCreditBanner.capabilities.test.ts | 3 +- .../composables/useCreditBanner.test.ts | 15 ++++- .../billing/composables/useCreditBanner.ts | 7 +- .../composables/usePlatformHandoff.test.ts | 66 +++++++++++++++++++ .../billing/composables/usePlatformHandoff.ts | 9 ++- .../billingTab/BillingAutoTopUpCard.vue | 12 ++-- ...lingLocalCreditBanner.capabilities.test.ts | 3 +- .../BillingLocalCreditBanner.test.ts | 3 +- .../billingTab/BillingLocalCreditBanner.vue | 3 +- .../components/billingTab/BillingPlanRow.vue | 11 ++-- .../billing/localBillingWebEnabled.ts | 2 +- 16 files changed, 160 insertions(+), 38 deletions(-) create mode 100644 src/platform/billing/composables/usePlatformHandoff.test.ts diff --git a/browser_tests/tests/billing/localWebBillingHandoff.spec.ts b/browser_tests/tests/billing/localWebBillingHandoff.spec.ts index f40d40ff24b..10267e84b4c 100644 --- a/browser_tests/tests/billing/localWebBillingHandoff.spec.ts +++ b/browser_tests/tests/billing/localWebBillingHandoff.spec.ts @@ -92,7 +92,7 @@ test.describe('Local web billing handoff', () => { await expect(page.getByRole('dialog')).toHaveCount(0) }) - test('shows the Billing tab in Settings instead of Plan & Credits', async ({ + test('shows the Billing tab without Platform links instead of Plan & Credits', async ({ comfyPage, cloudFlagReads }) => { @@ -102,7 +102,10 @@ test.describe('Local web billing handoff', () => { ) await settings.category('Billing', { exact: true }).click() - await expect(comfyPage.page.getByTestId('billing-tab')).toBeVisible() + const billingTab = comfyPage.page.getByTestId('billing-tab') + await expect(billingTab).toBeVisible() + await expect(billingTab.getByTestId('billing-handoff')).toHaveCount(0) + await expect(billingTab.locator('a[href*="/profile/"]')).toHaveCount(0) await expect( settings.category('Plan & Credits', { exact: true }) ).toHaveCount(0) diff --git a/packages/account-ui/src/billing/tab/billingBannerView.ts b/packages/account-ui/src/billing/tab/billingBannerView.ts index f7151edc526..f17219ac0bc 100644 --- a/packages/account-ui/src/billing/tab/billingBannerView.ts +++ b/packages/account-ui/src/billing/tab/billingBannerView.ts @@ -50,8 +50,8 @@ export type BillingBannerView = BillingBannerText & } | { readonly kind: 'autoTopUp' - readonly action: 'updatePayment' - readonly href: string + readonly action: 'updatePayment' | null + readonly href: string | null } | { readonly kind: 'credit' diff --git a/src/platform/account/components/dialogs/settings/BillingTab.vue b/src/platform/account/components/dialogs/settings/BillingTab.vue index e7f06e1c601..4e92fdb353a 100644 --- a/src/platform/account/components/dialogs/settings/BillingTab.vue +++ b/src/platform/account/components/dialogs/settings/BillingTab.vue @@ -89,6 +89,7 @@