Repository navigation
feat(website): the Hub's Models catalogue behind the flag - #21102
mariana953 wants to merge 5 commits into
Conversation
With hub-home-enabled on, /hub/models/ opens the redesigned catalogue: its own hero with featured launches, category tabs, a how-you-use-it filter, a resolution menu and side-by-side compare. Everyone else keeps today's grid, and the server render is unchanged. The catalogue JSON now carries each model's resolutions and price estimate so the new filter and hero have them. The filter menu learns an optional access group and title without changing what today's pages pass.
|
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 |
📦 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 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 🌾 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. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since b34dd5efbb2b64ed76387eb6927ba8193fb3d4e1
Full docs: ADR-DEVEX-LINT-0015 🌐 Website E2ETip All tests passed.
🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-21102.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. Deployment detailsThis commit: https://website-frontend-kq4591lfe-comfyui.vercel.app Last updated: 2026-10-21T23:11:57Z for |
…s by page Compare stays in the Models catalogue but only shows once its preview switch is on, as agreed in the rollout thread. The tweaks panel now lists each switch under the page it changes with a line on what it does, and sits on the home page and the Models catalogue of preview builds only. Workflows switches leave the list until the Workflows catalogue lands.
Ports #21047 from main. The guard timed the /hub/models/ loader from navigation start, so its 1s grace also covered booting the site's JavaScript on the runner and the catalogue cases failed on timing.
|
#21047 on main fixes this by timing from island hydration. I ported it verbatim in e212c7d; it becomes a no-op once the stack picks up main. Locally, after the port, the catalogue cases pass on repeat. Generated by Claude Code |
dante01yoon
left a comment
There was a problem hiding this comment.
Reviewed against mariana/hub-model-page at e212c7d. The switch follows the pattern from the rest of the stack: hubModels is gated on useMounted(), so the server frame and today's grid/heading are unchanged for flag-closed visitors. Compare is hidden behind its design tweak, and PreviewControls renders only when !isProductionBuild(). The resolutions/priceEstimate additions are optional in presentationSchema, and they come from the website's own Router contract catalog rather than a hand-declared API response type (Gate 3 OK). accessFor/runsHere read build config and the catalogue entry, not account state (Gate 2 OK). CI is green; I did not run the specs locally.
Requesting changes only for added comments, which AGENTS.md and docs/guidance/engineering.md treat as blocking. One sizing suggestion below.
Unanchored
- suggestion: this is ~3.5k non-test lines. As the description already offers, moving Compare (
explorer/compare/*,compare*.ts,same-prompt.ts,data/compareSamePrompt.tsand the 20 sample images, ~1k lines) to its own PR would make this one easier to review. Compare is behind a separate tweak and off by default, so nothing here depends on it shipping together.
| type RenderGuardWindow = Window & { __renderGuard?: RenderGuard } | ||
|
|
||
| const CLS_BUDGET = 0.1 | ||
| // Counted from the moment the page's island hydrates, not from navigation: |
There was a problem hiding this comment.
issue: new // comment block. AGENTS.md bans added comments in tests too, and suggests a test.step name, an it title, or a well-named constant instead. For example, rename LOADER_GRACE_MS to LOADER_GRACE_AFTER_HYDRATION_MS and put the "counted from hydration, not navigation" rationale in the commit message.
| } | ||
| ;(window as RenderGuardWindow).__renderGuard = guard | ||
| observer.observe({ type: 'layout-shift', buffered: true }) | ||
| // Astro dispatches a non-bubbling `astro:hydrate` on each <astro-island> |
There was a problem hiding this comment.
issue: same rule. Extracting the listener into a named function (e.g. recordIslandHydrationInCapturePhase) would carry this rationale without a comment.
| const HOSTED_ACCESS: readonly ModelAccess[] = ['run', 'api'] | ||
| const API_ACCESS: readonly ModelAccess[] = ['api'] | ||
|
|
||
| /** |
There was a problem hiding this comment.
issue: this JSDoc grew from one line to a five-line block explaining callers and rationale. The rule allows only curt JSDoc on exported API. Please trim it back to a single line (e.g. the original "Whether a visitor can run this model from its Hub page.") and move the reasoning to the PR description or a test title.
|
Thanks @dante01yoon, all fair. The added comments (including the long JSDoc in Heads-up: the website moved to Comfy-Org/comfy-website on Oct 22 and Generated by Claude Code |
Summary
Builds on #21101. With
hub-home-enabledon,/hub/models/opens the Hub's Models catalogue: its own hero with a featured-launch carousel, category tabs, a how-you-use-it filter (Run here / API) and a resolution menu. Everyone else, and the server render, keep today's grid.ModelsHalfpicksHubModelsGrid(lazy) or today'sWorkshopModelsGridfrom the same flag gated on mount, asAppsHalfdoes. The Hub grid brings its own h1, soModelsCatalogueemitsheroandModelsPagedrops its heading only while it shows.hub-models-comparedesign tweak on (agreed in the rollout thread to keep it out for now). Off by default, including on the preview.PreviewControlslists each preview switch under the page it changes (comfy.org home, Hub · Models) with a line on what it does. It renders only whenVERCEL_ENV !== 'production', on the home page and the Models catalogue. The Workflows switches leave the registry until the Workflows catalogue lands.catalogue.jsonnow carries each model'spriceEstimate(via a newmodelPriceEstimate, shared with the model page), and browse content addsresolutionsread from each Router input schema; both are optional in the schema. This also fills the resolution column of feat(website): the Hub's model page behind the flag #21101's provider table.FacetSheetand dropped price sorting; none of that is carried. The Hub grid uses today's cards and sheet, and its own sort list (HUB_SORT_ORDERS).WorkshopFilterMenugains an optional access group andtitle;useCaseOptions/useCasesbecome optional, and every existing caller still passes them.model-access,resolution,section-title(optionaltab),hub-list-memory(rememberListOnClick),card-layout(CARD_GRID_BESIDE_NAV),HubFiltervalues, genericsortWorkshopModels.explorer/compare/*,same-prompt, 20 sample images) could move to its own PR if preferred.Verification
vitestovercomponents/workshop,components/home,lib/workshop(2,029 passing) and earlier overconfig,routes,scripts. New: the catalogue switch (flag closed keeps today's grid and heading; open swaps in the Hub grid and its hero), Compare hidden until its tweak is on, the tweaks panel (grouped by page, persists per browser, absent on production), plus the redesign's own specs for the grid, tabs, task sidebar, compare and libs.vue-tsc/astro check0 errors; eslint, oxlint, format, knip and the complexity/duplication audit clean./hub/models/(200) and serves the catalogue JSON with prices and resolutions; the flagged view needs a signed-in staff session and was not viewed from this environment.