Repository navigation
feat(website): give CCC workflow pages their own structured data and meta - #21551
MaanilVerma wants to merge 12 commits into
Conversation
…meta A CCC workflow page now describes its workflow as a SoftwareSourceCode node. When the record has a verified creator username, the node links its author to a Person node at /hub/creators/<username>/. The breadcrumbs go through the Workflows list. The title uses a workflow form, so it does not match a model page with the same name. The meta description is at most 160 characters.
📦 Bundle Size
🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measureExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
Findings and check detailsThe 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: ✅ PassedFallow 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 detailsNo new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 7310c18316ee9fe53b56baed4b8766b5121ff29a
Full docs: ADR-DEVEX-LINT-0015 🏛️ Architecture: ✅ PassedFindings and check detailsWarnings (132)
Reproduce locallypnpm architecture:checkFull docs: Frontend domain catalog 🌐 Website E2ETip All tests passed. Test results
🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-21551.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. Deployment detailsThis commit: https://website-frontend-5f6oasf1r-comfyui.vercel.app Last updated: 2026-10-21T20:10:34Z for |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
…Hub handle A workflow whose author has no name now gets no author node, so the JSON-LD does not name a Person "Author unavailable". The username check now uses the Hub handle rule from cloud: letters, digits and inner hyphens.
authorDetails() now keeps the author username only when the matching author record also has a name, the same rule as #21551. A record with a matching uid but no name shows Author unavailable as plain text, not as a link. New tests cover a missing and a blank name, the schema rejecting ../x, and the unlinked author rendering as a span.
This comment has been minimized.
This comment has been minimized.
benjcooley
left a comment
There was a problem hiding this comment.
Review: CCC workflow JSON-LD and meta
This PR moves the CCC (CMS) workflow head off the model builders and onto workflow-specific JSON-LD, title and meta. The approach is sound. The workflowId check is safe: the schema types it as never on model records. The locale keys exist under workshop.workflow.meta in en, ja and zh-CN. Both length caps hold on every input tried, and the author gate (uid match plus non-blank name) works.
Two behaviour problems need fixing before cutover.
| Severity | Count |
|---|---|
| BLOCKER | 0 |
| SHOULD FIX | 3 |
| TRIVIAL | 3 |
SHOULD FIX
- The ja/zh-CN meta description collapses to the workflow name.
cutAtWord(lead, 160)cuts at the last ASCII space. In a CJK lead, that space is inside the name. For example, a 170-character zh-CN lead becomesFlux Kontext Product…. Cut only the summary, the waymodelMetaDescriptiondoes. - Only the CMS path gets the new head. In prod, and in any build with the CMS off,
LegacyDetailPagestill renders a model title and aSoftwareApplicationnode for the same/hub/workflows/*URLs. - This duplicates #21570 and #21564. It adds the same
authorUsernamefield and helper in the same files, and a hardcoded creator path that is not locale-prefixed. Rebase onto #21570 and usecreatorEntityId/hubCreatorPath.
TRIVIAL: The breadcrumb labels are always English. workflowTitle has no tests, and it can split a surrogate pair. The {1,28} regex needs a named constant, and the PR body cites the wrong source for the 30-character cap.
Tests: every new meta and JSON-LD test runs in en only. Mutation testing found that these changes still pass the suite:
- dropping the title shortening
- dropping the "A ComfyUI workflow on Comfy Hub." sentence
- loosening either part of the username regex
A zh-CN or ja case would have caught item 1.
What was run: a static review of a PR-head snapshot, plus vitest in a throwaway copy. All 35 new SSR tests and the new presentation tests pass. In that patched copy, 32 existing SEO-audit tests in catalog-detail-ssr.test.ts failed. I didn't run them against the base, so please confirm they pass in CI.
| ) | ||
| return ( | ||
| [full, lead].find((text) => text.length <= WORKFLOW_DESCRIPTION_MAX) ?? | ||
| cutAtWord(lead, WORKFLOW_DESCRIPTION_MAX) |
There was a problem hiding this comment.
SHOULD FIX — when the lead overflows, this cuts the whole lead at the last ASCII space. ja/zh-CN leads use a full-width : and CJK summaries have no spaces, so the last space is inside the workflow name and the summary is dropped entirely.
Repro (zh-CN): name Flux Kontext Product Relight, summary ~140 CJK chars → lead is 170 chars → result is Flux Kontext Product…. In en, a summary with no spaces gives Name… the same way.
modelMetaDescription avoids this by cutting only the summary (lead(cutAtWord(summary, summary.length - overflow))), which hard-cuts when there's no space and keeps the name. Do the same here. Also add a ja/zh-CN case: every test in this PR runs only in en.
There was a problem hiding this comment.
Fixed, in 0403110d8d. workflowMetaDescription now cuts only the summary. I moved the summary cut out of modelMetaDescription into cutSummaryToFit(), and both functions use it, so the name stays and a summary with no spaces gets a hard cut.
The red commit 6fd154b280 adds keeps the name and cuts only a summary without spaces in $locale for zh-CN, ja and en. Against the old code, zh-CN and ja gave Flux Kontext Product… and en gave Flux Kontext Product Relight…. All three pass at 0403110d8d.
Receipt: pnpm exec vitest run src/lib/workshop/model-meta-description.test.ts -> 26 passed.
There was a problem hiding this comment.
SHOULD FIX, partly fixed. Cutting only the summary fixes the case I reported. But cutAtWord(summary, …) still breaks at the last ASCII space, so a CJK summary that contains an English word still collapses. That's common in zh/ja copy ("使用 ComfyUI …", "Flux …").
Repro (zh-CN, name Flux Kontext Product Relight, summary 'ComfyUI ' + '把产品照片放进摄影棚场景'.repeat(12)): the result is Flux Kontext Product Relight:ComfyUI…, 37 characters, and about 120 characters of summary are dropped. 使用 ComfyUI 把产品… gives …:使用 ComfyUI….
The new regex test doesn't catch this: .* only proves that the first 10 characters survive. Fix: use the space only when it falls past ~60% of the cut, otherwise hard-cut. Add the case above as a test. Leaving this open.
There was a problem hiding this comment.
Fixed in comfy-website#26 (this PR moved there): 059e7c0008. cutAtWord now breaks at the last space only when that space is past 60% of the cut. Otherwise it hard-cuts.
Your two repros are a test table in 1056e9020e. The test asserts that the zh-CN description keeps ComfyUI plus 8 repeats of the CJK phrase, at 160 characters or less. Before the fix, both rows did not pass: Flux Kontext Product Relight:ComfyUI… and …:使用 ComfyUI…. After the fix, vitest run src/lib/workshop/ gives 826 passed, so the English word cuts in modelMetaDescription did not change.
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## maanil/ccc-workflow-ssr-body #21551 +/- ##
===============================================================
Coverage ? 86.34%
===============================================================
Files ? 3925
Lines ? 181413
Branches ? 49720
===============================================================
Hits ? 156647
Misses ? 22216
Partials ? 2550
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…ow head Cut only the summary in the workflow meta description, keep emoji whole in a shortened title, localize the breadcrumbs, and pick the workflow or model head in one helper that LegacyDetailPage and catalogDetailHead share.
|
I removed the author username code from this PR in Removed:
Why: #21570 adds the same field with a different validator in the same lines. If the two rules drift, the schema The rest of the workflow JSON-LD does not change:
|
benjcooley
left a comment
There was a problem hiding this comment.
Re-review: commits 891f5761f0, 6fd154b280 and 0403110d8d
15fd2d100f is a base merge. It doesn't touch any files in this PR, so I didn't review it.
Five of the six threads are fixed and resolved:
detailPageHeadnow builds the workflow head on both the static and the CMS paths.- The duplicated creator logic is removed cleanly.
- Workflow breadcrumbs are localized.
shortenAtWordno longer splits a surrogate pair.- The
{1,28}regex is gone.
The new tests do catch the original bugs.
| Severity | Count |
|---|---|
| BLOCKER | 0 |
| SHOULD FIX | 2 |
| TRIVIAL | 4 |
SHOULD FIX
- A CJK summary that contains an English word still collapses. This is the open thread on
model-meta-description.ts.cutAtWord(summary, …)still breaks at the last ASCII space. For example,'ComfyUI ' + '把产品照片放进摄影棚场景'.repeat(12)in zh-CN givesFlux Kontext Product Relight:ComfyUI…, which is 37 characters. - The PR description is out of date. It still describes the
Personauthor node,authorUsername/validCreatorUsername, the 30-character rule and the "fixed creator path" risk, and none of that is in the diff now. It doesn't mention that static (prod)/hub/workflows/*pages now get the workflow title, description and JSON-LD. Those pages stay noindex for now. Also, no PR in the stack adds the JSON-LDauthorany more: #21570 adds only the visible link. Either track that as a follow-up or add it in whichever PR lands last.
TRIVIAL
- No test covers
LegacyDetailPageitself. Replacing itsdetailPageHeadcall with literals still passes every test. detail-head.test.tschecks only one static workflow page. A table test over all of them would be cheap.- The emoji title test exercises the surrogate guard only in zh-CN.
- The "Comfy Hub sentence" test uses
toContain, so a wrong separator in ja/zh-CN would pass.
modelPageJsonLd still has English breadcrumbs. That predates this PR and you scoped it out, so I'm noting it only.
Testing: run in a scratch copy with dependency stubs.
- The workshop, cms and catalog-detail-ssr suites pass: 1459 tests.
catalog-detail-ssr.test.tspasses on the base (193/193) and on the head (228/228).- The 33 SEO-audit failures I flagged in round 1 were caused by my environment (a missing dependency made the async component fail silently), not by this PR.
- About 1,100 fuzz cases stay within 160/170/60 characters, with no lone surrogates.
- I did not run tsc, lint, e2e or the Astro build.
|
Moved to Comfy-Org/comfy-website#26 (the website now lives there). This PR stays open for its review history. |
|
Closing: the website moved; this change lives in Comfy-Org/comfy-website#26. |
Summary
A Hub workflow page now has structured data and meta of its own, on the static pages and on the CMS pages. Before this PR, it used the model-page builders, so it described the workflow as a
SoftwareApplicationwith a model title ("{name} API & Playground - Comfy") and a description of up to 170 characters. Now it has aSoftwareSourceCodenode, workflow breadcrumbs in the page locale, a workflow title and a meta description of at most 160 characters.This PR does not change the indexing gates. CCC workflow pages stay noindex until the cutover (SEO3). The JSON-LD has no author. The author will come from the creator stack (#21561, #21564, #21570) after both stacks land.
Changes
Head selection:
detailPageHeadinlib/workshop/detail-head.tsreturns the title, the meta description and the JSON-LD for a detail page. It uses the workflow builders when the model has aworkflowId, and the model builders otherwise.LegacyDetailPage.astro(the static pages) andcatalogDetailHeadinlib/cms/detail-page-server.ts(the CMS pages) both calldetailPageHead.catalogDetailHeadpasses the page locale.Structured data:
workflowPageJsonLdinutils/workflowJsonLd.tsgives a workflow page aSoftwareSourceCodemain entity with name, URL, description, image, genre,runtimePlatform: ComfyUIand the Comfy publisher. The description gets the samecleanSummaryas the meta description./hub/workflows/), then the workflow name. The Home and Workflows names come fromtranslationsFor(locale).Meta:
workflowTitleinlib/workshop/model-title.tsgives "{name} Workflow - Comfy" in the page locale and shortens the name at a word to keep the title at 60 characters or less.shortenAtWordnow removes a trailing high surrogate before the ellipsis, so a cut name never ends in half an emoji.modelTitleuses the same function and gets the same fix.workflowMetaDescriptioninlib/workshop/model-meta-description.tsgives "{name}: {summary} A ComfyUI workflow on Comfy Hub." It drops the last sentence, or cuts only the summary at a word, to keep the text at 160 characters or less.cutSummaryToFitholds the summary cut, andmodelMetaDescriptionandworkflowMetaDescriptionboth use it. Thus the name always stays, and a summary with no spaces gets a hard cut.workshop.workflow.metastrings are inen,zh-CNandja.QA Focus
pnpm exec vitest run src/lib/workshop/model-meta-description.test.tsinapps/website. Expected: 26 tests pass. Author: tested at0403110d8d, 26 pass. At the red commit6fd154b280, zh-CN and ja gaveFlux Kontext Product…and en gaveFlux Kontext Product Relight…. Without the hub sentence,3 failed | 23 passed.pnpm exec vitest run src/lib/workshop/model-title.test.tsinapps/website. Expected: all tests pass, in en, ja and zh-CN. Author: tested at0403110d8d. At6fd154b280, the zh-CN emoji name ended in a lone surrogate. WithoutshortenAtWordinworkflowTitle,6 failed | 9 passed.pnpm exec vitest run src/lib/workshop/detail-head.test.tsinapps/website. Expected: a static workflow page gets the workflow title, aSoftwareSourceCodenode and the/hub/workflows/crumb. Author: tested at0403110d8d. IfdetailPageHeadalways takes the model branch,1 failed | 1 passed.pnpm exec vitest run src/routes/models/catalog-detail-ssr.test.ts --testTimeout=60000inapps/website. Expected: all tests pass, withnames the workflow breadcrumbs in the page localeamong them. Author: tested at891f5761f0, 227 pass. At6fd154b280, the breadcrumb test gave['Home', 'Workflows', ...]in place of the zh-CN names, and it passes at0403110d8d. The full file was not run again after0403110d8d.validateHtml()fromscripts/validate-jsonld.tson the head graph of each of the 30 seed workflows. Author: tested.validate-jsonld.tsreads onlydist/*.html, and CMS pages render on request, so the test builds the graph withbuildPageGraphthe wayBaseLayout.astrodoes.<title>ofdist/hub/workflows/change-material/index.html. Expected:Change a material Workflow - Comfy. Author: not tested, because this round leaves the build to CI. Before the change, the built title wasChange a material API & Playground - Comfy.SoftwareSourceCodenode. Author: not tested, because the preview is noindex and BaseLayout emits no structured data on a noindex page.Risky areas
LegacyDetailPage.astronow usesdetailPageHead, so the static/hub/workflows/*pages in production change. Their title changes from "{name} API & Playground - Comfy" to "{name} Workflow - Comfy", their meta description changes, and their JSON-LD changes fromSoftwareApplicationtoSoftwareSourceCode. Search engines can show the new titles and descriptions after the next crawl.detailPageHeadis shared by the workflow and model pages on both the static and the CMS route. The branch is onmodel.workflowId. The model-page tests insrc/routesanddetail-head.test.tspass.shortenAtWordalso servesmodelTitle. The surrogate fix changes a model title only when its cut ends in half an emoji.author. When the creator stack and this PR both land, a follow-up can add the author withcreatorEntityIdandhubCreatorPathfromlib/hub/creator-path.ts.modelJsonLdbreadcrumbs still ignore the page locale (zh-CN,ja). That builder is outside this PR.PR dependency map
main(base)main)Merge #21204 and #21550 before this PR. The creator stack (#21561, #21564, #21570) is a separate chain on #21204. The JSON-LD author follows after both chains merge.