Skip to content

feat(website): Comfy Content Catalog Hub CMS (supersedes #20640, #20933) - #21204

Open
benjcooley wants to merge 154 commits into
mainfrom
work/ccc-mar-integration-20261014
Open

benjcooley wants to merge 154 commits into
mainfrom
work/ccc-mar-integration-20261014

Conversation

@benjcooley

@benjcooley benjcooley commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This is the Comfy Content Catalog (CCC) Hub CMS frontend as one PR. It supersedes #20640 (Mar's Hub admin redesign) and #20933 (CCC admin/Preview primitives). Both contain contradictory transports and preview controls, so neither should merge on its own.

It keeps Mar's admin layout:

Surviving preview/banner rule (ADR WEBSITE-CMS-0039, "Integrated replacement"):

  • CatalogStaffChrome chooses exactly one staff surface:
    • A server-verified catalog session uses CatalogPreviewController and /admin/catalog.
    • The legacy design-demo session uses its fixture UI.
    • They never render together.
  • Draft, and Live with a simulated clock, show the graphite Preview bar. Ordinary Live shows only the staff entry controls.
  • NOW clears the simulated clock without changing the view. EXIT selects Live and clears the clock.
  • Checked publication is one idempotent catalog transaction. Legacy mutation forms are restricted to the non-production sample-data demo.
  • The staff palette stylesheet loads only for verified staff sessions, so public pages carry no admin CSS.

Detail pages are server-rendered (12f031633c). Catalog workflow and model detail pages now load their record on the server, using the same one-record read page.json uses (no full-catalog loading). The first HTML has:

  • the real title, meta description, localized canonical, OG image and JSON-LD;
  • exactly one h1, plus the summary.

The island hydrates from that record without refetching; client navigation still fetches. Unknown records return 404, and staff views stay noindex. A CI audit (auditCatalogDetailBody plus an SSR test over every seed workflow and model, 184 cases) enforces this.

Production stays CMS-inactive. cmsEnabled() requires SITE_CATALOG_API_URL and returns false whenever VERCEL_ENV === 'production'. Middleware, routes and rendering share that gate, so a production build serves the existing static Hub even if the catalog URL is set. Mar's sample-data login is also off unless SITE_CATALOG_DEMO=1, and never on production.

Design references:

Legacy site-session exchange and verification now work only in the explicit non-production demo or existing development tester configuration (58f4a9f22f). Normal catalog use does not probe the retired /admin/api/site/review endpoint; canonical catalog authoring sessions keep their separate verification. The generated catalog API types and the website request snapshot are included (09edacbdeb).

Verification

Latest scoped checkpoint 58f4a9f22f: 73 session, middleware and demo tests pass. Three new refusal cases reproduced before the guard. Normal format/lint/type hooks, import-cycle audit, knip and changed-file push audit pass; no new audit suppression. These checks do not claim full-site visual acceptance or deployment.

On head b7202648b6, Node 26.8.2:

  • Website tests: pnpm exec vitest run in apps/website passed 708 files / 12,809 of 12,810 tests. The one failure, ModelsPage.test.ts "shows a server-selected workflow…", passes 3/3 when run alone, so it's load-sensitive.
  • Typecheck: pnpm typecheck in apps/website reported 0 errors.
  • Import cycles: pnpm deps:audit (the new import-cycle check) found no violations.
  • Hooks: every commit ran the hooks (oxfmt, oxlint type-aware, eslint, server-facts, unused-i18n, typecheck). The pre-push hook passed pnpm knip and fallow audit: "No issues in 408 changed files". The two complexity findings it prints are inherited from main.
  • Preview bar: 82 focused preview/stylesheet/route tests pass, covering:
    • admin CSS only for staff;
    • ADMIN → /admin/catalog, which is registered;
    • plural label;
    • same-origin path helper, with and without a locale.
  • Earlier checkpoints: BRADY verified this integration in a browser on the ngrok demo against the real catalog API (Draft table, checked-subset publish incl. tombstones, Final review, editor Delete/Undelete, Draft media), plus desktop and mobile checks in English and Chinese.

Historical verification above belongs to its named checkpoints. Subsequent author/profile fixes remain in this branch; demo and production acceptance stay on the CCC blockers page.

Catalog locales/hreflang landed in a5b18afe9c (BRUCE3).

This PR stays draft until those land and the backend stack merges.

Current-main synchronization

Rebased the existing branch onto frontend main 6410b7c184 as ac84980ef8. Preserved Mar's integrated UI, newer SSR detail pages, author/profile rendering and the catalog production-off gate while retaining main's staff-only app controls, challenge banner and API types. Website typecheck: zero errors; focused Hub/index/presentation checks: 39 tests pass. Node 26.8.2 pre-push dependency-cycle, knip and changed-line fallow audits pass without bypass. CI is running; this is not a deployment or merge-readiness claim. The running Linux demo's unpublished source was preserved separately for semantic reconciliation rather than overwriting newer reviewed code.

benjcooley and others added 30 commits October 7, 2026 14:09
One Draft list merges catalog changes and workflow submissions, with a
review sheet, Run in Comfy Cloud, publish that approves the included
workflows, multi-reject, All content, publish history with rollback,
and a slimmer preview bar with a time picker and a changes list.
Adds shadcn-vue Switch, Checkbox and Popover in the site's style.
Moves listing filters, stats, rows, review details, the time picker and
the changes list into their own components, and the filtering rules into
tested helpers, so each template stays small.
The admin and the preview bar are work tools, so they now use the
developer platform's graphite palette, type scale and controls instead
of the marketing site's ink and yellow: a sidebar shell, dense tables,
status dots, 8px controls and neutral dialogs and side panels.

Admin primitives (button, dialog, side panel, status label, page header)
live in components/cms/ui on top of reka-ui, and BaseLayout gains a
bare mode so the admin can bring its own chrome.
A pull request labelled cms-demo now builds its Vercel preview with the
Hub admin running on in-memory sample data, so design can share a link
without a backend. The mock that pnpm dev:cms serves moves to
lib/cms/mock-ingest.ts; in demo mode the site API and catalog reads are
answered by it instead of the network. The flag is baked in at build
time and refused when VERCEL_ENV is production.

All content's row actions become icon buttons with platform tooltips.
…in a new tab

Also split the middleware so the demo error wrapper stays small.
Replaces the middleware wrapper; the demo build alone injects /500.
On Vercel the function failed to import ScrollToPlugin by name from gsap's
ESM files, which sit in a package Node reads as CommonJS.
One person publishing in the shared demo emptied the Draft for everyone
else on that function instance. Each sign-in now gets its own credential
and its own in-memory catalog.
Live is now a preview view instead of leaving preview, so the bar stays
until Exit preview. The bar stacks above the sticky header, which docks
below it. The admin sidebar title gets the Comfy mark.
…w flow

The preview bar only shows on the site, not in the admin. Preview draft
opens the list of changed pages on arrival and is hidden when the draft
is empty. The bar counts page changes, which is what the preview shows,
and says workflow submissions are checked in Comfy Cloud. Sheets cover
the bar again, and the reject note no longer mentions the review API.
…lk review

From the workshop standup review of the admin design:

- Content editor at /admin/edit/{uid}: name, summary, credit and tags in
  English and Chinese, cover, examples with prompts, each input's default
  and whether it is basic, advanced or hidden, visibility and schedule.
  Saving puts the item in the draft through the site API's item endpoint,
  after checking it against the schemas the website renders from.
- Add content starts from a copy of an existing item; archive and restore
  are saves with the deleted flag. All content lists new and archived
  items and links each row to its editor.
- Publish history can restore any earlier publish, not only the previous.
- The Draft queue includes, leaves out or rejects everything a filter or
  search shows.
- The preview bar links back to the admin and to the editor of the page
  in view, and in Draft labels the cards and links the draft changes.
- The demo mock saves items, archives, and restores real LIVE snapshots.
…parts

Keeps each template and function within the complexity limits: the
editor's header, details, cover and publishing panel are their own
components, parameter rows render separately, history moves to its own
Astro component, and the publish, revert and reject actions and the mock
save are split into single-purpose functions.
The cover and each example take an uploaded image or video as well as a
link. Until the site API has file storage, only the demo accepts uploads
and keeps them inline, up to 3 MB; elsewhere the button explains why it
is off.

Draft items now go through the checks a reviewer makes before
publishing: the page builds, and it has a name, a description, a cover
and, for models, examples. Gaps show on the row, in the review panel and
in the publish confirmation, and never block publishing. The demo's new
sample model is left incomplete to show them.
Draft preview now reads at a glance: a blue top edge, a tinted bar, a
'Draft preview' pill with a live dot, and a thin blue frame around the
page. The live view uses green and no frame, so the two never look alike.
… ones waiting

The workflow review panel previews the Hub card with a 'Pending
approval' tag, and the preview's change list says how many workflows
wait for approval, since unapproved ones never appear on a page.
'Preview draft' becomes 'View draft on site', which says where it goes.
Loading submissions moves to one helper the admin and the preview share.
- Split Draft into workflow submissions and content changes. Each
  submission gets explicit Approve and Reject; only approved ones go out
  with the publish, and the rest keep waiting.
- Replace the four count tiles with one line on what still needs a
  decision, what has gaps and what is scheduled.
- Review panel: actions first, a one-line readiness note when every
  check passes, then what changes. Image fields show before and after
  pictures instead of links.
- Undo one draft change (back to the live version), or remove a
  never-published item, from the review panel or the editor. Saves that
  match the live value no longer count as draft changes.
- All content: a Needs attention view runs the readiness checks over
  every page, with a filter per missing field.
- Editor: a live Hub card preview that updates while typing.
- Kind-specific placeholders for missing thumbnails, and video covers
  seek to a frame so they don't render blank.
…d version history

Follows the catalog API's editorial staging so the admin can be wired
to it without reshaping the UX.

- Every draft change, team edit or submitted workflow, is To review,
  Approved or Later. Draft shows one tab per status, with Approve and
  Later on each row and in bulk (workflows can also be rejected).
- Editing an approved change sends it back to review and flags it as
  "Edited after approval".
- Final review opens once nothing is left to review. It lists the
  approved changes, their gaps, and how many stay for later; only the
  approved ones are published (`approved_uids`).
- Deciding in the review panel moves on to the next change.
- The editor lists each save with who made it and when, marks the live
  and current ones, and restores any earlier save into the draft.
- Diffs show dates in readable UTC.
- Staging and version history each go through one module
  (`lib/cms/staging.ts`, `lib/cms/versions.ts`); the demo mock answers
  them, and they are the only files to change for the catalog API.
…e sidebar

The always-on card repeated the name, summary and cover beside the form,
which read as a second set of fields. A View card button in the header
now opens it in a dialog, and the sidebar keeps only settings.
benjcooley and others added 4 commits October 21, 2026 13:59
catalog-styles.test.ts expected .data-[state=checked]:bg-admin-card in the
staff stylesheet, but 412603f removed the last component using that
class, so Tailwind no longer generates it and the test fails. Assert
data-[state=open]:bg-admin-hover instead, the state-variant admin colour the
staff components still use.
The Draft change list now defaults to a natural, case-insensitive name
order. When the server reports when each change was saved, a Sort menu
also offers latest change first; items without a save time follow in
name order.

The save time is read from the staging item's saved_at, where the
backend puts it, falling back to content.saved_at for older reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
benjcooley and others added 2 commits October 21, 2026 21:40
A Vercel preview now reads the catalog from WORKSHOP_CLOUD_BASE_URL, the
Cloud origin the PUBLIC_WORKSHOP_CLOUD_ENV family already selects
(stagingcloud, or testcloud with the workshop-test label), so the preview
no longer depends on SITE_CATALOG_API_URL being set in Vercel. That
variable still overrides the origin for local development and the local
demo. Production keeps the static Hub regardless.

All catalog reads go through catalogApiOrigin(); cmsEnabled() and the
layout's history relay use the same rule.

Co-Authored-By: Claude <noreply@anthropic.com>
The preview deploy for ef7f2b7 was skipped by Actions.

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 22, 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 22, 2026 4:50am UTC
billing-web-test Ignored Ignored Oct 22, 2026 4:50am UTC

Request Review

@benjcooley
benjcooley marked this pull request as ready for review October 22, 2026 05:23
@benjcooley
benjcooley requested review from a team October 22, 2026 05:23
@benjcooley
benjcooley requested review from a team and dante01yoon as code owners October 22, 2026 05:23

Copy link
Copy Markdown
Contributor

Hi Ben, thanks for carrying this forward and wiring it to the real catalog API! I've been away for a week, so some of this may already have been decided in conversations I missed. If so, just point me to it.

I compared this branch (cfcff3a50) with #20640 at a2bbfb4458, mostly to understand where things landed. The Draft page feels very close to the design: the table, tabs and filters, the header checkbox, Publish N changes, and the confirmation with "N changes you didn't pick stay in the draft". A few things I couldn't find, and I wasn't sure whether they were dropped on purpose, planned for later, or just not wired yet:

Screens

  • All content (Active / Needs attention / Archived, popularity, runs and downloads). It looks like the sidebar only passes draft now. Is this coming back, or is the plan to manage content from Draft only?
  • Publish history with restore. Is this waiting on the backend?
  • Add content from a copy of an existing item. Is "new from type" the intended flow now?

Things that seem to be in the code but don't show up

  • Readiness checks. canonical-queue.ts sets gaps: [], so I didn't see any flags on rows, in the panel or in the confirmation. Was that intentional? They only need the document, so maybe they could run on canonical items too.
  • Workflow submissions (Run in Comfy Cloud, the "Pending approval" card). I couldn't see how submissions reach Draft now. Are they handled somewhere else?
  • Undo one change. It seems to post to /admin/actions, which I didn't find registered. Is there a catalog equivalent planned?

Review panel
It now shows the JSON paths with before and after text. I'm curious whether the more readable version could fit with the real data: "See it on the page", before and after images, readable dates, and separate Discard vs Delete. Editors may find the JSON harder to read. Happy to help if it makes sense.

Editor
I noticed version history, View card, inline field errors, the preview link after saving, the 中文 fields, example reordering and media by URL aren't there. I also noticed that runs and downloads are now editable, and that Save and the focus states use yellow instead of graphite. Are any of these deliberate? Especially the editable usage numbers: I thought those would come from analytics.

Preview bar

  • Changed cards don't seem to get labelled or outlined. I think CatalogStaffChrome doesn't pass changes yet.
  • The pending workflows count and the link to the page's editor seem to be gone.
  • In plain Live the bar is hidden. Is that the agreed reading of ADR-0039? I remember we talked about keeping it visible, but I may be out of date.

Wording on Draft
Some things read a bit technical for editors: change-ID chips, the "I understand this unfiltered action…" checkbox, and the "Temporary local test…" copy. Are these temporary for testing, or meant to stay?

A short list in the PR body would help me a lot: what's coming back here, what's a follow-up, and what was dropped on purpose. Then I can close #20640 with a clear picture. Thanks!


Generated by Claude Code

@dante01yoon dante01yoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question: apps/website no longer exists on main. #21861 (merged 2026-10-26) removed the frozen monorepo copy now that comfy.org and the Hub deploy from Comfy-Org/comfy-website, and it disconnected website CI, translation generation and deploy here. This PR's changes would land in a directory that is no longer built or deployed, so I haven't done a line-by-line review in this repo.

Could this be ported to Comfy-Org/comfy-website (and this PR closed)? I'm happy to review it there. If there is a reason it needs to land here first, could you share it?

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:xhigh PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants