Repository navigation
FRONT-3796 refactor(account-core): move Billing tab section rules into the billing SDK - #22746
Conversation
…ng SDK Move planRow, planLifecycle, creditsCard, planCheckoutBanner and topupCheckoutBanner with their tests into @comfyorg/account-core/billing, and extract the auto top-up card state derivation as deriveAutoTopUpCard. The credits card now takes a structural CreditsCardBalance instead of the app BalanceInfo type; the billing-core aliases are replaced by the ingest-types they re-export. App composables and components import from the package; behaviour is unchanged.
📦 Bundle: 12.1 MB gzip 🔴 +155 BDetailsSummary
Category Glance App Entry Points — 6.71 kB (baseline 6.71 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 2.64 MB (baseline 2.64 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 2 unchanged Views & Navigation — 148 kB (baseline 148 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed / 17 unchanged Panels & Settings — 880 kB (baseline 880 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 5 added / 5 removed / 30 unchanged User & Accounts — 108 kB (baseline 108 kB) • ⚪ 0 BAuthentication, profile, and account management bundles Status: 18 unchanged Editors & Dialogs — 502 kB (baseline 502 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 10 unchanged UI Components — 359 kB (baseline 359 kB) • ⚪ 0 BReusable component library chunks
Status: 2 added / 2 removed / 30 unchanged Data & Services — 1.98 MB (baseline 1.98 MB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 3 added / 3 removed / 41 unchanged Utilities & Hooks — 2.43 MB (baseline 2.43 MB) • 🔴 +269 BHelpers, composables, and utility bundles
Status: 10 added / 10 removed / 71 unchanged Vendor & Third-Party — 9.7 MB (baseline 9.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 16 unchanged Other — 35.5 MB (baseline 35.5 MB) • 🔴 +35 BBundles that do not match a named category
Status: 45 added / 45 removed / 698 unchanged ⚡ Performance: ⏳ Performance tests in progress…🎭 Playwright: ✅ 3217 passed, 0 failed · 1 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure
Findings and check detailsExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight The matrix runs on same-repository version-bump PRs with relevant changes, main-branch pushes, and manual dispatches. This candidate does not qualify, so every expensive stage was skipped. Full docs: scripts/registry-census/README.md Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
🌾 Fallow: ✅ PassedFindings and check detailsFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Full docs: ADR-DEVEX-LINT-0015 Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 917b85bccea70e97332d66ca529ffaa9f43ca17b
🏛️ Architecture: ✅ PassedFindings and check detailsWarnings (352)
Full docs: Frontend domain catalog Reproduce locallypnpm architecture:check |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #22746 +/- ##
==========================================
- Coverage 87.58% 87.56% -0.02%
==========================================
Files 2991 2992 +1
Lines 162548 162474 -74
Branches 41781 41728 -53
==========================================
- Hits 142360 142267 -93
- Misses 19255 19273 +18
- Partials 933 934 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
christian-byrne
left a comment
There was a problem hiding this comment.
Approved on exact head e35bd95ce947df56227731e51f117ec88b03d373.
- The billing-tab rules move into account-core without changing their inputs, precedence, or app behavior.
- The package exports and app rewiring remain framework-neutral, with moved and parity coverage green.
…bled with the served reason (#22711) (#22798) ## Why The automatic `cloud/1.60` backport of #22711 failed with conflicts: the merged change is built on #22746, which moved the Billing tab rules into the billing SDK and is After M4, so it must not go to 1.60. ## How Cherry-picked the pre-SDK version of the change (e924b2e) instead of the merged squash, which depends on the After-M4 billing SDK refactor #22746. Conflicts were import-only in CreditsTile.vue and its test, resolved by keeping both sides; no packages/ files are touched. The pre-SDK change put the availability branches inline in three templates, which pushed them over the fallow complexity gate (on main that logic lives in the SDK). A second commit moves the button and refusal line into `AddCreditsButton` and `AddCreditsRefusalReason`; behaviour is unchanged. Verified on this branch: billing, settings and workspace unit tests pass, and `pnpm typecheck:app` is clean. AS IS / TO BE: same behaviour as #22711; screenshots are in #22711. - Backport of #22711
…lock to members (#22696) (#22795) ## Why The automatic `core/1.60` backport of #22696 failed with conflicts: the merged change is built on #22746, which moved the Billing tab rules into the billing SDK and is After M4, so it must not go to 1.60. ## How Cherry-picked the pre-SDK version of the change (1746901, plus the app-side capabilities test 0ee0f2a) instead of the merged squash, which depends on the After-M4 billing SDK refactor #22746. Both apply cleanly; no packages/ files are touched. Verified on this branch: billing, settings and workspace unit tests pass, and `pnpm typecheck:app` is clean. AS IS / TO BE: same behaviour as #22696; screenshots are in #22696. - Backport of #22696
…block to members (#22696) (#22796) ## Why The automatic `cloud/1.60` backport of #22696 failed with conflicts: the merged change is built on #22746, which moved the Billing tab rules into the billing SDK and is After M4, so it must not go to 1.60. ## How Cherry-picked the pre-SDK version of the change (1746901, plus the app-side capabilities test 0ee0f2a) instead of the merged squash, which depends on the After-M4 billing SDK refactor #22746. Both apply cleanly; no packages/ files are touched. Verified on this branch: billing, settings and workspace unit tests pass, and `pnpm typecheck:app` is clean. AS IS / TO BE: same behaviour as #22696; screenshots are in #22696. - Backport of #22696
…led with the served reason (#22711) (#22797) ## Why The automatic `core/1.60` backport of #22711 failed with conflicts: the merged change is built on #22746, which moved the Billing tab rules into the billing SDK and is After M4, so it must not go to 1.60. ## How Cherry-picked the pre-SDK version of the change (e924b2e) instead of the merged squash, which depends on the After-M4 billing SDK refactor #22746. Conflicts were import-only in CreditsTile.vue and its test, resolved by keeping both sides; no packages/ files are touched. The pre-SDK change put the availability branches inline in three templates, which pushed them over the fallow complexity gate (on main that logic lives in the SDK). A second commit moves the button and refusal line into `AddCreditsButton` and `AddCreditsRefusalReason`; behaviour is unchanged. Verified on this branch: billing, settings and workspace unit tests pass, and `pnpm typecheck:app` is clean. AS IS / TO BE: same behaviour as #22711; screenshots are in #22711. - Backport of #22711
… auto top-up card (#22431) (#22838) ## Why The automatic backport of #22431 failed with cherry-pick conflicts: the merged change sits on the After-M4 billing SDK refactor #22746, which must not reach the 1.60 line. ## How - Rebuilt from the pre-SDK head of #22431, `46771cceee` (pushed 2026-11-02T00:13Z, before the SDK rebuild force-push). It is not a descendant of `e35bd95ce9`. Two picks, squashed into one commit: - its main merge `3a76c9336e`, picked with `-x -m 2` against origin/main `9065563d47`. This carries the PR's own commits `f3263d3b17`, `bdd8ff9ed3`, `f8de5859df`, `20c6927b03` and `87e0ed61fc`. - `46771cceee`, the review fix for the card mock. - It applied with no conflicts on top of the #22696 and FRONT-3650 backports already on 1.60. It does not need the #22437 or #22435 backports. - No SDK code from #22746 or #22759 is included. The merged version's `packages/account-core/src/core/billing/billingTab/autoTopUpCard.ts` changes are from the SDK rebuild and are left out. This backport touches no `packages/` files. ## Verification On this branch: - `pnpm vitest run src/platform/billing src/platform/workspace src/platform/account` (includes `BillingAutoTopUpCard.test.ts` and `useAutoTopUpBannerKind.test.ts`): all pass - `pnpm typecheck:app`: pass - `pnpm fallow:audit --base origin/cloud/1.60`: exit 0 - `pnpm architecture:check`: exit 0 AS IS / TO BE: same behaviour as #22431; screenshots are in #22431. - Backport of #22431
…refill on the Credits card and out-of-credits banners (#22437) (#22833) ## Why The automatic backport of #22437 failed with cherry-pick conflicts: the merged change sits on the After-M4 billing SDK refactor #22746, which must not reach the 1.60 line. ## How - Rebuilt from the pre-SDK head of #22437, `8618e8cfa5` (pushed 2026-11-02T12:21Z, before the SDK rebuild force-push). It is not a descendant of `e35bd95ce9`. Picked with `-x -m 2` against its last main merge `dcb6476d28`, so the commit carries only the PR's own net change, which folds in #22438 (display plan balance) and #22453 (purchases-paused state). - Conflicts were with #22711 (refused Add credits reason), which is already on 1.60. They were resolved the way the merged #22437 resolved them on main. The paused top-up reason goes through the refused-reason path and uses the dated paused copy. The Credits card keeps 1.60's `AddCreditsButton` / `AddCreditsRefusalReason` and drops the pre-SDK `topUpPaused` prop. The `src/` files match the merged #22437 diff, except that `deriveCreditsCard` stays in 1.60's `src/platform/billing/components/billingTab/creditsCard.ts`. - No SDK code from #22746 or #22759 is included. Nothing under `packages/account-core/src/core/billing/billingTab` or `packages/account-ui` is touched. The only `packages/` edits are #22453's pre-SDK changes to files that already exist on 1.60: `capabilityDenials.ts` (decode `topup_purchases_paused`) and its tests. ## Verification On this branch: - `pnpm vitest run packages/account-core/src/core/billing src/platform/billing src/platform/workspace src/platform/account`: all pass - `pnpm typecheck:app`: pass - `pnpm fallow:audit --base origin/core/1.60`: exit 0 - `pnpm architecture:check`: exit 0 AS IS / TO BE: same behaviour as #22437; screenshots are in #22437. - Backport of #22437
… refill on the Credits card and out-of-credits banners (#22437) (#22834) ## Why The automatic backport of #22437 failed with cherry-pick conflicts: the merged change sits on the After-M4 billing SDK refactor #22746, which must not reach the 1.60 line. ## How - Rebuilt from the pre-SDK head of #22437, `8618e8cfa5` (pushed 2026-11-02T12:21Z, before the SDK rebuild force-push). It is not a descendant of `e35bd95ce9`. Picked with `-x -m 2` against its last main merge `dcb6476d28`, so the commit carries only the PR's own net change, which folds in #22438 (display plan balance) and #22453 (purchases-paused state). - Conflicts were with #22711 (refused Add credits reason), which is already on 1.60. They were resolved the way the merged #22437 resolved them on main. The paused top-up reason goes through the refused-reason path and uses the dated paused copy. The Credits card keeps 1.60's `AddCreditsButton` / `AddCreditsRefusalReason` and drops the pre-SDK `topUpPaused` prop. The `src/` files match the merged #22437 diff, except that `deriveCreditsCard` stays in 1.60's `src/platform/billing/components/billingTab/creditsCard.ts`. - No SDK code from #22746 or #22759 is included. Nothing under `packages/account-core/src/core/billing/billingTab` or `packages/account-ui` is touched. The only `packages/` edits are #22453's pre-SDK changes to files that already exist on 1.60: `capabilityDenials.ts` (decode `topup_purchases_paused`) and its tests. ## Verification On this branch: - `pnpm vitest run packages/account-core/src/core/billing src/platform/billing src/platform/workspace src/platform/account`: all pass - `pnpm typecheck:app`: pass - `pnpm fallow:audit --base origin/cloud/1.60`: exit 0 - `pnpm architecture:check`: exit 0 AS IS / TO BE: same behaviour as #22437; screenshots are in #22437. - Backport of #22437
…and maximum in Add credits (#22435) (#22835) ## Why The automatic backport of #22435 failed with cherry-pick conflicts: the merged change sits on the After-M4 billing SDK refactor #22746, which must not reach the 1.60 line. ## How - Rebuilt from the pre-SDK head of #22435, `43e9a6bcdb` (pushed 2026-11-02T14:12Z, before the SDK rebuild force-push). It is not a descendant of `e35bd95ce9`. Picked with `-x -m 2` against its last main merge `f710711926`, so the commit carries only the PR's own commits: `4e232e0128` (served minimum), `0feb35b405` (served maximum) and `83c507a7c6` (cap the credits input). - It applied with no conflicts. It does not need the #22437 backport. - No SDK code from #22746 or #22759 is included. The merged version's `packages/account-core/src/core/billing/topUpBounds.ts` is from the SDK rebuild and is left out. This backport touches no `packages/` files. ## Verification On this branch: - `pnpm vitest run src/platform/billing src/platform/workspace src/platform/account` (includes `TopUpCreditsDialogContentWorkspace.test.ts`): all pass - `pnpm typecheck:app`: pass - `pnpm fallow:audit --base origin/core/1.60`: exit 0 - `pnpm architecture:check`: exit 0 AS IS / TO BE: same behaviour as #22435; screenshots are in #22435. - Backport of #22435
… and maximum in Add credits (#22435) (#22836) ## Why The automatic backport of #22435 failed with cherry-pick conflicts: the merged change sits on the After-M4 billing SDK refactor #22746, which must not reach the 1.60 line. ## How - Rebuilt from the pre-SDK head of #22435, `43e9a6bcdb` (pushed 2026-11-02T14:12Z, before the SDK rebuild force-push). It is not a descendant of `e35bd95ce9`. Picked with `-x -m 2` against its last main merge `f710711926`, so the commit carries only the PR's own commits: `4e232e0128` (served minimum), `0feb35b405` (served maximum) and `83c507a7c6` (cap the credits input). - It applied with no conflicts. It does not need the #22437 backport. - No SDK code from #22746 or #22759 is included. The merged version's `packages/account-core/src/core/billing/topUpBounds.ts` is from the SDK rebuild and is left out. This backport touches no `packages/` files. ## Verification On this branch: - `pnpm vitest run src/platform/billing src/platform/workspace src/platform/account` (includes `TopUpCreditsDialogContentWorkspace.test.ts`): all pass - `pnpm typecheck:app`: pass - `pnpm fallow:audit --base origin/cloud/1.60`: exit 0 - `pnpm architecture:check`: exit 0 AS IS / TO BE: same behaviour as #22435; screenshots are in #22435. - Backport of #22435
…auto top-up card (#22431) (#22837) ## Why The automatic backport of #22431 failed with cherry-pick conflicts: the merged change sits on the After-M4 billing SDK refactor #22746, which must not reach the 1.60 line. ## How - Rebuilt from the pre-SDK head of #22431, `46771cceee` (pushed 2026-11-02T00:13Z, before the SDK rebuild force-push). It is not a descendant of `e35bd95ce9`. Two picks, squashed into one commit: - its main merge `3a76c9336e`, picked with `-x -m 2` against origin/main `9065563d47`. This carries the PR's own commits `f3263d3b17`, `bdd8ff9ed3`, `f8de5859df`, `20c6927b03` and `87e0ed61fc`. - `46771cceee`, the review fix for the card mock. - It applied with no conflicts on top of the #22696 and FRONT-3650 backports already on 1.60. It does not need the #22437 or #22435 backports. - No SDK code from #22746 or #22759 is included. The merged version's `packages/account-core/src/core/billing/billingTab/autoTopUpCard.ts` changes are from the SDK rebuild and are left out. This backport touches no `packages/` files. ## Verification On this branch: - `pnpm vitest run src/platform/billing src/platform/workspace src/platform/account` (includes `BillingAutoTopUpCard.test.ts` and `useAutoTopUpBannerKind.test.ts`): all pass - `pnpm typecheck:app`: pass - `pnpm fallow:audit --base origin/core/1.60`: exit 0 - `pnpm architecture:check`: exit 0 AS IS / TO BE: same behaviour as #22431; screenshots are in #22431. - Backport of #22431
…gma (#22392) (#22856) ## Why The auto backport of #22392 to `cloud/1.60` conflicted. This keeps only the app-side style change, with no billing SDK code. ## Root cause The #22392 squash touches SDK files under `packages/account-ui` and sits on main code from #22711, #22746 and #22759 that 1.60 does not have. ## How Cherry-pick (`-x`) of the #22392 squash, then: - Taken: `src/` Billing tab components (`BillingTab.vue`, credits card, plan cell, auto top-up card, plan row), the new `BillingInfoTip.vue` and its test, the banner radius/stroke changes, `src/locales/en/main.json` copy, and the matching test updates. - Dropped: everything under `packages/` (`packages/account-ui/src/billing/tab/*`, restored to `origin/cloud/1.60`) and `BillingCreditsCard.parity.test.ts`, which does not exist on 1.60. - Conflicts: - `BillingCreditsCard.vue`: main uses `AddCreditsAction` (#22711). Kept 1.60's `AddCreditsButton` + `AddCreditsRefusalReason` markup (from #22797/#22798) and moved it into #22392's new top-up row, so Add credits centers on the Top-up label and value with "In use" below. Imports keep `@/platform/billing/components/billingTab/creditsCard`. - `BillingCreditsPlanCell.vue`: took `BillingInfoTip`; kept 1.60's `PlanCreditsState` import from `billingTab/creditsCard` instead of `@comfyorg/account-core/billing`. - Both files are identical on `core/1.60` and `cloud/1.60`, so the resolution matches the core backport. Everything else, including the auto top-up card and `BillingStatusBanner.vue`, applied cleanly. Verification on `cloud/1.60`: - `pnpm vitest run src/platform/billing src/platform/account`: 156 files, 4103 tests pass - `pnpm typecheck:app`: pass - `pnpm fallow:audit --base origin/cloud/1.60`: exit 0 - `pnpm architecture:check`: exit 0 AS IS / TO BE: same look as #22392; screenshots are in #22392. - Backport of #22392
…ma (#22392) (#22855) ## Why The auto backport of #22392 to `core/1.60` conflicted. This keeps only the app-side style change, with no billing SDK code. ## Root cause The #22392 squash touches SDK files under `packages/account-ui` and sits on main code from #22711, #22746 and #22759 that 1.60 does not have. ## How Cherry-pick (`-x`) of the #22392 squash, then: - Taken: `src/` Billing tab components (`BillingTab.vue`, credits card, plan cell, auto top-up card, plan row), the new `BillingInfoTip.vue` and its test, the banner radius/stroke changes, `src/locales/en/main.json` copy, and the matching test updates. - Dropped: everything under `packages/` (`packages/account-ui/src/billing/tab/*`, restored to `origin/core/1.60`) and `BillingCreditsCard.parity.test.ts`, which does not exist on 1.60. - Conflicts: - `BillingCreditsCard.vue`: main uses `AddCreditsAction` (#22711). Kept 1.60's `AddCreditsButton` + `AddCreditsRefusalReason` markup (from #22797/#22798) and moved it into #22392's new top-up row, so Add credits centers on the Top-up label and value with "In use" below. Imports keep `@/platform/billing/components/billingTab/creditsCard`. - `BillingCreditsPlanCell.vue`: took `BillingInfoTip`; kept 1.60's `PlanCreditsState` import from `billingTab/creditsCard` instead of `@comfyorg/account-core/billing`. - Everything else, including the auto top-up card, applied cleanly. Verification on `core/1.60`: - `pnpm vitest run src/platform/billing src/platform/account`: 156 files, 4111 tests pass - `pnpm typecheck:app`: pass - `pnpm fallow:audit --base origin/core/1.60`: exit 0 - `pnpm architecture:check`: exit 0 AS IS / TO BE: same look as #22392; screenshots are in #22392. - Backport of #22392
…ections (Comfy-Org#22764) ## Why FRONT-3797 (part of FRONT-3795): the ComfyUI Billing tab and Platform billing render the same sections twice. FRONT-3796 moved the rules into `@comfyorg/account-core/billing`; this moves the first section's view into `@comfyorg/account-ui/billing`, ComfyUI's look as the default and Platform restyling through hooks (agreed with Alex in #proj-billing). Package work only: consumers migrate in FRONT-3800 (ComfyUI) and FRONT-3801 (Platform). FRONT-3797 is split into four stacked PRs to stay reviewable: plan row (this), credits card, auto top-up card + member block, billing banners. ## How - `BillingPlanRow.vue` renders the served `PlanRowState` and the `PlanRowAction` from account-core. - Copy comes from the host as `PlanRowCopy` (strings and typed functions), the same pattern as the checkout components, so the package carries no i18n runtime. `planRowText` turns state + copy into the title and status line and is exported for hosts that render their own row. - The action is emitted (`@action`), never performed: the host opens the plans page or the sales contact. - Platform hooks: `classes` per part (`root`, `title`, `line`, `actions`), `salesVariant` / `addCreditsVariant` props, an `#action` scoped slot to replace the button (for example with an anchor), and a `#leading` slot for host actions such as Stay/Resume. - ADR-PACKAGES-ACCOUNT-UI-0034 amended: the Billing tab sections live in account-ui. Storybook now picks up `packages/account-ui` stories. - `canManageSubscription` is the served fact passed through as received; no role, tier or `isCloud` check in the package. ## Dependency graph ```mermaid flowchart LR F3796[FRONT-3796 account-core rules Comfy-Org#22746 stack] --> P1[3797 plan row] P1 --> P2[3797 credits card] P2 --> P3[3797 auto top-up + member block] P3 --> P4[3797 banners] P4 --> F3798[FRONT-3798 npm publish] P4 --> F3800[FRONT-3800 ComfyUI renders account-ui] ``` ## AS IS / TO BE | AS IS | TO BE | | --- | --- | | <img width="420" src="https://gist.githubusercontent.com/dante01yoon/aa35483cb18885036fe69ae26581459f/raw/1a6237a1a3cd0baa5f84520ac899caabb9f264f7/account-ui-asis-plan-active.png"> | <img width="420" src="https://gist.githubusercontent.com/dante01yoon/aa35483cb18885036fe69ae26581459f/raw/1a6237a1a3cd0baa5f84520ac899caabb9f264f7/account-ui-tobe-plan-active.png"> | | <img width="420" src="https://gist.githubusercontent.com/dante01yoon/aa35483cb18885036fe69ae26581459f/raw/1a6237a1a3cd0baa5f84520ac899caabb9f264f7/account-ui-asis-plan-ending.png"> | <img width="420" src="https://gist.githubusercontent.com/dante01yoon/aa35483cb18885036fe69ae26581459f/raw/1a6237a1a3cd0baa5f84520ac899caabb9f264f7/account-ui-tobe-plan-ending.png"> | | <img width="420" src="https://gist.githubusercontent.com/dante01yoon/aa35483cb18885036fe69ae26581459f/raw/1a6237a1a3cd0baa5f84520ac899caabb9f264f7/account-ui-asis-plan-paused.png"> | <img width="420" src="https://gist.githubusercontent.com/dante01yoon/aa35483cb18885036fe69ae26581459f/raw/1a6237a1a3cd0baa5f84520ac899caabb9f264f7/account-ui-tobe-plan-paused.png"> | In-app, dark theme. TO BE renders the package component through a local, uncommitted swap inside the app's Billing tab section components (copy and views built the same way as the parity tests); the app switches over in FRONT-3800. ## Tests - Behaviour parity: `src/platform/billing/components/billingTab/BillingPlanRow.parity.test.ts` renders the app's `BillingPlanRow` and the package one (copy built from the same en messages) for all 13 plan states, with and without `can_manage_subscription`, and all actions, and asserts the same title, status line and action label (31 cases). Removing the member line from the package turns 13 of them red. - `packages/account-ui`: `vitest run src/billing` 22 files / 206 tests pass, including a table per plan state, member line, emitted actions, the action slot and the class hook. - Part of FRONT-3797
…led (Comfy-Org#23276) ## Why `billing_new_ux_enabled` (Comfy-Org#23248) rolls 1.61 billing back to 1.60 behavior when it is off, but the Billing settings tab was not covered. Comfy-Org#22746 moved the tab's rules (plan row, credits card, auto top-up card, plan lifecycle, the tab's banners) into the SDK packages and deleted the app-side 1.60 implementation. So 1.61 renders the Billing tab through the SDK for everyone, and a regression there has no switch to turn it off. The 1.61 release review lists the Team-workspace Billing tab (owner and member) as a post-deploy check for exactly this reason. ## How - One branch point: the settings panel now renders `BillingTabLegacy.vue` while `billing_new_ux_enabled` is off and the current `BillingTab.vue` when it is on. The choice is read at render time, so a flag that resolves after the dialog opens still swaps the tab. - `BillingTabLegacy.vue` is the `core/1.60` tab. Everything it reaches that main deleted, or that main moved onto SDK rules, is restored verbatim from `core/1.60` under `src/platform/billing/legacy160/` (34 files), with its 1.60 tests (22 files, 580 cases). Shared infrastructure that did not change rules (capabilities reader, SDK store, dialogs) is main's, and the restored tree typechecks against it unchanged. - Restored with a script (copy from `core/1.60`, rewrite imports between restored files), so the tree is reproducible rather than hand-edited. Two hand edits: the two `tier === 'ENTERPRISE'` checks are wrapped in the existing `pendingServerFact('BE-25244', ...)` bridge (ADR-0042 lint), the same bridge Comfy-Org#23248 uses for the flag-off notices; and the legacy root carries `data-billing-release="1.60"` so a browser test can tell the tabs apart (their markup is otherwise identical by design). - The current `BillingTab.vue` loses its own flag-off branch (member auto top-up view) and that branch's test, since the tab now only renders with the flag on. - `legacy160/` and `BillingTabLegacy.*` are excluded from the fallow audit: it is 1.60 code kept as-is and deleted with the flag, not new code to refactor. The other 1.61 SDK-rule screens get the same flag-off path, so turning the flag off leaves no 1.61 billing SDK rules on screen: - The previous profile popover (`CurrentUserPopoverWorkspace.vue`, rendered only with the flag off) is its `core/1.60` content again. - `CreditsPanel` and the Plan & Credits panel render the `core/1.60` credits tile with the flag off. - The settings status banner, and the Plan & Credits panel's banner kind, come from the `core/1.60` banner rules with the flag off. - The previous Add credits dialog (`TopUpCreditsDialogContentWorkspace.vue`) and its auto top-up card (`TopUpAutoTopUpCard.vue`), both rendered only with the flag off, are their `core/1.60` content again: the served top-up bounds go through the 1.60 local helper instead of the SDK's `servedTopUpBound`, and the card reads auto top-up through the 1.60 composable, so the Billing tab and the dialog share one auto top-up read again. This only changes what main (1.61) renders with the flag off; `core/1.60` is untouched. Bug fixes stay outside the flag. Every 1.61 `fix(...)` commit touching a restored file was checked against `core/1.60`: Comfy-Org#22372, Comfy-Org#22392, Comfy-Org#22717, Comfy-Org#22888, Comfy-Org#22914, Comfy-Org#22921 and Comfy-Org#23060 were backported, so the restored copies already contain them. Comfy-Org#22887, Comfy-Org#22889 and Comfy-Org#22979 only restructure code or add server-fact markers, with no user-visible change. Comfy-Org#22931 (served notice audience) was already put behind this flag by Comfy-Org#23248. The plan-change confirmation fix Comfy-Org#23048 lives in the SDK `CheckoutTransitionConfirm`, which this PR does not gate. Delete `BillingTabLegacy.*`, `legacy160/` and the fallow entry together when the flag is removed. ## AS IS / TO BE AS IS: flag off, the Billing tab renders through the SDK rules. TO BE: flag off, the 1.60 Billing tab; flag on, the current tab. AS IS for flag off is the same picture as flag on: before this PR the flag did not affect the Billing tab. | Flag off (TO BE): 1.60 Billing tab | Flag on: current Billing tab | | --- | --- | | <img src="https://gist.githubusercontent.com/dante01yoon/4dab1584fdedaaaa6722859310c69446/raw/469248fb30804f421c863e6cd3ac97d9e855db62/pr23276-billing-flag-off.png" width="480"> | <img src="https://gist.githubusercontent.com/dante01yoon/4dab1584fdedaaaa6722859310c69446/raw/469248fb30804f421c863e6cd3ac97d9e855db62/pr23276-billing-flag-on.png" width="480"> | ## Verification - `useSettingUI.test.ts`: renders the 1.60 tab with the flag off, then the current tab after the flag turns on in the same render. Goes red when the switch is forced to the current tab. - Browser (`@cloud`, `Billing rollout`): opens the Billing tab with `/api/features` serving the flag off and on and asserts which tab rendered. Ran locally, 4/4 pass; the 1.60 case goes red when the switch is forced to the current tab. - 580 restored 1.60 tests; billing, settings and account settings suites (4,398 tests); app and browser typecheck; knip; dependency-cruiser; server-facts lint. ## Dependencies ``` Comfy-Org#23248 (merged, billing_new_ux_enabled rollout) └── this PR (Billing tab under the same flag) cloud#18886 (serves billing_new_ux_enabled on /api/features) ```
Why
The ComfyUI Billing tab and Platform billing implement the same sections twice, so every rule change lands as two PRs and drifts. Agreed in #proj-billing: rules and UI move into the Billing SDK, ComfyUI being the default look and Platform overriding styling. This is the first step: the framework-free section rules move into
@comfyorg/account-core/billingso account-ui (FRONT-3797) and Platform (FRONT-3801) can consume them.How
packages/account-core/src/core/billing/billingTab/:planRow,planLifecycle,creditsCard,planCheckoutBanner,topupCheckoutBanner. Exported from@comfyorg/account-core/billing.useBillingAutoTopUpCardasderiveAutoTopUpCard({ isLoading, settings })(same precedence: served settings win, else loading, else unavailable), with a table test. The scoped auto top-up reader stays in the app; it moves with FRONT-3650 feat(account-core): auto top-up reader, save and preview in the billing SDK #22413 (FRONT-3650).billing-coretype aliases are replaced by theingest-typestypes they re-export, andderiveCreditsCardtakes a structuralCreditsCardBalanceinstead of the app'sBalanceInfo(which satisfies it).isCloudchecks (lint:server-factsclean).Dependency graph
AS IS / TO BE
No UI change: a module move with behaviour unchanged. Covered by the moved rule tests (account-core: 100 files, 1896 tests) and the Billing tab component tests (
src/platform/billing,settings: 135 files, 3395 tests), all passing.After the SDK rebuild
Rendered from the stack top (e6202d5), behaviour unchanged by the rebuild unless noted.
plan-activecredits-planautotopup-onbanner-plan-verify-paymentbanner-topup-processingNo UI change; same render after the move.