Skip to content

fix(website): fill example media inputs from their reference files - #21637

Draft
comfyrob wants to merge 2 commits into
work/ccc-mar-integration-20261014from
rob/ccc-example-reference-inputs
Draft

comfyrob wants to merge 2 commits into
work/ccc-mar-integration-20261014from
rob/ccc-example-reference-inputs

Conversation

@comfyrob

Copy link
Copy Markdown
Contributor

Summary

Selecting a catalog example now fills its image, video and audio inputs from the example's own reference_media, using the URL the catalog already resolves in website_media (/preview-media/… in Draft Preview, /catalog-media/… once Live). Until now the form only filled media inputs from absolute URLs authored into examples[].values, so authors copied a host-specific /catalog-media/ URL into every example: it breaks when the host changes, never shows in Draft Preview, and duplicates the reference.

Stacked on #21204.

  • catalog-presentation.ts: per media input (schema format: uri or control: media), the value is, in order: presentation.inputMedia[input] (a reference_media index); else the reference a stored value already names by media id, so existing absolute URLs are rewritten to the served path; else, when exactly one media input is empty, the first unused reference. Several unmapped media inputs stay empty rather than guessing an order. inputMedia is not passed on as example presentation.
  • workshop-example-file.ts: same-origin /catalog-media/{uid}/{version} and /preview-media/{rev}/{uid}/{version} paths are example files. PlaygroundField previews any value workshopExampleFile accepts.
  • Run: those paths are fetched with credentials: 'same-origin' (Draft media needs the session) and uploaded to Cloud like any URL input. validateForm and prepareWorkflowRender skip the ^https:// schema check for them because they are replaced by the upload before the request.
  • workflowHttpsUrl returns false for unparseable values instead of throwing from its refinement (the uploader reported a relative path as media_unavailable rather than invalid_input).

Open question for the catalog API: example validation currently requires a required media input to be present in values. With this change the site fills it from reference_media, so values should be allowed to omit it.

Verification

  • Unit: new cases in catalog-presentation.test.ts (fill, rewrite, explicit mapping, untouched template URL, ambiguous inputs, no inputMedia leak), workshop-example-file.test.ts (catalog paths load same-origin; traversal and malformed paths rejected), workshop-workflow-upload.test.ts (credentials per source; malformed paths rejected before fetching), workflow-render.test.ts (an example reference path is uploaded on Run). vitest run src/config src/lib/cms src/components/workshop: 5525 passed. typecheck:website: 0 errors. oxlint/oxfmt clean on changed files.
  • Manual: dev server with SITE_CATALOG_API_URL pointed at the demo catalog. On /hub/workflows/flux-2-klein-9b-image-edit-563f9b5f6ce3/, "Image to edit" was an empty upload box before; it now previews the example's input, and "Reference image" previews the reference file. No console errors. Draft Preview not exercised (needs a staff session).
  • Pushed without the local pre-push hook: on branches stacked on feat(website): Comfy Content Catalog Hub CMS (supersedes #20640, #20933) #21204 its fallow audit is scoped against main and fails on FacetSheet.vue and ExamplesTab.vue from the base branch, plus validateForm, which this PR touches but reduces from cyclomatic ~54 to 48 by extracting inputSchemaRejects.

Selecting a catalog example now fills each media input from that example's
own reference_media, using the URL the catalog resolves for it: the Draft
preview path in Draft Preview, the public catalog-media path once Live.

Mapping per media input: an explicit presentation.inputMedia index, else a
stored value that names one of the example's reference files (so existing
values holding an absolute demo URL are rewritten to the served path), else
the first unused reference when exactly one media input is empty.

Same-origin /catalog-media/ and /preview-media/ paths are accepted as example
files: they preview in the form, load with same-origin credentials, skip the
https-only schema checks because they are uploaded before the request, and are
re-uploaded to Cloud on Run. workflowHttpsUrl now rejects unparseable values
instead of throwing from its refinement.
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: db56b987-eefb-4a75-9d3b-1516104a1d1d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle Size

⏳ Size data collection in progress…

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

No verdict is available. Open the workflow run to confirm the check was intentionally skipped, or fix the collection failure and re-run it.

Findings and check details

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.

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

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

Findings and check details

Fallow gates on new findings in changed files only, so everything below was introduced or moved by this PR (16 changed files).

Kind Finding Where Usual remedy
Complexity validateForm() — cyclomatic 48, CRAP 55.8 apps/website/src/config/workshop-playground.ts:431 Extract a branch, or raise branch coverage — CRAP is CC² × (1−cov)³ + CC, so either moves it.

Pre-existing findings are baselined in .fallow-baselines/ and are not your
responsibility — see ADR-DEVEX-LINT-0015.

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

Full docs: ADR-DEVEX-LINT-0015

🏛️ Architecture: ✅ Passed

Findings and check details

Warnings (132)

  • billing path matches no source files: src/components/dialog/content/credit/**. Remove or update it in docs/architecture/domains/records/billing.domain.json.
  • workspace path matches no source files: src/platform/workspace/fixtures/**. Remove or update it in docs/architecture/domains/records/workspace.domain.json.
  • src/components/graph/selectionToolbox/LinkSelectionActions.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/searchbox/v2/filterChip.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/ui/Popover.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/ui/card/Card.stories.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/ui/card/Card.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/ui/card/CardFooter.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/ui/card/CardHeader.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/ui/card/card.variants.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/widgetHistory/WidgetHistoryButtons.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/widgetHistory/WidgetHistoryButtons.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/billing/useSubscriptionPaywall.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/billing/useSubscriptionPaywall.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/graph/menuOption.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useWidgetValueHistory.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useWidgetValueHistory.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/widgetHistoryScope.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/widgetHistoryScope.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/core/graph/litegraphServiceAccess.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/core/graph/nodeDef/ComfyNodeDefImpl.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/core/graph/widgets/dynamicGroupDiagnostics.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/core/graph/widgets/dynamicGroupDiagnostics.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/core/selection/selectionIntent.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/extensions/core/agentPanel.historyIdentity.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/extensions/core/cameraInfo.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/extensions/core/dynamicPrompts.serializeValue.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/extensions/core/load3d/load3dHost.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/extensions/core/load3d/load3dHost.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/extensions/core/load3d/load3dInstances.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/extensions/core/load3d/reportLoadModelOutcome.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/extensions/core/load3d/reportLoadModelOutcome.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/i18n.literalMessages.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/lib/litegraph/src/LiteGraphGlobal.cloneObject.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/lib/litegraph/src/canvas/canvasClassAccess.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/lib/litegraph/src/canvas/linkHideTransition.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/lib/litegraph/src/canvas/linkHideTransition.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/lib/litegraph/src/canvas/linkSelection.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/lib/litegraph/src/canvas/linkSelection.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/lib/litegraph/src/canvas/linkSnapGeometry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/lib/litegraph/src/canvas/linkSnapGeometry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/platform/auth/authStoreAccess.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/platform/auth/currentUserAccess.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/platform/auth/session/sessionCookieAccess.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/platform/auth/session/sessionRevokedError.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/platform/auth/session/webSessionFetch.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/platform/auth/sso/ssoRequiredContext.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/platform/missingModel/releaseModelOptions.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/platform/missingModel/releaseModelOptions.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/platform/telemetry/billingActionNames.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • …and 82 more
Reproduce locally
pnpm architecture:check

Full docs: Frontend domain catalog

🌐 Website E2E

Tip

All tests passed.

View Report

Test results
Status ✅ Passed

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

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.36364% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/website/src/config/workflow-render.ts 66.66% 0 Missing and 1 partial ⚠️
apps/website/src/config/workshop-example-file.ts 85.71% 0 Missing and 1 partial ⚠️
@@                          Coverage Diff                          @@
##           work/ccc-mar-integration-20261014   #21637      +/-   ##
=====================================================================
- Coverage                              86.45%   86.34%   -0.11%     
=====================================================================
  Files                                   4030     3923     -107     
  Lines                                 184642   181423    -3219     
  Branches                               50825    49725    -1100     
=====================================================================
- Hits                                  159627   156653    -2974     
+ Misses                                 22316    22220      -96     
+ Partials                                2699     2550     -149     
Flag Coverage Δ
billing-web-unit ?
website-unit 80.76% <96.36%> (+0.03%) ⬆️

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

Files with missing lines Coverage Δ
...ebsite/src/components/workshop/PlaygroundField.vue 86.28% <100.00%> (+1.45%) ⬆️
...website/src/config/workshop-example-file-loader.ts 86.48% <ø> (ø)
apps/website/src/config/workshop-playground.ts 98.92% <100.00%> (+0.03%) ⬆️
...s/website/src/config/workshop-workflow-response.ts 95.23% <100.00%> (+0.07%) ⬆️
...pps/website/src/config/workshop-workflow-upload.ts 98.00% <100.00%> (+0.04%) ⬆️
apps/website/src/lib/cms/catalog-presentation.ts 93.82% <100.00%> (+0.77%) ⬆️
apps/website/src/config/workflow-render.ts 70.37% <66.66%> (+1.21%) ⬆️
apps/website/src/config/workshop-example-file.ts 85.71% <85.71%> (+4.46%) ⬆️

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

This branch has not been deployed

No deployments
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.

1 participant