Repository navigation
feat(website): add installer dropdown to the download button - #19364
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (7)
💤 Files with no reviewable changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe website now provides a localized “All installers” menu with links for Windows, macOS, and Linux. Installer records provide platform, URL, and translation-label metadata. The hero enables the menu. Component and end-to-end tests cover menu behavior and download destinations. ChangesWebsite installer links
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant HeroSection
participant DownloadLocalButton
participant InstallerMenu
participant User
HeroSection->>DownloadLocalButton: Enable installer menu
DownloadLocalButton->>InstallerMenu: Render menu with locale
InstallerMenu-->>User: Show localized installer links
User->>InstallerMenu: Select installer link
InstallerMenu->>InstallerMenu: Capture selected platform
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The installer menu supplements existing downloads while preserving phone and fallback behavior. No actionable merge-blocking risk is established; merge after normal checks pass. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The dropdown offers fixed installer destinations without accepting user-supplied URLs or granting additional privileges. Existing platform selection remains intact, and the new links disable prefetch and protect the originating page. No material security risk was identified in the reviewed change. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🧩 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 🌐 Website E2ETip All tests passed.
🌾 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 e1fe2a5a4cf9eb8b404cb6b8750eac0b1359a144
Full docs: ADR-DEVEX-LINT-0015 🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-19364.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. This commit: https://website-frontend-led9vvxem-comfyui.vercel.app Last updated: 2026-10-01T07:10:45Z for |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #19364 +/- ##
==========================================
- Coverage 84.62% 84.53% -0.10%
==========================================
Files 3390 3318 -72
Lines 162437 160231 -2206
Branches 42298 41566 -732
==========================================
- Hits 137470 135458 -2012
+ Misses 23048 22966 -82
+ Partials 1919 1807 -112
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 73 files with indirect coverage changes 🚀 New features to boost your workflow:
|
19ec9c3 to
cfe71ce
Compare
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: comment. No blockers at 1264721; one P2 question about analytics, and the rest are P3 test, structure, and PR-description items.
The row does what the summary says on the paths I traced. It uses the same platform || showFallback gate as the button, and it stays hidden on phones. The three hrefs match downloadUrls, and each link opts out of prefetch. Website unit tests, e2e, build, lint, and typecheck are green at this head. Most of what I found is about what the tests and the analytics can't tell apart, plus a few claims in the description that the code does not back up.
Findings without an anchorable line (3, all P3, PR description)
- P3. The prefetch rationale in Review Focus says every link opts out "the same reason the button opts out".
DownloadLocalButton.vue:75only setsdata-astro-prefetch="false"whenbtn.key === 'windows', and the macOS URL ishttps://download.comfy.org/...(useDownloadUrl.ts:8), which is cross-origin, so Astro'sprefetchAll(astro.config.ts:16) never touches it. Setting it on all three links is harmless. The sentence should just say the two Windows router URLs are the reason. - P3. "Stacked on #18543" and "Counted against #18543's branch" are stale. #18543 merged into main at
481d566, which is this PR's merge base, andgit diff --numstat origin/main...HEADgives the same 5 files and +195/-8 as the table. Both notes can go. - P3.
apps/website/AGENTS.mdasks for before and after screenshots on every PR that changes what a visitor sees. The Screenshots section has the preview link and a prose description but no images. One screenshot of each at desktop width, plus the wrapped phone-width row, would cover it.
Existing findings
CodeRabbit approved this head with no actionable comments, and there are no human review threads. Nothing to confirm or contest.
Checked and cleared
- Type safety: no
any, assertions, or suppressions.typecheck:websitereports 0 errors. The inline object-array annotation widenshreftostring, but nothing consumes the literal type, so I left it alone. - Vue and Tailwind idiom: reactive prop destructuring,
useIdfor the label id (Vue 3.5 and sibling components use the same pattern), nodark:, no!important, no class arrays, and no arbitrary values.text-primary-comfy-canvas/70is a defined token that sibling product copy also uses. - Copy: all four keys have
enandzh-CN. Keeping "Windows x64" and "Windows ARM64" the same in zh-CN is fine because those are product names. - Accessibility:
spanplusul[aria-labelledby]gives the list its translated name. The links are native anchors with the default focus ring, and the underline makes them look like links without needing hover. target="_blank"withrel="noopener noreferrer"matches the primary button.- The unrecognized-desktop e2e rewrite still proves what the old href locators proved. The accessible names select only the two fallback buttons, and the href assertions carry over.
- Test isolation:
vitest.config.tssetsmockReset,restoreMocks, andunstubGlobals, sovi.stubGlobal('navigator', ...)and the PostHog mock reset between tests. - The ecosystem-section button (
EcoSystemSection.vue) anduseDownloadUrl.tsare unchanged. - The gate mutation
v-if="true"fails the phone test, and reporting'windows'for every link fails the macOS click test, so both of those are covered.
Coverage
- Depth: standard. I ran correctness, maintainability, idiomaticity, tests, and documentation as separate lanes over all 5 changed files.
- Lenses: blast-radius, regression-risk-reviewer, idempotency, shared-state, boundary-discipline, and fix-root-causes (correctness). Ponytail, no-comments, minimize-reader-load, subtract-before-you-add, laziness-protocol, and migrate-callers (maintainability). typescript-best-practices and type-system-discipline (idiomaticity). designing-test-suites, reviewing-unit-tests, test-mock-quality-analysis, hardening-flaky-e2e-tests, reviewing-playwright-specs, writing-playwright-tests, consolidating-test-setup, and prove-it-works (tests). technical-writing and no-comments (documentation).
- Checks at this head:
vitest run src/components/product/local src/composables/useDownloadUrl.test.ts(37 passed), changed-file eslint (clean),pnpm typecheck:website(0 errors), oxfmt check (clean),playwright test --list e2e/download.spec.ts(collected). I did not build the site or run e2e locally. CIwebsite-e2epassed on all four shards at this SHA. - Mutations (reverted afterwards): gate
true(caught), gate!isMobileUa(not caught), all platforms'windows'(caught), ARM64 platform'mac'(not caught). - Not traced: the external download router behind
comfy.org/download/windows/..., which is not in this repository, and a measured layout-shift number for the hero.
| rel="noopener noreferrer" | ||
| data-astro-prefetch="false" | ||
| class="underline underline-offset-2 hover:text-primary-comfy-canvas" | ||
| @click="captureDownloadClick(installer.platform)" |
There was a problem hiding this comment.
P2 (question). With this handler, a row click on Windows x64, a row click on Windows ARM64, and a click on the main DOWNLOAD DESKTOP button all send the same download_button_clicked event with { platform: 'windows' } (posthog.ts:367-371). So PostHog can't show whether anyone uses the new row, or whether misdetected ARM visitors pick ARM64, which I'd expect to be the main thing to watch after this ships.
Is measuring that in scope? If it is, the smallest change is an extra property on the same event, for example installer: 'windows-x64' | 'windows-arm64' | 'mac-arm64' and source: 'all-installers', and platform stays as it is for existing dashboards. If only the platform split matters, a one-line reply is enough and I'll drop this.
There was a problem hiding this comment.
Keeping the existing platform-only event for this focused dropdown UX change. Measuring architecture or menu-versus-primary usage belongs in a separate analytics follow-up.
|
|
||
| <template> | ||
| <div | ||
| v-if="platform || showFallback" |
There was a problem hiding this comment.
P3. The description says "nothing moves when detection finishes", but this v-if keeps the row out of the SSR HTML. Both download pages mount the hero with client:load, and platform/detected start as null/false and only change in onMounted (useDownloadUrl.ts:76-100). On Windows they change after await needsArmInstaller(). So a new mt-6 line appears under the CTAs after hydration. At lg widths that shift is new: before this PR the download button appeared inside the existing lg:flex-row without adding height.
The row's contents don't depend on detection, so one option is to render it from SSR and only collapse it once isMobileUa is known, which moves the shift to phones, where the email form already swaps in. If the pop-in is acceptable, please drop that sentence from the description.
There was a problem hiding this comment.
The standalone line below the CTAs is gone: the chevron is now attached to the primary download button and appears in the same render. Existing device detection still controls when the primary button appears; the description no longer promises zero layout shift.
|
|
||
| const { locale = 'en' } = defineProps<{ locale?: Locale }>() | ||
|
|
||
| const { platform, showFallback } = useDownloadUrl() |
There was a problem hiding this comment.
P3. This is a third independent useDownloadUrl() in the same hero island, next to DownloadLocalButton.vue:20 and MobileDownloadEmailForm.vue:18. Each call creates its own refs and its own async onMounted (useDownloadUrl.ts:75-103). On Windows that means another getHighEntropyValues call, and on ARM another WebGL context, even though the row never reads downloadUrl or the ARM result. Because the button and the row each await their own client-hints promise, they also don't appear in the same tick, so "renders exactly when the desktop download button does" holds for the formula but not for timing.
The PR already calls out the cost, so this isn't blocking. The cleaner shape is for HeroSection to own one detection result and pass the desktop/mobile decision to its children. DownloadLocalButton is also used on its own in EcoSystemSection, so that could be a follow-up rather than part of this PR.
There was a problem hiding this comment.
Removed useDownloadUrl from InstallerMenu. The menu now lives inside DownloadLocalButton and shares its detection gate, so it adds no client-hints call or WebGL probe and appears with the primary button. Consolidating the two pre-existing button/email detection instances can be a follow-up.
| const installers: { | ||
| platform: Platform | ||
| href: string | ||
| label: TranslationKey | ||
| }[] = [ | ||
| { | ||
| platform: 'windows', | ||
| href: downloadUrls.windows, | ||
| label: 'download.hero.installers.windowsX64' | ||
| }, | ||
| { | ||
| platform: 'windows', | ||
| href: downloadUrls.windowsArm, | ||
| label: 'download.hero.installers.windowsArm64' | ||
| }, | ||
| { | ||
| platform: 'mac', | ||
| href: downloadUrls.macArm, | ||
| label: 'download.hero.installers.macArm64' | ||
| } | ||
| ] |
There was a problem hiding this comment.
P3. The description says "one link per entry in downloadUrls", but this list is written out by hand next to downloadUrls, so that only holds today. If a Linux or macOS Intel URL gets added (the TODO at useDownloadUrl.ts:73-74 expects one), the "All installers" row won't include it and nothing will fail. Keying the metadata by the downloadUrls keys makes a missing entry a type error:
const installers: Record<
keyof typeof downloadUrls,
{ platform: Platform; label: TranslationKey }
> = {
windows: { platform: 'windows', label: 'download.hero.installers.windowsX64' },
windowsArm: { platform: 'windows', label: 'download.hero.installers.windowsArm64' },
macArm: { platform: 'mac', label: 'download.hero.installers.macArm64' }
}with v-for="(installer, key) in installers" :key and :href="downloadUrls[key]" in the template.
There was a problem hiding this comment.
Addressed in 3030ad2: installers in useDownloadUrl.ts is now the one table of URL, platform, and label, the menu iterates it directly, and satisfies Record<string, DesktopInstaller> makes a missing label a type error.
There was a problem hiding this comment.
Confirmed: the menu and primary download button now both use the single installers table, with URL, platform, and typed translation label together.
| it('reports the download under the chosen installer platform', async () => { | ||
| visitWith(UA.windows) | ||
| render(InstallerLinks) | ||
| const macInstaller = await screen.findByRole('link', { | ||
| name: 'macOS (Apple Silicon)' | ||
| }) | ||
| macInstaller.addEventListener('click', (event) => event.preventDefault(), { | ||
| once: true | ||
| }) | ||
|
|
||
| await userEvent.setup().click(macInstaller) | ||
|
|
||
| expect(captureDownloadClick).toHaveBeenCalledExactlyOnceWith('mac') |
There was a problem hiding this comment.
P3. This only clicks the macOS link. I changed the ARM64 entry in InstallerLinks.vue to platform: 'mac' and all 5 tests still passed, so an ARM64 click reported as macOS would go through CI green. A table over the three links covers each mapping with the same body:
it.for([
{ name: 'Windows x64', platform: 'windows' },
{ name: 'Windows ARM64', platform: 'windows' },
{ name: 'macOS (Apple Silicon)', platform: 'mac' }
] as const)('reports $name clicks as $platform', async ({ name, platform }) => {
visitWith(UA.windows)
render(InstallerLinks)
const installer = await screen.findByRole('link', { name })
installer.addEventListener('click', (event) => event.preventDefault(), { once: true })
await userEvent.setup().click(installer)
expect(captureDownloadClick).toHaveBeenCalledExactlyOnceWith(platform)
})If you add an installer property (see the comment on the click handler), this table is where it gets asserted.
There was a problem hiding this comment.
Added a parameterized click test covering the expected platform for all four advertised local installers, including both Windows architectures. Linux ARM64 was removed after checking its cloud/remote-only release scope. The targeted unit tests pass.
| render(InstallerLinks) | ||
| await nextTick() | ||
|
|
||
| expect(screen.queryByRole('list')).toBeNull() |
There was a problem hiding this comment.
P3. This checks the settled phone state but not the state before detection. I changed the gate to v-if="!isMobileUa", which renders the links before onMounted runs and so flashes them on phones, and all 5 tests still passed. Whatever the intended pre-detection state is (hidden today, or rendered if you take the SSR suggestion on the v-if), one assertion right after render(...) and before any await would pin it.
There was a problem hiding this comment.
Added an immediate assertion after render, before any await, that the installer trigger is absent on a phone, followed by the settled-state assertion. The menu is now a child of the primary button gate.
| ])('lists every installer on $label', async ({ userAgent }) => { | ||
| visitWith(userAgent) | ||
|
|
||
| render(InstallerLinks) |
There was a problem hiding this comment.
P3. Every render here uses the default en locale, and the only zh-CN e2e (download.spec.ts, /zh-CN/download) runs under the iPhone UA, where the row isn't rendered. So nothing checks the four new zh-CN strings or that locale reaches t(). One desktop case with render(InstallerLinks, { props: { locale: 'zh-CN' } }) that asserts the list name 全部安装包: and the three labels would cover it.
There was a problem hiding this comment.
Added a desktop zh-CN case that opens the translated 全部安装包 trigger and checks the translated macOS item. Also verified the Chinese download page visually.
| await expect(installers).toHaveText([ | ||
| 'Windows x64', | ||
| 'Windows ARM64', | ||
| 'macOS (Apple Silicon)' | ||
| ]) | ||
| for (const installer of await installers.all()) { | ||
| await expect(installer).toHaveAttribute('data-astro-prefetch', 'false') | ||
| } |
There was a problem hiding this comment.
P3. The three labels here repeat the unit test's inventory (InstallerLinks.test.ts:46-50). data-astro-prefetch="false" is static markup the component test can read directly, and the for loop goes against the "no loops in a test body" rule in docs/guidance/testing-principles.md. I'd add link.dataset.astroPrefetch to the tuple the unit test already maps, then cut this test down to what only a browser proves (the list renders inside the hero on a Windows visit), or drop it, since the other Windows hero tests already cover the island wiring.
There was a problem hiding this comment.
Replaced the loop with one assertion on the complete prefetch-attribute collection. The browser test now also proves ArrowDown opening, Escape closing, and focus returning to the trigger; all 24 download-page desktop/mobile cases pass.
| await expect( | ||
| hero.getByRole('list', { name: 'All installers:' }) | ||
| ).toBeHidden() |
There was a problem hiding this comment.
P3. toBeHidden() passes when the list doesn't exist, and this runs right after goto, before the hero island has hydrated. If client detection wrongly rendered the row on phones, it would show up after this assertion had already passed. The DOWNLOAD DESKTOP check above has the same gap, but that one predates this PR. Waiting for hydration first makes both meaningful:
await waitForIsland(page, hero.getByRole('link', { name: /INSTALL FROM GITHUB/i }))
await expect(hero.getByRole('list', { name: 'All installers:' })).toHaveCount(0)There was a problem hiding this comment.
The phone test now waits for hero island hydration via the GitHub CTA before asserting that the installer trigger count is zero. The desktop/mobile download spec passes.
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: comment. No blockers at 3030ad2. The installer table fixes last round's duplicated list, but the analytics question is still open and most of the P3 test items carry over to the menu.
Compared with the base of this stack, deepme987/ComfyUI_frontend/linux-download (#19478 at 52cf19f). The move to a single installers table is a clear improvement: the menu iterates it, satisfies Record<string, DesktopInstaller> requires a label, and I replied in the old thread. The reka menu itself behaves: mouse, Enter, and Space each fire one captureDownloadClick and one navigation, and the portal items keep data-astro-prefetch="false". None of my earlier comments got a reply. Where a finding still applies I re-anchored it on InstallerMenu.vue or its test and linked the original thread.
Findings without an anchorable line (2, P3, PR description)
- P3, carried from round 1. There are still no before and after screenshots, which
apps/website/AGENTS.mdasks for on every visitor-visible change. This head switched from a row to a dropdown, so an "after" image with the menu open would help reviewers who don't open the preview. - P3, Nit. Review Focus calls
AddToCalendarButton"the site's other reka dropdown".rg -l DropdownMenuRoot apps/website/srcfinds it inBrowseToolbar,HeaderAccountMenu,WorkshopSortMenu,CodeTabsPicker, and the Cinematic menus too. The class strings do matchAddToCalendarButtonexactly, so "an existing reka dropdown" is enough.
Round 1 findings addressed at this head
- P3, hand-written installer list beside
downloadUrls: fixed by theinstallerstable (reply). - P3, "nothing moves when detection finishes": the sentence is gone from the description. The layout shift itself is still there (inline on the
v-if). - P3, prefetch rationale: it now names the Windows same-origin routes, which matches what
DownloadLocalButtondoes. - P3, stale "Stacked on #18543" notes: they now point at #19478, which is the actual base.
- P3, the duplicated e2e inventory: the browser test now opens the real reka trigger and reads the portal items, which happy-dom can't fully prove. Only the loop part remains (inline).
Checked and cleared
- Menu activation: in reka-ui's
MenuItem, pointer clicks and Enter/Space keydowns reach theas-childanchor once, the select event closes the menu without callingpreventDefaulton the anchor click, andcaptureDownloadClickfires once per activation. - Removed
downloadUrlsexport: no consumers remain anywhere inapps/,packages/, orsrc/. - The
installersobject iterates in insertion order, andas const satisfieskeeps literal URLs. - The Linux ARM64 URL is live:
curl -I https://download.comfy.org/linux/appimage/arm64returns a 307 todl.todesktop.com. - A row-versus-menu history sentence in the description is accurate: round 1's head
1264721had the inline row, and #19478's Linux entries would take it to five. - Nothing in
useDownloadUrl.test.tsor e2e asserts that a detected Mac gets the DMG fromdownloadUrl. Pointing that branch at the Linux AppImage keeps all 27 tests green. This PR only renames the reference on that line and the gap exists on the base branch too, so I'm noting it rather than asking for it here. - Idiom: no
any, assertions, or suppressions, and nodark:or!important. The@lucide/vueand reka imports match their sibling components. Both locales exist for all six keys.
Coverage
- Depth: standard. Lanes: correctness, maintainability with idiomaticity, tests, and documentation, all over the 7 changed files, with round 1 findings passed in as hypotheses.
- Checks at
3030ad2:vitest run src/components/product/local src/composables/useDownloadUrl.test.ts(38 passed), changed-file eslint (clean),pnpm typecheck:website(0 errors), oxfmt (clean), andplaywright test --list e2e/download.spec.ts(collected). I did not run e2e locally. - Mutations, all reverted:
windowsArm.platformset to'mac'(not caught), gate!isMobileUa(not caught),t(..., 'en')forced (not caught), MacdownloadUrlpointed at Linux (not caught). A probe test that holds back the second client-hints promise shows the button rendered while the menu is still absent.
| rel="noopener noreferrer" | ||
| data-astro-prefetch="false" | ||
| :class="itemClass" | ||
| @click="captureDownloadClick(installer.platform)" |
There was a problem hiding this comment.
P2 (question), carried from round 1 with no reply yet. Every item sends captureDownloadClick(installer.platform), so Windows x64 and Windows ARM64 both report windows, Linux x64 and Linux ARM64 both report linux, and none of them can be told apart from the main button (posthog.ts:367-371 only takes { platform }). With Linux ARM64 offered only in this menu, whether anyone picks it is now another thing PostHog can't show.
If measuring menu usage or architecture is in scope, an extra property such as installer (the installers key) and source: 'menu' would answer it and leave platform as it is for existing dashboards. If platform is all you need, a one-line reply settles this.
There was a problem hiding this comment.
Keeping the existing platform-only event for this focused dropdown UX change. Measuring architecture or menu-versus-primary usage belongs in a separate analytics follow-up.
| </script> | ||
|
|
||
| <template> | ||
| <div v-if="platform || showFallback" class="mt-6"> |
There was a problem hiding this comment.
P3, carried from round 1. The description no longer says "nothing moves", but the layout shift is still there. platform and detected start as null/false and only change in onMounted (after await needsArmInstaller() on Windows), so this mt-6 block is missing from the SSR HTML and gets inserted under the CTAs after hydration. The trigger is one line now instead of a wrapping row, so the shift is smaller. If that's acceptable, no change is needed. The alternative is to render the trigger from SSR and collapse it once isMobileUa is known.
There was a problem hiding this comment.
The standalone line below the CTAs is gone: the chevron is now attached to the primary download button and appears in the same render. Existing device detection still controls when the primary button appears; the description no longer promises zero layout shift.
|
|
||
| const { locale = 'en' } = defineProps<{ locale?: Locale }>() | ||
|
|
||
| const { platform, showFallback } = useDownloadUrl() |
There was a problem hiding this comment.
P3, carried from round 1. This is still a third independent useDownloadUrl() in the hero island, alongside DownloadLocalButton.vue:17 and MobileDownloadEmailForm.vue:18. On Windows each one makes its own getHighEntropyValues call and, on ARM, its own WebGL probe, and the menu never reads either result. I wrote a probe test that holds back one client-hints promise, and the button renders while the menu is still absent. So "renders exactly when the desktop download button does" holds for the gate formula but not for timing. The PR already acknowledges the cost, so this isn't blocking; having HeroSection own one detection result would fix both.
There was a problem hiding this comment.
Removed useDownloadUrl from InstallerMenu. The menu now lives inside DownloadLocalButton and shares its detection gate, so it adds no client-hints call or WebGL probe and appears with the primary button. Consolidating the two pre-existing button/email detection instances can be a follow-up.
| const itemClass = | ||
| 'flex cursor-pointer items-center rounded-xl px-3 py-2 text-sm text-primary-comfy-canvas outline-none transition-colors select-none hover:bg-primary-comfy-yellow hover:text-primary-comfy-ink focus:bg-primary-comfy-yellow focus:text-primary-comfy-ink' |
There was a problem hiding this comment.
P3. This is a character-for-character copy of itemClass in AddToCalendarButton.vue:55-56. The description says matching that menu is the goal, and with two copies a later focus or token fix to one will quietly leave the other behind. A shared item class, or a small dropdown item component under components/ui, would keep them in step. Leaving it as a follow-up is fine too.
There was a problem hiding this comment.
The installer rows now use icon spacing and larger vertical padding for the attached dropdown, so the item classes differ from the calendar menu. A shared menu-item abstraction can be a follow-up; this PR keeps the design change focused.
| it('reports the download under the chosen installer platform', async () => { | ||
| visitWith(UA.mac) | ||
| render(InstallerMenu) | ||
| const user = await openMenu() | ||
| const linuxInstaller = screen.getByRole('menuitem', { | ||
| name: 'Linux ARM64 (AppImage)' | ||
| }) | ||
| linuxInstaller.addEventListener( | ||
| 'click', | ||
| (event) => event.preventDefault(), | ||
| { once: true } | ||
| ) | ||
|
|
||
| await user.click(linuxInstaller) | ||
|
|
||
| expect(captureDownloadClick).toHaveBeenCalledExactlyOnceWith('linux') |
There was a problem hiding this comment.
P3, carried from round 1. The click test now covers Linux only. I set installers.windowsArm.platform to 'mac' and all 4 tests still passed. Now that platform lives in the installers table, a row for every installer would just repeat the table. One row per distinct platform catches a wrong platform in any family:
it.for([
{ name: 'Windows ARM64', platform: 'windows' },
{ name: 'macOS (Apple Silicon)', platform: 'mac' },
{ name: 'Linux ARM64 (AppImage)', platform: 'linux' }
] as const)('reports $name under $platform', async ({ name, platform }) => {
visitWith(UA.mac)
render(InstallerMenu)
const user = await openMenu()
const installer = screen.getByRole('menuitem', { name })
installer.addEventListener('click', (event) => event.preventDefault(), { once: true })
await user.click(installer)
expect(captureDownloadClick).toHaveBeenCalledExactlyOnceWith(platform)
})There was a problem hiding this comment.
Added a parameterized click test covering the expected platform for all four advertised local installers, including both Windows architectures. Linux ARM64 was removed after checking its cloud/remote-only release scope. The targeted unit tests pass.
| it('offers no installers on a phone', async () => { | ||
| visitWith(UA.iphone) | ||
|
|
||
| render(InstallerMenu) | ||
| await nextTick() | ||
|
|
||
| expect(screen.queryByRole('button')).toBeNull() |
There was a problem hiding this comment.
P3, carried from round 1. This still checks only the settled phone state. I changed the gate to v-if="!isMobileUa", which renders the trigger before detection runs, and all 4 tests still passed. One assertion right after render(InstallerMenu), before await nextTick(), would pin the pre-detection state.
There was a problem hiding this comment.
Added an immediate assertion after render, before any await, that the installer trigger is absent on a phone, followed by the settled-state assertion. The menu is now a child of the primary button gate.
| it.for([ | ||
| { label: 'a recognized desktop', userAgent: UA.linux }, | ||
| { label: 'an unrecognized desktop', userAgent: UA.freeBsd } | ||
| ])('lists every installer on $label', async ({ userAgent }) => { |
There was a problem hiding this comment.
P3, carried from round 1. No case renders with locale: 'zh-CN', and the only zh-CN e2e runs under the iPhone UA, where this menu isn't rendered. Forcing both t(...) calls to 'en' leaves all 4 tests green. One desktop row that opens the menu with props: { locale: 'zh-CN' } and checks 全部安装包 plus one item label would cover it.
There was a problem hiding this comment.
Added a desktop zh-CN case that opens the translated 全部安装包 trigger and checks the translated macOS item. Also verified the Chinese download page visually.
| for (const installer of await installers.all()) { | ||
| await expect(installer).toHaveAttribute('data-astro-prefetch', 'false') | ||
| } |
There was a problem hiding this comment.
P3, Nit. Carried in part from round 1. The duplication point is resolved, since this now drives the real reka trigger and portal. The for loop is still against the "no loops in a test body" rule in docs/guidance/testing-principles.md. One assertion on the whole collection does the same job:
await expect(installers.and(page.locator('[data-astro-prefetch="false"]'))).toHaveCount(5)There was a problem hiding this comment.
Replaced the loop with one assertion on the complete prefetch-attribute collection. The browser test now also proves ArrowDown opening, Escape closing, and focus returning to the trigger; all 24 download-page desktop/mobile cases pass.
| await expect( | ||
| hero.getByRole('button', { name: 'All installers' }) | ||
| ).toBeHidden() |
There was a problem hiding this comment.
P3, carried from round 1. The trigger is absent from SSR, so toBeHidden() passes right after goto whether or not client detection has run. If detection wrongly rendered the trigger on phones, it would appear only after this check had already passed. Waiting for hydration first, and asserting absence directly, makes the check meaningful:
await waitForIsland(page, hero.getByRole('link', { name: /INSTALL FROM GITHUB/i }))
await expect(hero.getByRole('button', { name: 'All installers' })).toHaveCount(0)There was a problem hiding this comment.
The phone test now waits for hero island hydration via the GitHub CTA before asserting that the installer trigger count is zero. The desktop/mobile download spec passes.
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: request changes. website-e2e is red at 35c272a because the Models JS budget test fails by 351 bytes, and this PR's new translation keys account for 519 bytes of the route's total.
The refactor itself is clean. All six round 3 items are fixed, and I replied in each thread. My product, test, and docs passes found nothing new in the code. The one problem is the budget.
Pre-merge blocker:
- P1, Models JS budget exceeded (inline on
translations.ts). The CI log for shard 2 showsmodels-performance.spec.ts:24failing three times out of three withReceived: 1825351,Expected: < 1825000. The description says this budget "passes unchanged", which isn't true at this head.
How I traced the budget failure
- I built
apps/websiteat this head, at8ff6452, and at the baseefeb658, then diffeddist/**/*.js. - Between
8ff6452and this head, only the download-page chunks (DownloadLocalButton,EcoSystemSection,HeroSection) changed, so this commit didn't move the Models route. - Between the base and this head, the shared
translationschunk grows from 580,454 to 580,973 bytes (+519). Every page loads that chunk, including/hub/models/. - A local copy of the budget test that prints its totals (deleted afterwards) measured 1,818,336 bytes on the base and 1,818,855 on this head, a +519 difference. The CI absolute is higher because its build data differs from the committed snapshots.
8ff6452passed on Sep 30 with the same keys, so the route total has also risen by at least 352 bytes from something outside this PR. Without this PR's 519 bytes, today's CI total would be about 1,824,832, under the ceiling. This PR is what tips the route over.
Round 3 findings addressed at this head
- P3, installer reverse-looked-up by URL:
useDownloadUrlreturnsinstaller(reply). - P3 nit,
btn === buttons[0]three times: replaced byhasInstallerMenu(index)(reply). - P3, duplicated icon maps: replaced by one exported
platformIcons(reply). - P3, fallback attachment untested: moving the menu to macOS now fails the new tab-order test (reply).
- P3 nit, test file named for the wrong component: renamed to
DownloadLocalButton.test.ts(reply). - P3 nit,
includeHiddenon the pre-open press: the press now uses a normal locator (reply). - P3, stack dependency missing from the description: now listed under Dependencies.
Rounds 1 and 2 were all fixed or answered, as listed in the round 3 record.
Checked and cleared
- The keyboard e2e doesn't need
waitForIslandbeforeArrowDown. The trigger only exists afteronMounteddetection populatesbuttons, so it can't be in the SSR markup. That line is unchanged since8ff6452, and the download specs pass in CI. - No consumer of the removed
downloadUrl,platform, or GitHub fallback remains inapps/,packages/, orsrc/.MobileDownloadEmailFormonly readsisMobileUa. - Behavior matches
8ff6452for Windows ARM with NVIDIA, Windows x64, macOS, Linux, the unknown-desktop fallback, phones, and the ecosystem button: same URLs, fallback aria labels, prefetch opt-out, and analytics platform. - The macOS URL gap I noted in round 2 is now covered. Pointing the Mac branch at Linux fails
DownloadLocalButton.test.ts("keeps the plain download button outside the hero"). - Mutations: Windows ARM64 platform set to
'mac'and forced-English labels each fail a test. - "33 targeted unit tests":
DownloadLocalButton.test.tsplususeDownloadUrl.test.tsgives 33 passed.
Coverage
- Depth: standard. Lanes: correctness, maintainability, and idiomaticity over the product files; tests and documentation over the specs and the description. Round 3 findings went in as hypotheses.
- Checks at
35c272a:vitest run src/components/product/local src/composables/useDownloadUrl.test.ts(44 passed), changed-file eslint and oxfmt (clean),pnpm typecheck:website(0 errors). Localpnpm buildran at head,8ff6452, and base, plus the budget probe described above. CI:website-unit,website-build,fallow, anddeploy-previewsucceeded.website-e2efailed on shard 2 only, in the budget test.
| 'download.hero.installers.label': { | ||
| en: 'All installers', | ||
| 'zh-CN': '全部安装包' | ||
| }, | ||
| 'download.hero.installers.windowsX64': { | ||
| en: 'Windows x64 (including Snapdragon)', | ||
| 'zh-CN': 'Windows x64(含骁龙电脑)' | ||
| }, | ||
| 'download.hero.installers.windowsArm64': { | ||
| en: 'Windows ARM64 (NVIDIA only)', | ||
| 'zh-CN': 'Windows ARM64(仅限 NVIDIA)' | ||
| }, | ||
| 'download.hero.installers.macArm64': { | ||
| en: 'macOS (Apple Silicon)', | ||
| 'zh-CN': 'macOS(Apple 芯片)' | ||
| }, | ||
| 'download.hero.installers.linuxX64': { | ||
| en: 'Linux x64 (AppImage)', | ||
| 'zh-CN': 'Linux x64(AppImage)' | ||
| }, |
There was a problem hiding this comment.
P1. These keys land in the shared translations chunk that every page loads, which grows it by 519 bytes (580,454 to 580,973 in a local astro build against base efeb658). That pushes /hub/models/ past its whole-route ceiling in e2e/models-performance.spec.ts:56. CI shard 2 at this head fails three times out of three with Received: 1825351, and a local copy of the test measures exactly +519 bytes over base. 8ff6452 passed on Sep 30 with the same keys, so the route had headroom then and has since crept up from elsewhere. But this PR is what crosses the line today, and the description still says the budget "passes unchanged".
Any of these fixes it:
- Get the bytes back on this route. For example, keep the installer labels out of the chunk every page loads, or shorten them.
- Raise the ceiling in this PR with the measured delta, so the reviewer who owns the budget signs off on it explicitly.
- Rebase and show a green
website-e2e, if the drift turns out to be transient.
Please also update the Review Focus line to match whichever you choose.
35c272a to
b9548b9
Compare
b9548b9 to
dca991c
Compare
dca991c to
3585660
Compare
…9505) ## Summary Download buttons name the exact installer they open, with matching accessible names and aligned desktop hero buttons. ## Changes - Show the installer beneath the primary download label for recommended Windows, macOS and Linux downloads and the Windows/macOS fallback. - Keep installer subtitles in normal weight and align the taller download buttons with Install from GitHub. - Cover accessible names, URLs, fallback alignment and multiline/icon-only label heights; isolate installer click tests and tolerate fractional layout differences within half a pixel. ## Review Focus Stacked on Comfy-Org#19364. Verify the primary and fallback button labels and their alignment on `/download/`. Before the final restack, validation passed 14 component tests and 24 focused browser tests against a fresh website build. After removing the checkout prerequisite and integrating both installer fixes, the final stack passes 36 focused installer/composable unit tests. CI has not been checked after this final restack. Controlled layout checks reject descender-space and icon-only excess height while accepting quarter-pixel differences; overriding the accessible names makes all four platform table cases fail. ## Screenshots (if applicable) [Preview](https://comfy-website-preview-pr-19505.vercel.app/download/)
Summary
Attach an installer dropdown to the download hero's primary button so visitors can choose a different desktop installer.
Changes
Review Focus
Screenshots (if applicable)
Preview
Before
Existing after capture, before the concise x64 copy update: desktop
Existing after capture, before the concise x64 copy update: narrow 320px viewport
Existing after capture, before the concise x64 copy update: Chinese