Skip to content

perf(website): load credits checkout on first request - #19718

Closed
benceruleanlu wants to merge 1 commit into
mainfrom
bl/website-defer-credits-checkout-first
Closed

benceruleanlu wants to merge 1 commit into
mainfrom
bl/website-defer-credits-checkout-first

Conversation

@benceruleanlu

@benceruleanlu benceruleanlu commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Load the credits checkout when a visitor first requests it, avoiding its download and initialization during ordinary browsing.

Changes

  • Dependencies: Targets main; the installer dropdown in feat(website): add installer dropdown to the download button #19364 is stacked above this PR.
  • Mount the checkout on the first buy-credits request and retain it across closes and account-flag refreshes.
  • Initialize retained receipt state when the dialog first mounts open, preserving recent-receipt auto-close and stale-receipt reset behavior.

Review Focus

Prior validation covered 39 header/checkout unit tests and five checkout browser tests for deferred mounting, close/reopen behavior, account gating, and retained-receipt age boundaries. CI has not been checked after rebasing this PR onto current main.

Supersedes #19597 with the same checkout change on the corrected prerequisite branch.

@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
billing-web Ignored Ignored Oct 1, 2026 6:18am UTC
billing-web-test Ignored Ignored Oct 1, 2026 6:18am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 6235776d-e3aa-440c-8f96-930a53409c04

📥 Commits

Reviewing files that changed from the base of the PR and between e1fe2a5 and aeea4af.

📒 Files selected for processing (4)
  • apps/website/src/components/common/HeaderMain/HeaderMain.test.ts
  • apps/website/src/components/common/HeaderMain/HeaderMain.vue
  • apps/website/src/components/workshop/BuyCreditsDialog.test.ts
  • apps/website/src/components/workshop/BuyCreditsDialog.vue

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

HeaderMain now mounts the buy-credits dialog when a credit purchase starts. BuyCreditsDialog prepares its state when it mounts open. Tests cover checkout mounting and receipts aged 60,000 ms and 60,001 ms.

Changes

Credits dialog opening behavior

Layer / File(s) Summary
Mount the dialog on credit purchase
apps/website/src/components/common/HeaderMain/HeaderMain.vue, apps/website/src/components/common/HeaderMain/HeaderMain.test.ts
The watcher mounts the dialog when buyingCredits is true. The test checks that the checkout wrapper is absent before a credits request.
Prepare an open dialog on mount
apps/website/src/components/workshop/BuyCreditsDialog.vue, apps/website/src/components/workshop/BuyCreditsDialog.test.ts
The dialog prepares its state on mount when already open. Tests cover receipts aged 60,000 ms and 60,001 ms, including the dialog state after 3.6 seconds.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: benjcooley

Merge Risk: ⚪ Minimal · up to aeea4

Checkout remains deferred until an eligible purchase, while close/reopen and mount-time receipt behavior are preserved. No merge-blocking risk remains.

Security Architecture Review

Security architecture risk: 🔵 Low · up to aeea4

The change defers checkout initialization while preserving existing account and workspace checks. Retaining checkout links across account changes already existed; this PR does not establish broader payment authority. Server-side invalidation of those links and account-switch recovery remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated change is confined to client-side checkout activation and receipt initialization. The inspected flow binds new checkout operations to a user and workspace; no increased cross-account authority was established. Continued usability or revocation of already-created provider checkout links was not verified.

Trust Boundaries and Controls

  • observed — Header request admission uses workshop and authentication feature visibility, not proof of an authenticated identity. Payment creation separately requires a current session and matching refreshed credentials. Payment polling checks user/workspace ownership and generation before continuing or publishing a receipt.

Hardening Proposals

  • proposed — As follow-up hardening of the preexisting flow, bind checkout-link restoration to the current user and workspace, define provider-session behavior after identity changes, and exercise account switching between checkout creation and reopening.

Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore (reviewers only)

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Website End-To-End Regression Coverage ❌ Error The PR changes website runtime behavior in apps/website/src/components/common/HeaderMain/HeaderMain.vue and apps/website/src/components/workshop/BuyCreditsDialog.vue. The change affects the intera… Add or update a Playwright regression test under apps/website/e2e/ that exercises deferred mounting and the credits checkout flow, or add a concrete explanation to the PR description of why an end-to-end test is not practical.
✅ Passed checks (6 passed)
Check name Status Explanation
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 PR title and commit subject use perf, not bug-fix language. The changed files are exclusively under apps/website, which the check explicitly excludes from failure.
Adr Compliance For Entity/Litegraph Changes ✅ Passed The changed-file list contains only website component and test files. It contains no files under src/lib/litegraph/, src/ecs/, or files related to graph entities. The ADR compliance check does not…
Title check ✅ Passed The title clearly describes the primary change: deferring credits checkout loading until the first request.
Description check ✅ Passed The description includes the required Summary, Changes, and Review Focus sections. It explains the deferred mounting behavior, retained state, edge-case handling, and validation status. No screenshots…
Full details: Website End-To-End Regression Coverage

Explanation

The PR changes website runtime behavior in apps/website/src/components/common/HeaderMain/HeaderMain.vue and apps/website/src/components/workshop/BuyCreditsDialog.vue. The change affects the interactive credits checkout flow by deferring mounting until the first buy-credits request and retaining the dialog. The PR does not add or update a Playwright assertion under apps/website/e2e/**/*.spec.ts. The description mentions unit tests and five checkout browser tests, but it does not explain why an end-to-end regression test was not added.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

This candidate changes nothing the matrix measures, so every expensive stage was skipped.

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

Full docs: scripts/registry-census/README.md

🔗 Website Preview

Website Preview: https://comfy-website-preview-pr-19718.vercel.app

Models is built and gated by PostHog (workshop-enabled), using staging Cloud.

This commit: https://website-frontend-2an3kycjg-comfyui.vercel.app

Last updated: 2026-10-01T06:39:48Z for aeea4af

🌾 Fallow: ✅ Passed

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

Reproduce locally
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
  --changed-since e1fe2a5a4cf9eb8b404cb6b8750eac0b1359a144

Full docs: ADR-DEVEX-LINT-0015

@benceruleanlu
benceruleanlu removed this pull request from stack #19719 October 1, 2026 06:19
@benceruleanlu
benceruleanlu added this pull request to stack #19720 October 1, 2026 06:19
@benceruleanlu
benceruleanlu marked this pull request as ready for review October 1, 2026 06:24
@benceruleanlu
benceruleanlu requested a review from a team October 1, 2026 06:24
@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
...bsite/src/components/workshop/BuyCreditsDialog.vue 0.00% 0 Missing and 1 partial ⚠️
@@            Coverage Diff             @@
##             main   #19718      +/-   ##
==========================================
- Coverage   84.62%   84.52%   -0.11%     
==========================================
  Files        3390     3317      -73     
  Lines      162437   160219    -2218     
  Branches    42298    41562     -736     
==========================================
- Hits       137470   135431    -2039     
+ Misses      23048    22982      -66     
+ Partials     1919     1806     -113     
Flag Coverage Δ
billing-web-unit ?
website-unit 79.71% <50.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
...te/src/components/common/HeaderMain/HeaderMain.vue 92.10% <100.00%> (-5.27%) ⬇️
...bsite/src/components/workshop/BuyCreditsDialog.vue 90.51% <0.00%> (+2.20%) ⬆️

... and 73 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.

@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Oct 1, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T06:26:45.858883Z 42dfa42 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Pre-merge checks failed. Please resolve the failing checks before merging.

@benceruleanlu
benceruleanlu removed this pull request from stack #19720 October 1, 2026 06:37
@benceruleanlu
benceruleanlu changed the base branch from bl/website-router-fixture-isolation to main October 1, 2026 06:37
@benceruleanlu
benceruleanlu force-pushed the bl/website-defer-credits-checkout-first branch from 42dfa42 to aeea4af Compare October 1, 2026 06:37
@benceruleanlu
benceruleanlu added this pull request to stack #19723 October 1, 2026 06:37

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

Pre-merge checks failed. Please resolve the failing checks before merging.

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

Pre-merge checks failed. Please resolve the failing checks before merging.

@benceruleanlu
benceruleanlu removed this pull request from stack #19723 October 1, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants