Skip to content

feat: show scheduled plan change banner - #14642

Closed
dante01yoon wants to merge 11 commits into
mainfrom
jaewon/fe-1501-plan-change-warning
Closed

dante01yoon wants to merge 11 commits into
mainfrom
jaewon/fe-1501-plan-change-warning

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Aug 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Shows an advance billing notice when an active subscription has a scheduled plan change, so billing managers can see the destination plan, effective date, and next automatic charge before it takes effect.

Changes

  • What: Adds planChange to the existing billing banner priority model and renders the updated Figma notice for personal and team plans.
  • Root cause: Scheduled plan metadata was only shown as secondary text on the plan card, so the upcoming billing impact was easy to miss.
  • Placement: Places the shared billing banner below the Credits/Activity tabs, matching Figma for plan changes and all existing payment, funding, and cancellation states.
  • Regression coverage: Adds derivation and component tests for visibility, permissions, incomplete API data, higher-priority billing states, and tab-relative placement.

Review Focus

  • Existing team funding/payment banners remain team-plan gated.
  • Priority remains paused > payment failed > out of credits > ending > plan change.
  • The notice is suppressed when the destination plan cannot be resolved safely.
  • All billing banner variants share the same placement below the plan tabs.

Linear: FE-1501

Screenshots

AS IS

Scheduled changes only appear as secondary text within the current plan card.

TO BE

Scheduled plan change banner below plan tabs

Validation

  • pnpm test:unit src/platform/workspace/composables/deriveBillingBanner.test.ts src/platform/workspace/composables/useBillingBanner.test.ts src/platform/workspace/components/dialogs/settings/BillingStatusBanner.test.ts (36 tests)
  • pnpm test:unit src/platform/workspace/components/dialogs/settings/PlanCreditsPanelContent.test.ts src/platform/workspace/components/dialogs/settings/WorkspaceSettingsPanelContent.test.ts src/platform/workspace/components/dialogs/settings/BillingStatusBanner.test.ts (19 tests)
  • NODE_OPTIONS=--max-old-space-size=4096 pnpm typecheck
  • lint-staged (oxfmt, oxlint, ESLint, Stylelint, typecheck)
  • Playwright smoke test against the real Plan & Credits settings view

@dante01yoon
dante01yoon requested a review from a team August 4, 2026 02:05
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 4, 2026
@dosubot

dosubot Bot commented Aug 4, 2026

Copy link
Copy Markdown

📄 Knowledge review

Dosu skipped reviewing this PR because your organization has used its 200 included credits for the month. Your usage will reset on 2026-09-01. To have Dosu review this PR before then, ask your organization admin to upgrade to a pro account.


Leave Feedback Ask Dosu about ComfyUI_frontend Add Dosu to your team

@github-actions

github-actions Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 08/19/2026, 04:51:10 PM UTC

Links

🎭 Playwright: ✅ 1828 passed, 0 failed · 3 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1807 / ❌ 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)

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Billing banner derivation now recognizes scheduled plan changes. The banner resolves and formats the destination plan, effective date, and automatic charge. The banner renders within the plan credits panel. Tests cover eligibility, priority, incomplete data, placement, and unresolved destinations.

Changes

Scheduled plan-change banner

Layer / File(s) Summary
Billing banner derivation
src/platform/workspace/composables/useBillingBanner.ts, src/platform/workspace/composables/deriveBillingBanner.test.ts
Adds the planChange banner kind and scheduled subscription inputs. Scheduled changes apply to eligible personal plans after existing warning states.
Scheduled plan-change rendering
src/platform/workspace/components/dialogs/settings/BillingStatusBanner.vue, src/locales/en/main.json, src/platform/workspace/components/dialogs/settings/BillingStatusBanner.test.ts
Resolves the scheduled plan, validates the effective date, formats the USD charge, and renders localized non-dismissible banner content.
Billing banner panel placement
src/platform/workspace/components/dialogs/settings/PlanCreditsPanelContent.vue, src/platform/workspace/components/dialogs/settings/WorkspaceSettingsPanelContent.vue, src/platform/workspace/components/dialogs/settings/PlanCreditsPanelContent.test.ts, src/platform/workspace/components/dialogs/settings/WorkspaceSettingsPanelContent.test.ts
Places the banner in the plan credits panel and verifies its document order and section containment.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Subscription
  participant useBillingBanner
  participant BillingStatusBanner
  participant PlanCreditsPanelContent
  Subscription->>useBillingBanner: scheduledPlanSlug and changeAt
  useBillingBanner->>BillingStatusBanner: planChange banner
  BillingStatusBanner->>BillingStatusBanner: resolve plan and format date and charge
  PlanCreditsPanelContent->>BillingStatusBanner: render banner in plan section
  BillingStatusBanner-->>PlanCreditsPanelContent: scheduled plan-change message
Loading

Possibly related PRs

Suggested labels: released:cloud

Suggested reviewers: christian-byrne

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: displaying a banner for scheduled plan changes.
Description check ✅ Passed The description explains the change, placement, priorities, edge cases, tests, validation, issue reference, and screenshots.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
End-To-End Regression Coverage For Fixes ✅ Passed The title uses feat and the listed commit subject describes guarding team totals; neither contains bug-fix language, so the required failure conditions are not all met.
Adr Compliance For Entity/Litegraph Changes ✅ Passed The changed files are locale, billing composable, and workspace settings files; none are under the specified litegraph, ECS, or graph-entity paths.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jaewon/fe-1501-plan-change-warning

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/platform/workspace/components/dialogs/settings/BillingStatusBanner.test.ts`:
- Around line 344-379: Add a test alongside the scheduled-change cases using a
resolvable scheduledPlanSlug and changeAt set to "invalid-date"; render through
renderBanner and assert that no element with role "status" is present, covering
malformed API timestamps.

In `@src/platform/workspace/components/dialogs/settings/BillingStatusBanner.vue`:
- Around line 108-115: Update the date formatting call in the planChangeDate
computed property to pass timeZone: 'UTC' to d(), ensuring the scheduled change
date is rendered from its UTC value regardless of the user's local timezone.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ec6dd986-a3d6-42f7-bc9e-51354d6b6816

📥 Commits

Reviewing files that changed from the base of the PR and between 3f3764d and 69af7a9.

📒 Files selected for processing (5)
  • src/locales/en/main.json
  • src/platform/workspace/components/dialogs/settings/BillingStatusBanner.test.ts
  • src/platform/workspace/components/dialogs/settings/BillingStatusBanner.vue
  • src/platform/workspace/composables/deriveBillingBanner.test.ts
  • src/platform/workspace/composables/useBillingBanner.ts

@codecov

codecov Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.46154% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...omponents/dialogs/settings/BillingStatusBanner.vue 97.67% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main   #14642      +/-   ##
==========================================
+ Coverage   79.18%   79.82%   +0.63%     
==========================================
  Files        2210     1881     -329     
  Lines      112308   126238   +13930     
  Branches    34297    38654    +4357     
==========================================
+ Hits        88930   100766   +11836     
- Misses      22912    24831    +1919     
- Partials      466      641     +175     
Flag Coverage Δ
unit 73.24% <98.46%> (+0.01%) ⬆️
website-unit ?

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

Files with missing lines Coverage Δ
...form/cloud/subscription/components/CreditsTile.vue 98.90% <100.00%> (-0.03%) ⬇️
...nents/dialogs/settings/PlanCreditsPanelContent.vue 100.00% <ø> (ø)
...dialogs/settings/WorkspaceSettingsPanelContent.vue 100.00% <100.00%> (ø)
...ace/components/subscriptionPanelWorkspace.logic.ts 100.00% <100.00%> (ø)
...platform/workspace/composables/useBillingBanner.ts 100.00% <100.00%> (ø)
...omponents/dialogs/settings/BillingStatusBanner.vue 99.02% <97.67%> (+2.05%) ⬆️

... and 882 files with indirect coverage changes

🚀 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/platform/workspace/components/dialogs/settings/WorkspaceSettingsPanelContent.test.ts`:
- Around line 28-30: Update the PlanCreditsPanelContent stub and related
assertions in WorkspaceSettingsPanelContent tests to use the banner’s
accessibility contract: add role="status" to the billing banner markup, replace
getByTestId('billing-banner') with getByRole('status'), and replace
queryByTestId('billing-banner') with queryByRole('status').
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f5f69681-972c-4bd2-8541-251abe24b574

📥 Commits

Reviewing files that changed from the base of the PR and between 69af7a9 and 743e492.

📒 Files selected for processing (4)
  • src/platform/workspace/components/dialogs/settings/PlanCreditsPanelContent.test.ts
  • src/platform/workspace/components/dialogs/settings/PlanCreditsPanelContent.vue
  • src/platform/workspace/components/dialogs/settings/WorkspaceSettingsPanelContent.test.ts
  • src/platform/workspace/components/dialogs/settings/WorkspaceSettingsPanelContent.vue
💤 Files with no reviewable changes (1)
  • src/platform/workspace/components/dialogs/settings/WorkspaceSettingsPanelContent.vue

@comfydesigner

Copy link
Copy Markdown
Contributor

Small spacing nit on the Plan tab — the banner sits noticeably closer to the tabs above it than to the content below.

Measured on this branch: mt-4 = 16px, pt-6 = 24px. So it's 16px from the tabs to the banner, but 40px from the banner to the plan tile — TabsContent's mt-4 plus SubscriptionPanelContentWorkspace's own pt-6 stacking.

The pt-6 is the component setting its own external spacing, which is what collides here. Suggest moving it to the call sites so the container owns the rhythm:

  • SubscriptionPanelContentWorkspace.vue — drop pt-6 from the root
  • MembersPanelContent.vue — drop pt-6 from the root (same 40px on the Members tab)
  • SubscriptionPanel.vue — add pt-6 at the call site to preserve its current look

TabsContent's mt-4 then provides the only gap, giving a symmetric 16px above and below the banner. It also lines up PlanCreditsPanelContent.vue, where the banner's mb-4 currently stacks with the same pt-6.

Happy for this to be a follow-up rather than a blocker on this PR.

@comfydesigner

Copy link
Copy Markdown
Contributor

Correction on the above — I measured this on the Workspace panel (WorkspacePanelContent.vue), which isn't in this PR and already has the same stacking on main, so that part is pre-existing rather than something you introduced.

The instance that is in scope here is PlanCreditsPanelContent.vue: the banner this PR adds carries mb-4, and SubscriptionPanelContentWorkspace adds its own pt-6 — same 16px above / 40px below. The pt-6 refactor fixes both surfaces at once, but if you'd rather keep this PR tight, dropping pt-6 from SubscriptionPanelContentWorkspace.vue alone resolves the one this PR creates.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 4, 2026
@huang47

huang47 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Current-head visual evidence for 0b685069f0e69e674b8b4de7cf6e7dc27b2d380f:

FE-1501 current-head banner states

Top: a scheduled change to a three-seat Team plan ($360 whole-subscription total, $120 per seat) renders as “Pro Yearly” with a $120 automatic charge, while the adjacent plan card identifies the destination as Team.

Bottom: the higher-priority paused state correctly overrides the scheduled-change notice.

Setup caveat: Cloud billing APIs are route-mocked; the settings UI and billing code run from the pinned PR head.

@huang47 huang47 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for the blocking Team-plan billing mismatch below. The personal-plan flow, UTC date handling, placement, and banner priority otherwise align with FE-1501.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/platform/workspace/components/dialogs/settings/BillingStatusBanner.vue (1)

131-143: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Guard the unresolved scheduled plan price.

seat_summary is typed on Plan, but runtime API data can still omit fields. If the resolved scheduled Team plan has no seat_summary, line 133 throws before the '' fallback; use scheduledPlan.value?.seat_summary?.total_cost_cents and keep the full chain for total_credits_cents too.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/workspace/components/dialogs/settings/BillingStatusBanner.vue`
around lines 131 - 143, Update the scheduledPlanCharge computed property to
safely access the Team plan’s nested seat_summary fields using optional
chaining, including total_cost_cents and the corresponding total_credits_cents
access. Preserve the existing empty-string fallback when either value is
unavailable.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/platform/workspace/components/dialogs/settings/BillingStatusBanner.vue`:
- Around line 131-143: Update the scheduledPlanCharge computed property to
safely access the Team plan’s nested seat_summary fields using optional
chaining, including total_cost_cents and the corresponding total_credits_cents
access. Preserve the existing empty-string fallback when either value is
unavailable.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b575eb2e-5415-44f2-b00d-2ffa6afda408

📥 Commits

Reviewing files that changed from the base of the PR and between 0b68506 and d85cffa.

📒 Files selected for processing (2)
  • src/platform/workspace/components/dialogs/settings/BillingStatusBanner.test.ts
  • src/platform/workspace/components/dialogs/settings/BillingStatusBanner.vue

@huang47 huang47 assigned dante01yoon and unassigned huang47 Aug 4, 2026
@dante01yoon

Copy link
Copy Markdown
Collaborator Author

Addressed the outside-diff review in 3cc2c87: Team plan totals now use optional chaining through seat_summary, so malformed runtime plan data suppresses the banner instead of throwing. Added a component regression for a missing Team seat_summary. This component does not read total_credits_cents, so there was no corresponding access to update.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 4, 2026
@dante01yoon
dante01yoon requested a review from huang47 August 4, 2026 23:09
@dante01yoon dante01yoon assigned huang47 and unassigned dante01yoon Aug 4, 2026
@huang47 huang47 assigned dante01yoon and huang47 and unassigned huang47 and dante01yoon Aug 5, 2026
@huang47

huang47 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Current-head UI evidence for 3cc2c8776e2c23bb27726683a9e7f3bb1dac66fd:

8788507527be-scheduled-plan-change

The same scheduled change renders as September 3, 2026 in the banner and Sep 2, 2026 in the adjacent plan card, demonstrating the UTC/local-time mismatch on one screen. The capture also shows the banner's “Creator Yearly” label beside the card's “Creator” label; the inline review comment covers only the required date inconsistency.

Setup caveat: Cloud billing APIs are route-mocked in America/Los_Angeles; the settings UI and billing code run from the pinned PR head.

@christian-byrne christian-byrne removed their assignment Aug 23, 2026
@huang47

huang47 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Current-head visual evidence for 6fa6fbad6ff998a9905482f091368645cf72871d:

Scheduled plan change banner on the pinned PR head

The route-mocked real app renders the scheduled-plan banner and adjacent plan card consistently. This proves the UI path only: the mocked scheduled_plan_slug / change_at fields are the production-contract gap raised in the review.

Setup caveat: Cloud billing APIs are route-mocked; the settings UI and billing code run from the pinned PR head. The red toast is a generic mock-shape artifact unrelated to this PR.

@huang47 huang47 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes on the pinned head for three billing/resilience blockers: the production contract does not emit the fields that make the banner reachable; Team per-credit changes can advertise the active credit stop instead of the scheduled destination amount; and the module-global plan catalog can leak a prior workspace amount across switches. Current-head route-mocked evidence: #14642 (comment). No material performance regression was found; focused and broader billing tests passed, and the live performance/binary-size checks pass.

hasFunds: subscription.value?.hasFunds ?? null,
isCancelled: subscription.value?.isCancelled ?? false,
endDate: subscription.value?.endDate ?? null,
scheduledPlanSlug: subscription.value?.scheduledPlanSlug ?? null,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid wiring these fields until they exist in the generated ingest contract? Merged PR #15281 (same author) documents that scheduled_plan_slug / change_at were frontend-only inventions the server never defined or emitted, and removes their mapping. This branch is now dirty against main, so rebasing it would either drop this feature or reintroduce known contract drift; the route-mocked evidence only proves rendering (current-head evidence). I think this PR should close as superseded, or wait for a backend-owned scheduled-change contract.

}

const stop = teamCreditStops.value?.stops.find(
({ id }) => id === currentTeamCreditStop.value?.id

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this feature is revived, can the scheduled-change contract provide the destination Team credit stop or an authoritative next-period amount? This code resolves team_per_credit_* against currentTeamCreditStop, but a same-cadence commitment decrease keeps the same slug and active source stop until renewal. A USD 1,400 to USD 700 scheduled change can therefore advertise the current USD 1,295 charge instead of the destination USD 665. The current-head capture confirms this amount is presented as a definite automatic charge (evidence); the route mock does not cover a destination-stop change.

const scheduledPlanAmountCents = computed(() => {
if (!isScheduledPerCreditTeamPlan.value) {
return isScheduledTeamPlan.value
? scheduledPlan.value?.seat_summary?.total_cost_cents

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the plan catalog be tied to the active workspace before this value is rendered as money? useBillingPlans keeps plans, teamCreditStops, and fetchPromise at module scope. During a workspace switch, the new status can combine with the previous workspace seat_summary; an in-flight request is reused for the new adapter, and a failed refresh preserves the old total. The capture shows that this value is presented directly as the next automatic charge (current-head evidence). Please clear or key the catalog and in-flight request by workspace, and add a two-workspace failure/race regression.

@huang47 huang47 assigned dante01yoon and unassigned huang47 Aug 24, 2026

@dante01yoon dante01yoon left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking review findings (GitHub does not allow the PR author to submit REQUEST_CHANGES on their own PR): the banner is unreachable from the production contract, and the frontend-derived amount can be wrong for both scheduled Team commitment changes and workspace switches. Route-mocked UI evidence does not establish production correctness.

hasFunds: subscription.value?.hasFunds ?? null,
isCancelled: subscription.value?.isCancelled ?? false,
endDate: subscription.value?.endDate ?? null,
scheduledPlanSlug: subscription.value?.scheduledPlanSlug ?? null,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: These fields are not part of the generated ingest contract and the backend does not emit them. Merged PR #15281 explicitly removed the frontend-only scheduled_plan_slug / change_at mapping for that reason. This makes the new banner unreachable in production unless this branch reintroduces API-contract drift. Please implement the backend/OpenAPI contract first, regenerate ingest types, and then consume those generated fields here; otherwise this PR should close as superseded.

}

const stop = teamCreditStops.value?.stops.find(
({ id }) => id === currentTeamCreditStop.value?.id

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: This prices a scheduled per-credit Team change from currentTeamCreditStop, which describes the active commitment rather than the scheduled destination. A same-cadence decrease keeps the same team_per_credit_* slug, so a $1,400 → $700 change can advertise the current stop's charge instead of the next charge. The server contract needs to provide the destination stop or authoritative next-period amount; the frontend cannot derive it deterministically from current state.

const scheduledPlanAmountCents = computed(() => {
if (!isScheduledPerCreditTeamPlan.value) {
return isScheduledTeamPlan.value
? scheduledPlan.value?.seat_summary?.total_cost_cents

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: This definite automatic-charge amount comes from the module-global useBillingPlans catalog, which is not keyed or cleared by workspace. During a switch, new subscription status can combine with the previous workspace's seat_summary; an in-flight request is also reused across adapters, and a failed refresh preserves stale totals. Please scope/clear the catalog and request state by workspace and add a two-workspace race/failure regression before rendering this as billing authority.

@dante01yoon dante01yoon removed their assignment Aug 31, 2026
@dante01yoon dante01yoon added cloud/1.52 Backport PRs for cloud/1.52 and removed core/1.51 labels Aug 31, 2026
@huang47 huang47 added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026 — with ChatGPT Codex Connector
@huang47 huang47 removed the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026
zeus-onl pushed a commit to zeus-onl/ComfyUI_frontend that referenced this pull request Sep 8, 2026
## Summary

Show the authoritative scheduled plan transition returned by `GET
/api/billing/status` in the workspace billing panel and status banner.
This supersedes Comfy-Org#14642 without carrying forward its client-invented
billing fields or projected charge calculation.

Depends on Comfy-Org/cloud#7977 and the generated
`@comfyorg/ingest-types` sync after that backend PR merges.

## Changes

- **What**: Map `scheduled_change` into billing state and render the
destination plan and effective date.
- **Behavior**: Keep urgent/actionable notices ahead of the
informational plan-change banner; cancellation suppresses the change
banner.
- **Contract**: Import `ScheduledPlanChange` from generated ingest
types; no frontend reconstruction of server billing state or future
price.

## Review Focus

- Banner priority: paused → payment failed → out of credits → ending →
scheduled change.
- Unknown destination slugs remain hidden instead of showing incomplete
copy.
- Both the panel and banner share plan-label and date formatting.

## Verification

- 100 targeted tests pass across banner derivation, banner rendering,
and subscription panel behavior.
- `pnpm lint` passes.
- `pnpm knip --cache` passes.
- `pnpm typecheck` passes against types generated locally from
cloud#7977. Until the backend types sync lands on frontend `main`, CI on
this PR will report the two expected missing-contract errors.

## Screenshots

AS IS: no banner appears because the current frontend contract has no
scheduled transition.

TO BE: capture pending after cloud#7977 is available in the preview
environment.

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: skishore23 <178779+skishore23@users.noreply.github.com>
Co-authored-by: comfydesigner <alextov@comfy.org>
@dante01yoon dante01yoon assigned huang47 and unassigned dante01yoon Sep 16, 2026
@dante01yoon
dante01yoon requested a review from huang47 September 16, 2026 00:19
@github-actions github-actions Bot added risk:high PR risk grade (advisory shadow check; grader-owned) and removed risk:xhigh PR risk grade (advisory shadow check; grader-owned) labels Sep 16, 2026
@dante01yoon

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by #16439, which merged on 2026-09-08 and implements this feature against the server-owned contract.

After merging current main into this branch, the resolved tree is byte-identical to main (merge-base...HEAD is empty, 0 files changed), so there is nothing left here to merge.

The three blocking findings are resolved in #16439 rather than here:

  • Contract drift — feat: show scheduled plan change banner #16439 reads subscription.scheduledChange (plan_slug / effective_at) from the generated ingest types. The fields this branch read, scheduledPlanSlug / changeAt, are no longer on SubscriptionInfo, so this branch's derivation no longer typechecks.
  • Team per-credit amount — feat: show scheduled plan change banner #16439 renders no projected charge, so a same-cadence commitment change cannot advertise the active stop's amount. The banner body is "Your current plan stays active until then."
  • Module-global plan catalog — with no amount rendered, the unkeyed useBillingPlans totals are not presented as billing authority during a workspace switch.

Three changes on this branch are not on main and did not carry over. All are independent of the scheduled-change contract and can be raised separately if still wanted:

  1. Banner placement below the Credits/Activity tabs — main keeps it in WorkspaceSettingsPanelContent.vue, above the tabs. This is also where @comfydesigner's pt-6 spacing note applies.
  2. UTC calendar dates in formatSubscriptionDate / CreditsTile — main formats the banner, plan card, and Credits tile in viewer-local time, so those three surfaces currently agree; the prior same-screen mismatch is not present on main.
  3. Personal-plan banner — main gates the banner behind isTeamPlan. Personal plans still see the scheduled change on the plan card via planDateDisplay, which is not team-gated.

christian-byrne pushed a commit that referenced this pull request Sep 20, 2026
Show the authoritative scheduled plan transition returned by `GET
/api/billing/status` in the workspace billing panel and status banner.
This supersedes #14642 without carrying forward its client-invented
billing fields or projected charge calculation.

Depends on Comfy-Org/cloud#7977 and the generated
`@comfyorg/ingest-types` sync after that backend PR merges.

- **What**: Map `scheduled_change` into billing state and render the
destination plan and effective date.
- **Behavior**: Keep urgent/actionable notices ahead of the
informational plan-change banner; cancellation suppresses the change
banner.
- **Contract**: Import `ScheduledPlanChange` from generated ingest
types; no frontend reconstruction of server billing state or future
price.

- Banner priority: paused → payment failed → out of credits → ending →
scheduled change.
- Unknown destination slugs remain hidden instead of showing incomplete
copy.
- Both the panel and banner share plan-label and date formatting.

- 100 targeted tests pass across banner derivation, banner rendering,
and subscription panel behavior.
- `pnpm lint` passes.
- `pnpm knip --cache` passes.
- `pnpm typecheck` passes against types generated locally from
cloud#7977. Until the backend types sync lands on frontend `main`, CI on
this PR will report the two expected missing-contract errors.

AS IS: no banner appears because the current frontend contract has no
scheduled transition.

TO BE: capture pending after cloud#7977 is available in the preview
environment.

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: skishore23 <178779+skishore23@users.noreply.github.com>
Co-authored-by: comfydesigner <alextov@comfy.org>
christian-byrne pushed a commit that referenced this pull request Sep 20, 2026
Show the authoritative scheduled plan transition returned by `GET
/api/billing/status` in the workspace billing panel and status banner.
This supersedes #14642 without carrying forward its client-invented
billing fields or projected charge calculation.

Depends on Comfy-Org/cloud#7977 and the generated
`@comfyorg/ingest-types` sync after that backend PR merges.

- **What**: Map `scheduled_change` into billing state and render the
destination plan and effective date.
- **Behavior**: Keep urgent/actionable notices ahead of the
informational plan-change banner; cancellation suppresses the change
banner.
- **Contract**: Import `ScheduledPlanChange` from generated ingest
types; no frontend reconstruction of server billing state or future
price.

- Banner priority: paused → payment failed → out of credits → ending →
scheduled change.
- Unknown destination slugs remain hidden instead of showing incomplete
copy.
- Both the panel and banner share plan-label and date formatting.

- 100 targeted tests pass across banner derivation, banner rendering,
and subscription panel behavior.
- `pnpm lint` passes.
- `pnpm knip --cache` passes.
- `pnpm typecheck` passes against types generated locally from
cloud#7977. Until the backend types sync lands on frontend `main`, CI on
this PR will report the two expected missing-contract errors.

AS IS: no banner appears because the current frontend contract has no
scheduled transition.

TO BE: capture pending after cloud#7977 is available in the preview
environment.

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: skishore23 <178779+skishore23@users.noreply.github.com>
Co-authored-by: comfydesigner <alextov@comfy.org>
christian-byrne pushed a commit that referenced this pull request Sep 20, 2026
Show the authoritative scheduled plan transition returned by `GET
/api/billing/status` in the workspace billing panel and status banner.
This supersedes #14642 without carrying forward its client-invented
billing fields or projected charge calculation.

Depends on Comfy-Org/cloud#7977 and the generated
`@comfyorg/ingest-types` sync after that backend PR merges.

- **What**: Map `scheduled_change` into billing state and render the
destination plan and effective date.
- **Behavior**: Keep urgent/actionable notices ahead of the
informational plan-change banner; cancellation suppresses the change
banner.
- **Contract**: Import `ScheduledPlanChange` from generated ingest
types; no frontend reconstruction of server billing state or future
price.

- Banner priority: paused → payment failed → out of credits → ending →
scheduled change.
- Unknown destination slugs remain hidden instead of showing incomplete
copy.
- Both the panel and banner share plan-label and date formatting.

- 100 targeted tests pass across banner derivation, banner rendering,
and subscription panel behavior.
- `pnpm lint` passes.
- `pnpm knip --cache` passes.
- `pnpm typecheck` passes against types generated locally from
cloud#7977. Until the backend types sync lands on frontend `main`, CI on
this PR will report the two expected missing-contract errors.

AS IS: no banner appears because the current frontend contract has no
scheduled transition.

TO BE: capture pending after cloud#7977 is available in the preview
environment.

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: skishore23 <178779+skishore23@users.noreply.github.com>
Co-authored-by: comfydesigner <alextov@comfy.org>
christian-byrne pushed a commit that referenced this pull request Sep 20, 2026
Show the authoritative scheduled plan transition returned by `GET
/api/billing/status` in the workspace billing panel and status banner.
This supersedes #14642 without carrying forward its client-invented
billing fields or projected charge calculation.

Depends on Comfy-Org/cloud#7977 and the generated
`@comfyorg/ingest-types` sync after that backend PR merges.

- **What**: Map `scheduled_change` into billing state and render the
destination plan and effective date.
- **Behavior**: Keep urgent/actionable notices ahead of the
informational plan-change banner; cancellation suppresses the change
banner.
- **Contract**: Import `ScheduledPlanChange` from generated ingest
types; no frontend reconstruction of server billing state or future
price.

- Banner priority: paused → payment failed → out of credits → ending →
scheduled change.
- Unknown destination slugs remain hidden instead of showing incomplete
copy.
- Both the panel and banner share plan-label and date formatting.

- 100 targeted tests pass across banner derivation, banner rendering,
and subscription panel behavior.
- `pnpm lint` passes.
- `pnpm knip --cache` passes.
- `pnpm typecheck` passes against types generated locally from
cloud#7977. Until the backend types sync lands on frontend `main`, CI on
this PR will report the two expected missing-contract errors.

AS IS: no banner appears because the current frontend contract has no
scheduled transition.

TO BE: capture pending after cloud#7977 is available in the preview
environment.

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: skishore23 <178779+skishore23@users.noreply.github.com>
Co-authored-by: comfydesigner <alextov@comfy.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cloud/1.52 Backport PRs for cloud/1.52 needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch risk:high PR risk grade (advisory shadow check; grader-owned) size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants