Repository navigation
feat(website): the Hub's model page behind the flag - #21101
mariana953 wants to merge 10 commits into
Conversation
The Apps half kept a search toolbar and a Browse-all shelf it had outgrown. Put the Hub's grid in its place — every app as a card, the ones still to come among them, with Show more once the grid runs past a page. AppsHalf picks between the two on the flag, so a visitor it has not answered for reads the Apps half exactly as it is published today, down to its own copy. The upcoming apps and their images come across with it.
The Cinematic Studio and Re-shoot covers are read through the app card data that today's Apps half shares, so they arrive with the change that moves that data behind the flag.
The model page kept a back link and a related-models grid. Put the Hub's page in its place: a trail back to the list the visitor came from, the ways to use the model, a table of the provider's other models, the workflows built on it, and the reworked playground output and examples. ModelPageSwitch picks between the two on the flag, so a visitor it has not answered for reads the page exactly as it is published today. The page data gains the provider rows and the workflows alongside the related models rather than in their place, and the Hub page keeps today's prompt box, the one that grows with what is typed. The Run control's choice moves into runGateFor, which hands the session and credit states to the Studio's gate instead of reading the role on its own.
|
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
|
📦 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 8656fe70ca1039e9174ffcfc1592b5cce75a5ca2
Full docs: ADR-DEVEX-LINT-0015 🌐 Website E2ETip All tests passed.
🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-21101.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. Deployment detailsThis commit: https://website-frontend-pe4awht78-comfyui.vercel.app Last updated: 2026-10-21T22:41:07Z for |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (22.83%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. @@ Coverage Diff @@
## mariana/hub-home-banner #21101 +/- ##
===========================================================
- Coverage 86.28% 85.90% -0.38%
===========================================================
Files 3596 3643 +47
Lines 172410 173462 +1052
Branches 47369 47703 +334
===========================================================
+ Hits 148758 149011 +253
- Misses 21753 22542 +789
- Partials 1899 1909 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
The models listing imported the apps half eagerly, which pulled the apps catalogue code into the first render of /hub/models/ and kept its loader up past the render guard's budget. It now loads on demand, and the hub tab navigation preloads it alongside the apps catalogue.
benjcooley
left a comment
There was a problem hiding this comment.
Builds cleanly on the flag approach: crawlers and flag-off visitors get the server-rendered ModelPage, hydration is safe thanks to the useMounted gate, and runGateFor faithfully replaces the inline gate. But the swap-after-mount design has a real data-loss path for flag-on users (see the blocker), and the change carries a lot of forked code with little test coverage.
| Severity | Count |
|---|---|
| BLOCKER | 1 |
| SHOULD FIX | 7 |
| TRIVIAL | 4 |
Top issues
- BLOCKER: flag-on visitors mount the old
ModelDetailfirst. It consumes the shared form draft, so files uploaded before sign-in are lost on return. It also double-firesmodel_viewed, and a flag reset unmounts the Hub page mid-run (ModelPageSwitch.vue:17). - Hub code and Hub-only data ship to every visitor (static import plus extra island and
page.jsonfields). - Two features in the PR body are dead on this branch: no writer for the list return trail, and no data for the Resolution column (both appear to arrive in #21102).
- A ~1k-line fork of
ModelDetailand the output and API components, at about 13% patch coverage.
Verified by reading head d867d99 against base mariana/hub-apps. Not run locally.
|
|
||
| const mounted = useMounted() | ||
| const hubOpen = useWorkshopFlag(HUB_HOME_FLAG) | ||
| const showHub = computed(() => mounted.value && hubOpen.value) |
There was a problem hiding this comment.
BLOCKER — flag-on visitors mount the old interactive page first, and it eats the form draft.
showHub is false until mount + PostHog answer, so every flag-on visitor first mounts ModelPage → ModelDetail, which runs its own useWorkshopFormDraft(model.slug, …). Both pages use the same key (comfy-workshop-form:<slug>), and without persistFiles, restore() → consumeFiles() deletes the IndexedDB draft.
Scenario: flag-on, signed-out visitor uploads an image on the Hub page → Run → leaveForSignIn stashes it → signs in → returns. The identity change runs adoptNewIdentity → resetNamedFlags(), so the flag is false until reloadFeatureFlags() comes back over the network. Meanwhile the old ModelDetail restores and deletes the draft. The Hub page then mounts with no image.
Same root cause:
ModelDetail.vue:282andHubModelDetail.vue:268can both sendmodel_viewed, double-counting it.- Any later
resetNamedFlags()(identity refresh) flipsshowHubback to false and unmounts the Hub page.onUnmounted→cancelRun()aborts a run in flight.
Fix: latch the choice (once true, stay true), and don't mount the interactive ModelDetail (or don't let it restore drafts / send events) until the Hub flag has settled. Add a test for the flag going true → false → true.
There was a problem hiding this comment.
Still open at 247a4b1: the only new commit is a base merge, and ModelPageSwitch.vue is unchanged.
There was a problem hiding this comment.
Fixed in ad835d1.
- Latch:
HubModelPageloads oncemounted && hubOpenand stays mounted after that, so a laterresetNamedFlags()cannot unmount it or cancel a run. - Hold: the switch provides
LIVE_PAGE_HELD, which is true while the flags are unsettled (useWorkshopEnabledSettled) or while the Hub page is loading or shown. While held, the publishedModelDetailpassesheldtouseWorkshopFormDraft, which does not restore, consume or rewrite the draft. That includes thepersistScalarson unmount, which would otherwise overwrite the stashed scalars with defaults.model_viewedis also gated on!held, so it fires only from the page that stays.
The sign-in scenario is covered: the flag-on visitor's published page never sees held === false. Tests cover the latch with the flag going true → false → true, the hold, and the draft hold (record, token and scalars intact after a held unmount; restore once released). Flag-off pages are unchanged, except that a visitor with no cached flags gets the draft restore when the flags answer (at most 3s).
Generated by Claude Code
There was a problem hiding this comment.
BLOCKER — partly fixed at b34dd5e. The latch works, but a returning visitor with cached hubOpen=true and flagsSettled=true starts with hubChoice='live', so LIVE_PAGE_HELD is false. Child mounted hooks run before the switch parent mounts: ModelDetail starts restoring the shared draft before mounted && hubOpen changes the choice to loading. If the Hub chunk takes longer than the IndexedDB restore, the old page consumes the saved upload and the Hub mounts without it.
Derive the initial hold from the already-known Hub intent, before mount, with a regression test starting at both flags true. The new never-releases test starts unsettled and misses this path. Also preserve state if a later identity answer changes an already-released live page to Hub (as raised in the other open switch thread).
… grid - The two open apps now read their summary and meta line from the Hub copy instead of the live catalogue's taglines; the unused name keys are gone and the card type extends the live one with an optional href. - The tabs to Models and Workflows render above the grid, in the same sticky band the live catalogue uses. - The grid reports a hub_row_viewed impression and clicks under a new app_grid source, so flag-on and flag-off CTR can be compared. - Upcoming apps are built inside HubAppCatalogue, so the list keeps its identity across parent re-renders and stays out of the flag-off chunk. - Upcoming cards drop aria-disabled and the hover zoom; the grid gets an sr-only h2. - Tab prefetch also loads HubAppCatalogue. - Tests: the flag flips after mount, real app slugs, card copy, tabs, HubAppCatalogue rendering and analytics, and usePagedList.
benjcooley
left a comment
There was a problem hiding this comment.
Re-review at 247a4b1.
The only new commit is a merge of mariana/hub-apps into this branch. The PR's own diff is byte-for-byte unchanged (+4130/−7, 48 files), so none of the 12 findings from the previous review are addressed, and all 12 threads are still open with no replies. The merged-in base changes don't affect this PR's code: the only overlap is the app_grid member added to HubItemSource, which is additive.
| Severity | Open |
|---|---|
| BLOCKER | 1 |
| SHOULD FIX | 7 |
| TRIVIAL | 4 |
Still blocking: ModelPageSwitch.vue:17. Flag-on visitors mount the old ModelDetail first, and it consumes the shared comfy-workshop-form:<slug> draft, so files uploaded before sign-in are gone on return. It can also double-send model_viewed, and a flag reset unmounts the Hub page mid-run.
If some of these are intentionally deferred (e.g. the list trail and the Resolution column landing in #21102), reply on the thread saying so and I'll resolve it.
The hub_row_viewed payload listed the seven Soon cards, so per-item click-through could not be compared with the flag-off shelf. The marker now watches the grid itself rather than the section with the tabs.
…il it is chosen - ModelPageSwitch loads HubModelPage on demand and keeps it once shown, so a flag reset during an identity refresh no longer unmounts a run. - While the flags are unanswered or the Hub page is loading, the published ModelDetail neither restores nor rewrites the form draft and does not send model_viewed, so a draft stashed before sign-in reaches the Hub page and the view is counted once. - api_viewed fires once on the Hub page. - Provider rows are built only for router models. - The open-original fallback keeps its external-link icon; RunGateAction imports the shared RunGate type. - A list return trail rejects backslash routes; a workflow naming "Wan 2" no longer claims "Wan 2.2". - Tests: switch latch, hold and first server frame, draft hold, list memory, workflow matching, duration and resolution ranges, page paths and the new page fields.
dante01yoon
left a comment
There was a problem hiding this comment.
Reviewed against mariana/hub-home-banner at b34dd5e, after reading @benjcooley's two reviews and your replies. The switch/latch/hold design in ModelPageSwitch + useWorkshopFormDraft({ held }) addresses the draft-consumption blocker, the Hub page is now a lazy chunk, runGateFor passes role/credits through to studioGate unchanged (no new client-derived server fact, Gate 2 OK), and no hand-written API response types (Gate 3 OK). CI is green. I did not run the specs locally.
Requesting changes for one repo rule only: the diff adds multi-line // comments, which AGENTS.md ("NEVER add code comments") and docs/guidance/engineering.md ("Treat every other added comment as a blocking finding, including comments that explain why") treat as blocking. One open question on the latch, plus a nit.
| nativeJson, | ||
| !!model.execution && model.execution.inputs === undefined | ||
| ) | ||
| // The marks are what the page itself put on the form, taken before anything |
There was a problem hiding this comment.
issue: this file adds about 14 // comment blocks (lines 184–191, 209–211, 357–359, 391–393, 401–403, 410–411, 418–420, 430–432, 460–461, 486–487, 510–511, 519–521). They were copied over from ModelDetail.vue, but in this diff they are new comments, and AGENTS.md / engineering.md treat every added comment as blocking. Please drop them, and move any rationale worth keeping into names, extracted functions, the commit message, or #21604 for the shared useModelRun() refactor.
|
|
||
| const remembered = ref<ListReturn>() | ||
|
|
||
| // Most visitors reach a page from a list, and the way back they want is that |
There was a problem hiding this comment.
issue: same repo rule. This comment is new code. A name like restoreListVisitorCameFrom on the mount callback, or a test title, can carry the "new tab / shared link falls back to the section" rationale instead.
| const hubChoice = ref<'live' | 'loading' | 'hub' | 'failed'>('live') | ||
| const HubModelPage = shallowRef<Component>() | ||
|
|
||
| whenever( |
There was a problem hiding this comment.
question: the latch covers hub → live, but what about live → hub after the page has been in use? Scenario: an anonymous visitor's flags answer with hub-home-enabled off, so flagsSettled goes true, ModelDetail releases its hold, restores the draft (consuming files), and the visitor starts typing or runs a model. Then Firebase restores the session and identifyWorkshopUser → adoptNewIdentity resets the named flags and re-reads them, and hub-home-enabled comes back true for that identity (e.g. staff). The whenever then fires, HubModelPage replaces ModelDetail mid-session, and the unmount drops in-memory form state/files and cancels an in-flight run. Is that reachable in practice (does the session restore always land before the first anonymous answer)? If it is, should the swap only be allowed while the published page has not yet been released (hubChoice === 'live' && !flagsSettled at the moment the flag opens)?
| return { | ||
| slug: other.slug, | ||
| name: other.name, | ||
| href: other.href ?? '', |
There was a problem hiding this comment.
nit-pick (non-blocking): the filter above already requires other.href !== undefined, so ?? '' is only there to satisfy the type. A type-guard filter ((other): other is WorkshopModel & { href: string } => ...) would make the empty-string fallback unnecessary.
|
Thanks @dante01yoon, all three are right. The added comments are my mistake. The live → hub swap is reachable too: if the session restores after the first anonymous flag answer, the page can swap mid-use and drop the form state. The fix is to allow the swap only while the published page hasn't been released yet ( Heads-up: the website moved to Comfy-Org/comfy-website on Oct 22 and Generated by Claude Code |
benjcooley
left a comment
There was a problem hiding this comment.
Re-review scoped to 247a4b1..b34dd5e (ad835d1 plus merged base changes), using the review-pr workflow and three independent subreviews.
The lazy import, one-way Hub latch, SSR coverage, provider-row guard and smaller fixes are verified. I am resolving 11 previous threads: implemented fixes, the explicitly documented #21102 dependencies, and duplication tracked in #21604 satisfy those requests. Hub-only router payload remains deferred.
The upload-loss BLOCKER is still open: cached hubOpen=true / flagsSettled=true gives held=false until the parent mounts, after ModelDetail has started consuming the shared draft. See my reply on the original thread. The new hold also leaves controls enabled and permits header sign-in stashing to overwrite the preserved media pointer; two inline comments cover those gaps.
| Severity | Remaining findings |
|---|---|
| BLOCKER | 1 |
| SHOULD FIX | 2 |
| TRIVIAL | 0 |
Validation: read the incremental diff and surrounding callers, draft storage and flag/identity lifecycle. No tests or browser reproduction run this turn; the exported tree has no installed dependencies. No source changes, checkout, commits or merges.
| nativeJson, | ||
| !!model.execution && model.execution.inputs === undefined | ||
| !!model.execution && model.execution.inputs === undefined, | ||
| { held } |
There was a problem hiding this comment.
SHOULD FIX — the hold defers restore but leaves the form interactive. pending still checks only activity, so while held it is false; gate can become ready and inputsLocked is false. With a slow Hub chunk, a signed-in visitor can edit or start a run on this published page; the swap discards those edits and onUnmounted cancels the run. If flags resolve off instead, delayed restore overwrites edits made during the hold. Include the unreleased hold in the pending/disabled state, and cover interaction during the hold.
| let released = !held?.value | ||
|
|
||
| function persistScalars() { | ||
| if (!released) return |
There was a problem hiding this comment.
SHOULD FIX — this guard protects scalar writes, but stash() / saveFiles() still mutate storage while held. The header Sign in action invokes the registered stash even before restoration. With a saved upload and a slow flag/chunk answer, restoration is still undefined and persistFiles is false, so saveFiles() replaces the existing :media token with a new token containing the un-restored defaults/null media. The original upload is then unreachable on return. Skip stashing until the draft has been released, and test sign-in during the hold preserves the original token and files.
Summary
Builds on #21100. Replaces the router model page with the Hub version. The new page has:
ModelPageSwitchpicks between the two pages on the samehub-home-enabledflag. With the flag closed, the route rendersModelPageexactly as it is published today. The server rendersModelPagetoo, so hydration matches before the flag answers.HubModelPageloads on demand once the flag is on, and stays once shown, so an identity refresh that resets flags cannot unmount a run. Until the flags have answered, and while the Hub page loads, the publishedModelDetailholds back (LIVE_PAGE_HELD). It does not restore or rewrite the form draft and does not sendmodel_viewed. A draft stashed before sign-in therefore reaches the Hub page, and the view is counted once. Flag-off visitors without cached flags get their draft restored when the flags answer (at most 3s).prepareModelPageand thepage.jsonschema gainproviderModelsandworkflowsnext torelated/relatedHeading, not in their place. Both are built only for router models and default to[].WorkshopModelgains an optionalresolutions.resolutionson catalogue entries) and the writer of the return trail (rememberListOnClick) land in feat(website): the Hub's Models catalogue behind the flag #21102. In this PR alone, the Resolution cell shows "—" and the trail falls back to the section link.runGateFor. It handles the page-specific states (resolving, rolling out, a restoring draft) and hands session and credits to the existingstudioGate. The role is passed through as received, so no new code reads it (ADR API-SERVER-FACTS-0042).useCinematicLeaveGuardinstead of its own beforeunload and link-capture listeners.PlaygroundField, which grows with the prompt.hub-list-memorystores under its own key, so it cannot consume the shelf memory that today's catalogue writes. It accepts only same-site paths.HubModelDetail,HubPlaygroundOutputandHubApiTabcopy their published counterparts. website: share the model run logic between ModelDetail and HubModelDetail #21604 tracks merging them into a shareduseModelRun()after the stack lands.Verification
Unit tests cover:
useWorkshopFormDraftrunGateForhub-list-memory,model-workflows,model-rangesandpage-pathsprepareModelPagefieldsThe specs for today's
ModelDetail(including its SSR spec) still pass.vue-tscreports 0 errors. Lint, format, the server-facts gate and the duplication/complexity audit are clean on the changed files.Not yet viewed in a browser from this environment. Check both states on the preview deployment.
Generated by Claude Code