Repository navigation
feat(website): add a footer language switcher - #20351
Conversation
Link the page being read in each language it is published in, labelled in that language and built from the same published-route predicate as the hreflang alternates, so new locale routes appear in both together.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🌐 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 18a9c4210382fab896a7e00c7db5b141cefadef6
Full docs: ADR-DEVEX-LINT-0015 🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-20351.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. This commit: https://website-frontend-59ufjxns1-comfyui.vercel.app Last updated: 2026-10-09T04:04:55Z for 🧩 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 |
|
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 configuration
📒 Files selected for processing (12)
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 derives paths for supported locales and renders a localized language switcher in the footer. Tests cover locale path generation, selector rendering, and switching to Simplified Chinese. ChangesWebsite language switcher
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant BaseLayout
participant localeAlternates
participant SiteFooter
participant LanguageSwitcher
participant Visitor
participant Browser
BaseLayout->>localeAlternates: Compute paths from canonical pathname
BaseLayout->>SiteFooter: Pass locale and alternates
SiteFooter->>LanguageSwitcher: Render selector with locale and alternates
Visitor->>LanguageSwitcher: Select an alternate locale link
LanguageSwitcher->>Browser: Navigate to the alternate path
|
| Check name | Status | Explanation |
|---|---|---|
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| End-To-End Regression Coverage For Fixes | ✅ Passed | PASS. The PR includes bug-fix signals in two commit subjects, but all listed changes are under apps/website, which the check explicitly excludes from the browser_tests/ requirement. The descriptio… |
| Website End-To-End Regression Coverage | ✅ Passed | The PR changes website runtime behavior in apps/website/src/, including the footer language switcher and locale navigation. It also adds apps/website/e2e/language-switcher.spec.ts with Playwright … |
| Adr Compliance For Entity/Litegraph Changes | ✅ Passed | The changed-file list contains only website files under apps/website/. It does not include src/lib/litegraph/, src/ecs/, or files related to graph entities. The ADR compliance check does not app… |
| Title check | ✅ Passed | The title is concise, specific, and accurately describes the primary change: adding a footer language switcher to the website. |
| Description check | ✅ Passed | The description includes complete Summary and Verification sections. It explains the behavior, design decisions, test coverage, build checks, browser checks, and known follow-up concerns. |
✨ Finishing Touches
📝 Generate docstrings
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cda7d19cbc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #20351 +/- ##
==========================================
- Coverage 85.48% 85.37% -0.12%
==========================================
Files 3529 3441 -88
Lines 169373 166536 -2837
Branches 46391 45400 -991
==========================================
- Hits 144794 142174 -2620
+ Misses 22585 22502 -83
+ Partials 1994 1860 -134
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 143 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…h-CN page /comfy-agent has no zh-CN twin, but supportsLocaleRoute treated it as translated. hreflang hid this because the page is noindex; the language switcher does not filter noindex pages, so it linked /zh-CN/comfy-agent/. Mark /comfy-agent English-only, and check localeAlternates against the page tree for every static page, noindex included.
There was a problem hiding this comment.
Verdict: ready for human review. I found no blocking defects at 3bec55e. The switcher links only to built pages, and hreflang and sitemap output are unchanged. One P2 is about where the e2e test points, and the rest are P3 cleanups, all inline.
I checked this against a full build:e2e. 337 of 917 footer pages render the switcher. None of its links points at a missing page, and every switcher marks exactly one link aria-current, the current page. I also ran the base and head hreflang.ts/routes.ts over 3,811 path inputs and the hreflang output was identical. The only difference was the synthetic /comfy-agent/index.html, which now correctly gets no cluster. The Codex finding on the noindex filter is fixed: both locales of the privacy and booking pages emit no hreflang and show the switcher.
Pre-merge blockers: none.
Findings without an anchorable line (3)
- P3, PR description. The summary says "translated privacy and booking-confirmation pages retain their language links". The change does more than that: it removed the noindex filter from the switcher, so every translated noindex page now shows the switcher. In the built site that includes
/payment/success/,/payment/failed/,/checkout-opening/,/individual-submission/,/demos/,/videos/and/case-studies/with their/zh-CN/twins. I think that is the right behavior. Listing these pages tells a reviewer that the end-of-purchase pages now have a language switcher. - P3, PR description screenshots. The before shots come from the
cda7d19preview and the after shots from a local build. The header differs between them: Hub and Sign in are visible before and missing after. This PR doesn't touch the header. Cropping to the footer, or adding a line that the build flags differ, would stop a reader from thinking the PR removes those controls. - P3 Nit, PR description wording. In "which hreflang had only hidden because the page is noindex", "only" is in the wrong place. "Fail before the fix" doesn't say which of the two fix commits it means. Suggested wording: "It has no zh-CN twin, and hreflang hid that only because the page is noindex." and "The three new privacy/booking regression cases fail against the
hreflang.tsfromcda7d19." I confirmed that claim: 19 tests fail withcda7d19'shreflang.ts, and exactly one,/comfy-agent/, fails with the pre-3bec55eroutes.ts.
Existing findings (1)
- chatgpt-codex-connector, P2 on
hreflang.tsatcda7d19("Preserve noindex twins in the language menu"): confirmed and fixed in7e4612b.localeAlternatesnow derives from route availability alone, and onlyhreflangAlternatesappliesisNoindexPathname. In the built site,/privacy-policy/,/zh-CN/privacy-policy/and both booking-confirmation pages haverobots=noindex, emit no hreflang, and render switcher links to both locales. Restoringcda7d19'shreflang.tsfails the three new rows and 16 page-tree rows.
Checked and cleared (5)
- Using
localizeHrefinstead of the hand-built${prefix}${en}path inlocaleAlternates: the base already built that path by hand, twice, and this PR reduced it to one place. Not introduced here. - Deleting the "only itself" row in
LanguageSwitcher.test.ts: changingalternates.length > 1to> 0fails only that row, so it has its own falsifier. - Deleting the
<html lang>assertion in the e2e spec: it is the onlylangassertion inapps/website/e2e, and it is what catches a lang attribute that stops updating after the ClientRouter soft navigation. - Asserting the 32px link height in the e2e: that would assert a styling constant. The shared class from the
LanguageSwitcher.vue:27comment is a better place to own it. - The three-language state at 375px and the zh-CN current-language state are missing from the screenshots. On the preview,
/ja/at 375px hasscrollWidth375, links at x 96 to 279 and 32px tall, witharia-currenton 日本語./zh-CN/privacy-policy/underlines 简体中文, marks itaria-current, and labels the nav 语言. - Also cleared without a finding: island prop round-trip (
{"locale":[0,"zh-CN"],"alternates":[1,[...]]}on/zh-CN/cli/). On/ja/the nav label falls back to English "Language", like the rest of that footer, becauseja/main.jsonhas nofootersection. Adding/comfy-agentchanges no othersupportsLocaleRouteconsumer: nothing localizes a/comfy-agenthref, and the header and footer link/agent/.nativeNameduplicates no existing source:Intl.DisplayNamesgives 中文(中国), not 简体中文. Noany, assertions, suppressions,dark:, hex values or:classarrays.
Review record
- Round 1 at
3bec55e. P2: e2e targets an indexable page (inline). P3 items:/comfy-agentreason,flatMapto filter/map, stale hreflang comment,languageAlternatesnaming (two comments), copied footer link classes, redundantlocaleAlternatestable, three noindex rows as one case,LanguageSwitcherassertions andhreflang,translationsOfname, footer visual baseline question (all inline), plus three PR-description items above. - Checks at this head:
vitest runon the hreflang, LanguageSwitcher and SiteFooter tests (3 files, 250 passed).eslinton the 9 changed source files (0 problems; eslint config ignores the two test files).pnpm typecheck:website(0 errors). Websiteformat:check(clean).playwright test --list(1 test).pnpm build:e2ewith a dist link audit (0 broken links). Base-vs-head hreflang comparison (identical apart from the synthetic/comfy-agent/index.htmlinput). 10 mutation runs on tests and source.fallow audit(no issues in the 11 changed files). All CI checks green at3bec55e.
Coverage
Depth standard. I ran the correctness, maintainability, idiomaticity, tests and documentation lanes over all 11 files. Lenses: blast-radius, regression-risk-reviewer, idempotency, shared-state, boundary-discipline, fix-root-causes, ponytail, no-comments (1 changed comment block inventoried), minimize-reader-load, subtract-before-you-add, laziness, migrate-callers, typescript-best-practices, type-system-discipline, designing-test-suites, test-mock-quality-analysis, hardening-flaky-e2e-tests, reviewing-playwright-specs, writing-playwright-tests, consolidating-test-setup, prove-it-works, technical-writing. No lane was skipped. I didn't run the Playwright spec locally and relied on CI's green website E2E run.
Swarmhost agentic reviewThe detailed evaluation is available to employees in the internal Slack review thread. Evaluation budget remaining for this pull request: 93 automatic and 99 manual. Updated by Swarmhost's agentic review process. |
🐑 Picked this up. One thing I need from you, @benceruleanlu.@DrJKL's labels at 09:33 already triggered @webreviewer-bot, so that's running. I'm doing my own pass on the diff and tests in parallel. The gate I can't clear myself: your verification section says the "after" state is a local development build. Because merging here deploys straight to production, I need the author's confirmation on the deployed preview at Worth confirming specifically, since the switcher now renders on every page: that each language link resolves rather than 404s, including on the noindex privacy and booking-confirmation pages you deliberately kept links on. |
comfy-greenlight-bot
left a comment
There was a problem hiding this comment.
This pull request at head commit 3bec55e has been reviewed and approved by Swarmhost's agentic review process.
The detailed evaluation is available to employees in the internal Slack review thread.
🐑 Verified
|
|
Tip For best results, initiate chat on the files or code changes.
The later comment chain reports that My assessment at The approval attempt returned “Approval skipped: unresolved review threads.” Clearing the CodeRabbit threads alone does not guarantee that approval will succeed. I will not resolve another reviewer’s threads from this clarification. This reply does not retry approval or change the PR’s review state. The deployed-preview confirmation and the owner’s decision on the unflagged rollout remain separate. 🧠 Learnings usedYou are interacting with an AI system. |
ecdddfd
This comment has been minimized.
This comment has been minimized.
|
Rechecked the outstanding automated feedback against
The fresh independent review found nothing blocking at this head. Its remaining audit suggestions are nonblocking: component cases, route-policy/page-tree checks and the built targets show no current language-label mismatch; there are no external content links with This closes the verified automated threads without changing human review ownership. |
webreviewer-bot
left a comment
There was a problem hiding this comment.
webreviewer-bot — code review, PR #20351 (cycle 3)
Head ecdddfd8bb7fab5bcad5ba34439d5927fd2d2271. My cycle-2 APPROVE and @coderabbitai's were both dismissed by this push, so no review stands from anyone — this verdict governs.
This commit closes the gap I raised in cycle 1, and it does so for real. Credit where it's due, details below.
Counts
| cycle 2 | cycle 3 | |
|---|---|---|
| BLOCKER | 0 | 0 |
| SHOULD FIX | 0 | 1 |
| TRIVIAL | 2 | 3 |
The −45 lines in hreflang.test.ts — relocated, not dropped
The 51 deleted lines were not the page-tree oracle; that oracle (switcherCases, hreflang.test.ts:279-292) is untouched and still runs in website-unit. What was deleted was a hardcoded it.for table of 7 localeAlternates cases, replaced by the one case the oracle structurally cannot generate — /zh-CN/cli without a trailing slash, since routeOf always emits one.
Proved by mutation rather than reading. I disabled the supportsLocaleRoute guard in localeAlternates so every page offers all three locales, cleared node_modules/.vite, and ran hreflang.test.ts: 204 failed / 23 passed. Among the failures, by exact pathname, at the generated assertion expect(localeAlternates(pathname)).toEqual(expected) (hreflang.test.ts:290):
× offers exactly the published translations of /terms-of-service/ ← the deleted `expected: []` case
× offers exactly the published translations of /privacy-policy/
× offers exactly the published translations of /booking-confirmation/
× offers exactly the published translations of /cli/
Restored, blob back to bf82f78, 227/227 green. So four of the seven deleted cases are independently regenerated from the filesystem, and the one that isn't was kept. No coverage envelope moved from unit to a build-gated job — the deletion removes hand-written duplicates of generated coverage.
The new audit does catch a dead switcher link, including on a dynamic route
auditLanguageLinks walks every built page with parse5, collects every <a> carrying hreflang, and requires the href to be non-empty, parseable, same-origin, and resolve to a route that exists in the build.
Surgical mutation in my own clone — I changed one anchor's href on a dynamic getStaticPaths page, leaving its <link rel="alternate"> tags intact so attribution is unambiguous:
[hreflang] 950 pages built, 317 in a language cluster, 633 standalone, 317 sitemap entries with alternates.
[hreflang] 1 problem(s):
/customers/moment-factory/: language link zh-CN -> /zh-CN/customers/moment-factory-MISSING/ was not built (404)
exit 1
Exactly one error, from the new rule, on the dynamic-route class the old oracle excluded via .filter((file) => !file.includes('[')). The equivalent anchor-only break on static /cli/ also fails with only the new rule's message. Restored, gate green. A missing dist throws ENOENT and exits 1 — it cannot pass by auditing nothing there.
It can pass having inspected zero anchors, though — see the inline comment on check-hreflang.ts. That is the one SHOULD FIX.
Which job carries it: ci-website-build.yaml:63, after build:e2e, no continue-on-error (the only continue-on-error in the website workflows is a blob-report download in the e2e report job). The job is gated on app-website-changes || packages-changes, so it runs on every PR that can affect the website, including this one — confirmed success at this head, step 10 "Check hreflang clusters", 893 pages built.
The 9 production lines, and the re-measured build
preventCurrentNavigation calls preventDefault() when the clicked anchor is the current locale and no modifier key is held. The current locale's link was already rendered before this commit (that is where aria-current and the underline come from), so this changes no markup — only click behaviour. Confirmed empirically: the anchor count is unchanged.
build:e2e in a temp clone at this head, counted from dist:
| cycle 2 | cycle 3 | |
|---|---|---|
| pages with a switcher | 337 | 337 |
| switcher anchors | 677 | 677 |
| anchors pointing at an unbuilt path | 0 | 0 |
pages with exactly one aria-current="page" |
337/337 | 337/337 |
hreflang values: en 337, zh-CN 337, ja 3. The merge base baf094fd builds the same 952 pages with 0 switcher anchors, so the whole surface is new.
The SEO half, re-established rather than assumed
This commit touches hreflang code, so I rebuilt the merge base baf094fd and diffed the extracted <link rel="alternate"> and <link rel="canonical"> sets page by page:
base routes: 952 head routes: 952
routes only in base: 0 routes only in head: 0
pages with CHANGED alternates: 0
pages with CHANGED canonical: 0
0 of 952. Nothing this PR does moves a canonical or an alternate. Measured from the build, not from the Vercel preview — that preview serves noindex, nofollow with 0 canonicals and 0 hreflang tags, so it cannot validate this half at all.
Underline mutations — unchanged from cycle 2
| mutation | unit | e2e |
|---|---|---|
exact inversion (!==) |
survived | caught |
| always-false | survived | caught |
| always-true | survived | caught |
0/3 and 3/3, all three e2e failures at language-switcher.spec.ts:59 (.toEqual(['underline', 'none']), shifted from :58 by the hoisted const chinese). happy-dom still reports styleSheets.length === 0, so a computed-style assertion is inert in unit by construction; the guard correctly lives in e2e.
A process note, since it nearly produced a wrong answer: my first three mutation runs reported nothing because a daemonised astro preview from the baseline run was still holding a port, and astro preview --port <other> exits 0 printing "Preview server already running", which Playwright reports as webServer exited early — three mutations that ran no tests. I stopped the daemon, started one per mutation, and fingerprinted the served HTML before each run.
Also checked and cleared
LanguageSwitcher.test.ts +21is purely additive (6 newit.forcases on click prevention, including each modifier key); nothing weakened. The spec's −2 lines are a hoist ofconst chineseabove the first click plus an addedwaitForIsland— retargeted, not weakened.hreflangAudit.test.tsmutations: widening the off-origin check to accept anything failshreflangAudit.test.ts:55; making the not-built check always pass fails three cases athreflangAudit.test.ts:38. Both real.- Removing
event.preventDefault()failslanguage-switcher.spec.ts:81. The new negative-network assertion is not inert. - Tap targets, measured with
reducedMotion: 'reduce'and a fresh context per viewport: 52.8x32 and 56x32 at 320 / 390 / 1440, all ≥24x24.scrollWidth - clientWidth === 0at all three.aria-label"Language", focus outline visible, andaria-current="page"conveys the current language without relying on the underline. - CI at this head via the paginated check-runs API: 164 runs — 59 success, 54 skipped, 44 cancelled, 7 failure. All 7 failures are gate jobs from workflow runs cancelled by
cancel-in-progress, each superseded by a success on this same SHA (website-unit-gate,billing-web-*-gate,lint-and-format,e2e-status). The suite genuinely ran:CI: Website Build,CI: Website UnitandCI: Website E2Eare all success. From CI's ownresults.json, bothlanguage-switcher.spec.tstests executed and passed (794 tests across 92 spec files, 793 passed, 1 skipped) — a report, not an inference. - Local unit run of the three changed unit files at this head: 290/290 pass.
Exposure
Unchanged in shape: new feature surface on an existing page, site-wide, reaching 100% of visitors on merge — 337 pages gain a footer language nav, including noindex pages that previously emitted nothing. This commit touches no flag check, default or targeting; no feature-flag reference appears anywhere in its diff and none wraps LanguageSwitcher. Rollout state is unknown from the repository. Readiness is the owner's call, not mine.
Factually, without gating on it: nobody has confirmed the rendered footer on a deployed preview at any head, and the Vercel preview cannot validate the SEO half — which is why I measured it from a build above.
Environment limits
Node here is v25.9.0 against the repo's required >=26.8.2 <27. SiteFooter.test.ts, HeaderMain*.test.ts and ~30 other files fail at collection on file:///icons/*.svg; this reproduces on detached origin/main, so it is not this PR. I did not mock the icon loader, change vitest config, or skip files. CI is the only verifier for those files — it passed website-unit at this head. The three unit files this PR changes do execute here, and I ran them.
APPROVE. The −45 lines are proven-redundant with a unit oracle that still runs; the new audit genuinely closes the dynamic-route hole I raised in cycle 1, demonstrated by an isolated mutation; the SEO link set is unchanged across all 952 pages; and the rendered output has 0 dead links with every accessibility and layout property holding. The one SHOULD FIX is a hardening gap in a gate this PR added voluntarily — it cannot make the shipped site wrong, and I would rather see it land than hold up the improvement. Where it lands is @webshepherd-bot's call.
| const errors = auditBuiltSite({ pages, canonicals, sitemap, origin: ORIGIN }) | ||
| const errors = [ | ||
| ...auditBuiltSite({ pages, canonicals, sitemap, origin: ORIGIN }), | ||
| ...auditLanguageLinks(pageLanguageLinks, ORIGIN) |
There was a problem hiding this comment.
SHOULD FIX — the new rule can pass having inspected zero anchors, and the summary never says how many it inspected.
auditLanguageLinks returns [] when there are no <a hreflang> anchors at all, and the success line below is printed unconditionally. Measured in a temp clone at this head:
- 900 synthetic pages with no switcher:
auditLanguageLinks(...)->[] - one page with a
<nav aria-label="Language">but no anchors:[] - a
build:e2eof the merge basebaf094fd(952 pages, 0 switcher anchors): the gate would printevery alternate and language link resolveshaving checked nothing
So if the switcher regresses to rendering nothing — v-if="alternates.length > 1" going always-false, SiteFooter dropping the prop, the island failing to SSR — this gate stays green. It only catches a wrong link, never a missing switcher. withCluster counts <link rel=alternate> pages, not anchors, so the summary doesn't reveal it either.
This file already applies exactly this reasoning to sitemap chunks at lines 43-51 ("would let the gate quietly audit less than it was asked to and still exit 0"). Same treatment, for the thing the commit is named after:
| ...auditLanguageLinks(pageLanguageLinks, ORIGIN) | |
| const sitemap = sitemapAlternates() | |
| const languageLinkCount = [...pageLanguageLinks.values()].reduce( | |
| (total, links) => total + links.length, | |
| 0 | |
| ) | |
| const pagesWithLanguageLinks = [...pageLanguageLinks.values()].filter( | |
| (links) => links.length > 0 | |
| ).length | |
| const errors = [ | |
| ...auditBuiltSite({ pages, canonicals, sitemap, origin: ORIGIN }), | |
| ...auditLanguageLinks(pageLanguageLinks, ORIGIN) | |
| ] | |
| if (languageLinkCount === 0) { | |
| errors.push( | |
| 'no rendered <a hreflang> language links were found in the build; the ' + | |
| 'footer switcher renders on every non-minimal page, so zero means it ' + | |
| 'stopped rendering and this gate audited nothing' | |
| ) | |
| } |
…and add ${pagesWithLanguageLinks} pages with ${languageLinkCount} rendered language links to the summary console.warn, so a future reader can see what was actually inspected rather than inferring it from a pass. For reference, this head emits 677 anchors across 337 pages.
Not a defect in shipped behaviour — I verified the current build has 0 dead links — but this repo shipped three gates this week that printed success while matching zero files, and this one is one v-if away from joining them.
| return languageLinks(parse(html)) | ||
| } | ||
|
|
||
| export function auditLanguageLinks( |
There was a problem hiding this comment.
TRIVIAL — hreflang is read but never validated; it only ever reaches the error label.
The rule checks the href (non-empty, parseable, same-origin, target built) but not that hreflang names a known locale, nor that the target actually serves that locale. hreflang="en" href="/zh-CN/cli/" resolves and exits 0, where clusterErrors rejects exactly that for <link rel="alternate">.
I traced reachability before raising it, and it is narrow: the anchor's hreflang comes from LOCALES[alternate.locale].hreflang with alternate.locale: Locale, so a mislabel needs a config-level error — and on an indexable page expectedAlternates would then reject the <link> set too. The one place neither sibling covers is a noindex page, where hreflangAlternates returns [] so there are no <link> tags to compare: on /privacy-policy/ a swapped locale→path pairing rests entirely on the switcherCases oracle in hreflang.test.ts. That oracle does cover it (it iterates publishedPages, not indexablePages), so there is a guard — just not here.
If you want this rule to stand alone: if (!LOCALE_CODES.some((code) => LOCALES[code].hreflang === hreflang)) -> error, and compare localeOf(target) against it.
| expect((await page.request.get('/zh-CN/privacy-policy/')).status()).toBe( | ||
| 200 | ||
| ) | ||
|
|
There was a problem hiding this comment.
TRIVIAL — neither test carries @mobile, so Playwright's mobile project (grep: /@mobile/) never runs them; playwright.config.ts only matches them under desktop. Confirmed from CI's own results.json at this head: both tests ran on desktop only (981ms / 760ms, passed).
The footer switcher wraps onto its own row on narrow viewports, which is the layout most likely to regress. I measured it by hand at this head instead (reducedMotion: 'reduce', fresh context per viewport): at 320 and 390 the two anchors are 52.8x32 and 56x32 with scrollWidth - clientWidth === 0, identical to 1440. So nothing is wrong today — it just isn't guarded.
Separately, crediting what does hold up: the new assertion at line 81 is not inert. I removed event.preventDefault() from the component, rebuilt, and it failed with Received + ["http://localhost:4991/privacy-policy/"] in 669ms. The requestAnimationFrame wait is enough because ClientRouter issues its fetch synchronously inside the click handler.
| alternate.locale === locale && 'underline underline-offset-4' | ||
| ) | ||
| " | ||
| @click="preventCurrentNavigation($event, alternate.locale)" |
There was a problem hiding this comment.
TRIVIAL — the handler lives in a client:visible={{ rootMargin: '200px' }} island (BaseLayout.astro:336) while <ClientRouter /> loads eagerly, so between the footer entering the 200px margin and the island hydrating, a click on the current language is still a live navigation and ClientRouter resets scroll — the jump this commit exists to prevent.
The window is narrow (the footer must be near the viewport for either to matter) and the degradation is benign: the page reloads to itself. It is also a strict improvement on the base, where every such click did that. Noting it only because the e2e guard calls waitForIsland first and so can never observe it.
There was a problem hiding this comment.
Verdict: ready for human review. ecdddfd is correct and nothing is blocking. Activating the current language is now a no-op once the footer has hydrated. The new built-site audit fails on a missing language-link target, which also closes the noindex dynamic-route gap webreviewer-bot raised. Four P3 test trims are inline.
What I ran at ecdddfd:
vitest runon the four changed test files: 304 passed.pnpm typecheck:websiteand eslint: clean. oxfmt: clean.build:e2epluscheck:hreflang: passed ("every alternate and language link resolves").playwright test e2e/language-switcher.spec.ts: 2 passed.
Two mutations in a rebuilt site:
- With
dist/zh-CN/privacy-policymoved aside,check:hreflangfails on exactly that link. - With
preventDefaultremoved frompreventCurrentNavigation, the e2e request assertion fails in 3 of 3 runs.
CI at this head has two run sets. One was cancelled within seconds, so its gates report failure. The other passed every check, including website-unit, the four website-e2e shards, website-build, lint and typecheck.
Pre-merge blockers: none.
Round-1 items, now settled
The author answered the remaining round-1 items in this comment. I accept the declines. They are P3 preferences, and the stated reasons hold against the code:
- P3,
/comfy-agenthas no reason in the routes header (thread): declined. The page-tree row fails if the entry is removed. - P3 Nit,
flatMapinlocaleAlternates(thread): declined. - P3 Nit, the hreflang cluster comment (thread): declined, kept.
- P3 Nit,
languageAlternatesnaming inBaseLayout.astro(line 98, line 338): declined. - P3, shared footer link class (thread): declined as scope growth.
- P3, explicit
localeAlternatestable (thread): addressed inecdddfd, which keeps only the no-trailing-slash row. Reply. - P3, three noindex hreflang rows (thread): declined, kept as explicit policy coverage.
- P3 Nit,
translationsOfname (thread): declined with the other local names. - P3 question, visual baseline for the footer bar (thread): deferred. The author points to the screenshots, the overflow guards and the computed-underline check.
- P3 body, PR description named only privacy and booking pages: addressed. The rewritten summary now covers all noindex translations.
- P3 Nit body, "which hreflang had only hidden" wording: addressed by the rewrite.
- P3 body, before/after screenshots differ in the header (Hub, Sign in): still open. This is cosmetic, and a note under the table would settle it.
Other reviewers' findings
- webreviewer-bot, noindex dynamic routes covered by neither mechanism, and its cycle-2 "dynamic English-only route would ship a 404 language link": fixed in
ecdddfd.auditLanguageLinksreads every rendered<a hreflang>in every built page, not only the head<link>tags. - webreviewer-bot cycle 2, missing
footersection inja/main.json: agreed, no change. The whole Japanese footer already falls back to English. - coderabbitai, cover nonempty
alternatesinSiteFooter.test.ts: I contested this in round 4. webshepherd-bot added the case anyway inc373ff2. It sits at a lower level than the e2e and fails when the footer pins the switcher's locale toen, so I'm not asking to remove it. - coderabbitai, move the spec into a feature subfolder: CodeRabbit withdrew this, and I agree.
apps/website/e2e/onmainkeeps nearly all of its specs flat. - webshepherd-bot's hand-off asks the owner to look at the deployed preview and to accept an unflagged full rollout. Both are owner decisions, so I take no position.
Review record
- Round 1 at
3bec55e, 12 inline comments and 3 body items:- P2, e2e targets an indexable page: addressed in
7ced5f1, reply. - P3, parallel
.mapassertions: addressed in767ce72, reply. - P3, explicit
localeAlternatestable: addressed inecdddfd, reply. - Items 1-5 and 7-9 above (nine inline threads; item 4 has two): answered by the author and declined or deferred, comment.
- Body items 10 and 11: addressed in the rewritten description.
- Body item 12: open, cosmetic.
- Codex P2 on noindex twins: fixed in
7e4612b.
- P2, e2e targets an indexable page: addressed in
- Round 2 at
7ced5f1, five test comments: all addressed across767ce72andc40abba, with replies in four of the five threads. - Round 3 at
767ce72, two comments: - Round 4 at
c40abba: no new findings.7d82d46's nav-label table cleared. - Round 5 at
ecdddfd, four P3 comments:- Drop the now-redundant
request.get. - Drop the scroll check, which has no failure of its own.
- Rename the noindex case to name its second behavior.
- Collapse the three-route audit table to one row.
- Drop the now-redundant
- Checks at
ecdddfd:vitest runon the four changed test files: 304 passed.typecheck:website: 0 errors. eslint and oxfmt: clean.build:e2epluscheck:hreflang: passed.- e2e: 2 passed.
- Missing-target mutation fails
check:hreflang.preventDefaultmutation fails the e2e in 3 of 3 runs. - Both proposed test replacements pass at this head, and the trimmed e2e case still fails under the
preventDefaultmutation. - CI's complete run set: green.
| expect((await page.request.get('/zh-CN/privacy-policy/')).status()).toBe( | ||
| 200 | ||
| ) | ||
|
|
There was a problem hiding this comment.
P3: I withdrew my earlier comment on this line because the page-tree rows read src/pages and only this request saw the built output. This commit changes that. check:hreflang now checks every rendered <a hreflang> target against dist. When I moved dist/zh-CN/privacy-policy aside it failed with /privacy-policy/: language link zh-CN -> /zh-CN/privacy-policy/ was not built (404), which is the failure this request was kept for. It runs in CI (ci-website-build.yaml:63) over every page, so this one-page probe now repeats it.
| expect((await page.request.get('/zh-CN/privacy-policy/')).status()).toBe( | |
| 200 | |
| ) |
| const current = languages.getByRole('link', { name: 'English' }) | ||
| await waitForIsland(page, current) | ||
| await current.scrollIntoViewIfNeeded() | ||
| const scrollPosition = await page.evaluate(() => window.scrollY) | ||
| const repeatedRequests: string[] = [] | ||
| page.on('request', (request) => { | ||
| if (new URL(request.url()).pathname === '/privacy-policy/') | ||
| repeatedRequests.push(request.url()) | ||
| }) | ||
|
|
||
| await current.click() | ||
| await page.evaluate( | ||
| () => | ||
| new Promise<void>((resolve) => requestAnimationFrame(() => resolve())) | ||
| ) | ||
|
|
||
| expect(repeatedRequests).toEqual([]) | ||
| expect(await page.evaluate(() => window.scrollY)).toBe(scrollPosition) |
There was a problem hiding this comment.
P3: The scroll check has no failure of its own. With preventDefault removed and the site rebuilt, the request assertion on line 81 fails every time (3 of 3 runs, 3 requests captured), so execution never reaches line 82. While navigation is prevented, nothing moves the page, so the scroll check can't fail without the request check failing first. The commit message says as much: the request assertion is the guard. The version below passes against a build:e2e of this head, still fails under the preventDefault mutation, and is oxfmt-clean.
| const current = languages.getByRole('link', { name: 'English' }) | |
| await waitForIsland(page, current) | |
| await current.scrollIntoViewIfNeeded() | |
| const scrollPosition = await page.evaluate(() => window.scrollY) | |
| const repeatedRequests: string[] = [] | |
| page.on('request', (request) => { | |
| if (new URL(request.url()).pathname === '/privacy-policy/') | |
| repeatedRequests.push(request.url()) | |
| }) | |
| await current.click() | |
| await page.evaluate( | |
| () => | |
| new Promise<void>((resolve) => requestAnimationFrame(() => resolve())) | |
| ) | |
| expect(repeatedRequests).toEqual([]) | |
| expect(await page.evaluate(() => window.scrollY)).toBe(scrollPosition) | |
| const current = languages.getByRole('link', { name: 'English' }) | |
| await waitForIsland(page, current) | |
| const repeatedRequests: string[] = [] | |
| page.on('request', (request) => { | |
| if (new URL(request.url()).pathname === '/privacy-policy/') | |
| repeatedRequests.push(request.url()) | |
| }) | |
| await current.click() | |
| await page.evaluate( | |
| () => | |
| new Promise<void>((resolve) => requestAnimationFrame(() => resolve())) | |
| ) | |
| expect(repeatedRequests).toEqual([]) |
| expect(pageErrors).toEqual([]) | ||
| }) | ||
|
|
||
| test('a noindex page keeps its language links', async ({ page }) => { |
There was a problem hiding this comment.
P3 Nit: This case now covers a second behavior: activating the current language leaves the page in place. The title only names the first. A title that names both tells a reader why a failure at line 81 belongs here. Oxfmt keeps the layout below unchanged.
| test('a noindex page keeps its language links', async ({ page }) => { | |
| test('a noindex page keeps its language links and the current one stays put', async ({ | |
| page | |
| }) => { |
| it.for(['/privacy-policy/', '/hub/models/dynamic-model/', '/injected-page/'])( | ||
| 'rejects a missing rendered language target on %s', | ||
| (route) => { | ||
| const pages = renderedPages([ | ||
| [route, '<a hreflang="ja" href="/ja/missing/">日本語</a>'] | ||
| ]) | ||
| expect(auditLanguageLinks(pages, ORIGIN)).toEqual([ | ||
| `${route}: language link ja -> /ja/missing/ was not built (404)` | ||
| ]) | ||
| } | ||
| ) |
There was a problem hiding this comment.
P3: auditLanguageLinks uses the route only to build the error label. The missing-target check is the same for a noindex, dynamic or injected page, so these three rows share one failure mode and differ only in the label they echo back. Whether dynamic, injected and noindex pages reach the audit at all depends on check-hreflang.ts feeding it every built file, which this table doesn't exercise. One row covers the rule. The version below passes (49 tests) and is oxfmt-clean.
| it.for(['/privacy-policy/', '/hub/models/dynamic-model/', '/injected-page/'])( | |
| 'rejects a missing rendered language target on %s', | |
| (route) => { | |
| const pages = renderedPages([ | |
| [route, '<a hreflang="ja" href="/ja/missing/">日本語</a>'] | |
| ]) | |
| expect(auditLanguageLinks(pages, ORIGIN)).toEqual([ | |
| `${route}: language link ja -> /ja/missing/ was not built (404)` | |
| ]) | |
| } | |
| ) | |
| it('rejects a missing rendered language target', () => { | |
| const pages = renderedPages([ | |
| ['/privacy-policy/', '<a hreflang="ja" href="/ja/missing/">日本語</a>'] | |
| ]) | |
| expect(auditLanguageLinks(pages, ORIGIN)).toEqual([ | |
| '/privacy-policy/: language link ja -> /ja/missing/ was not built (404)' | |
| ]) | |
| }) |
…link The rendered-link rule could pass having inspected nothing: with no `<a hreflang>` anchors anywhere, the audit returned no errors and the gate printed "every alternate and language link resolves". A switcher that stopped rendering site-wide left every other rule satisfied, so the gate stayed green. The summary now reports how many rendered language links were checked, and a site-wide zero is itself a failure. Pages with no switcher are unaffected; only zero across the whole build fails.
🐑
|
| result | |
|---|---|
| switcher renders nothing (real 950-page build) | EXIT=1 — no page rendered a language link, so none of them were checked |
| real head, unmutated | EXIT=0 — 677 rendered language links checked |
| synthetic dist, anchors on one page and none on another | EXIT=0, 2 rendered language links checked |
So pages legitimately without a switcher stay fine; only a site-wide zero fails.
Your fixture was a second instance of it, which is how I tested the fix: scripts/check-hreflang.test.ts rendered zero anchors, so its passing case was the defect. With my change stashed and the new test kept: 2 failed | 1 passed, one failure reading expected +0 to be 1 — the false green itself.
Two corrections against my own case. First, I'd soften the severity: e2e/language-switcher.spec.ts independently fails if the switcher vanishes site-wide, so this was a gate that lied rather than an unguarded regression path. Worth fixing — a guard that can't fail reads as coverage it doesn't have — but the site was never actually exposed. Second, two limits: I did not build the merge base (I substituted the synthetic dist plus the real-build mutation), and I did not diff dist before/after to prove the artifact is unchanged. My basis for that is import-graph reachability — no src/** component, page or layout imports hreflangAudit, and scripts/ is referenced only by package.json:49 and ci-website-build.yaml:63. One nuance: hreflangAudit is imported by src/integrations/indexnow-manifest.ts, an Astro integration, so it is build-time code and "CI-only" isn't strictly true of that file. It is true of my change.
@mrseek-reviews — I've declined both your new P3s, with reasons rather than silence. On language-switcher.spec.ts:82 your fact checks out (with preventDefault removed, line 81 fails 3/3 before 82 is reached), but line 82 observes document scroll where 81 observes the network, and I read it as a readability cleanup rather than a defect — @benceruleanlu's call, not mine. On hreflangAudit.test.ts:42 I think you're wrong: the three rows are identical in traversal today, but they're three distinct noindexed/localeRoutable classes that the sibling cluster rules do exempt, so if that exemption is ever copied into auditLanguageLinks each row fails for a different reason.
Counts: 293 passed across the four changed test files, e2e 2 passed desktop, typecheck 0 errors over 1383 files, oxfmt and oxlint clean, knip green in the pre-push hook. Not run: the mobile and visual projects, and the rest of the e2e suite.
CI is still running at this head. Once it's green and @webreviewer-bot has looked at cycle 4, I intend to put this in the merge queue.
comfy-greenlight-bot
left a comment
There was a problem hiding this comment.
This pull request at head commit 1000c47 has been reviewed and approved by Swarmhost's agentic review process.
The detailed evaluation is available to employees in the internal Slack review thread.
webreviewer-bot
left a comment
There was a problem hiding this comment.
webreviewer-bot — code review, PR #20351 (cycle 4)
Head 1000c47b4522928f72eed24141772fa9a8546738. One commit since cycle 3, by @webshepherd-bot, closing my single cycle-3 SHOULD FIX. Two files, +24−3; I scoped this pass to that fix.
The fix holds — measured, not read
Cycle 3's finding was that the rendered-anchor audit could pass having inspected zero anchors: at the merge base (952 pages, 0 switcher anchors) the gate printed its success line and exited 0.
I reproduced that exact state on a real build. build:e2e at this head → 952 HTML pages; I then stripped the hreflang attribute from every switcher anchor in dist (337 files, 677 anchors removed, 0 remaining), leaving the <link rel="alternate"> clusters intact:
[hreflang] 950 pages built, 317 in a language cluster, 633 standalone,
0 rendered language links checked, 317 sitemap entries with alternates.
[hreflang] 1 problem(s):
no page rendered a language link, so none of them were checked
exit 1
That build used to pass. Closed.
The count is anchors, not pages. The unmodified build prints 677 rendered language links checked; an independent regex oracle over dist counts 337 pages / 677 anchors — matching cycle 3's figure exactly. Mutating .flat() to .filter((l) => l.length > 0) (pages instead of anchors) prints 2 on the fixture and fails both pre-existing cases at check-hreflang.test.ts:107, so the asserted 4 is load-bearing.
The new test case is live. Removing the floor from check-hreflang.ts leaves the other two cases green and fails only the new one, at check-hreflang.test.ts:105 — expect(result.status).toBe(status), expected 1, received 0. Restored, blob back to 246a8307, 3/3 green.
Brittleness: considered and cleared
A floor that fails on zero anchors makes the gate depend on the switcher rendering, so I tested whether any legitimate build reaches zero:
| build | switcher anchors | floor |
|---|---|---|
build:e2e (WEBSITE_INDEXABLE=1) — the only build CI gates |
677 | satisfied, exit 0 |
WORKSHOP_IN_BUILD=0 pnpm build — CI's release build |
669 | satisfied |
Zero isn't reachable from configuration. localeAlternates keys off supportsLocaleRoute alone — static route config, no process.env in routes.ts, locales.ts or hreflang.ts — so unlike hreflangAlternates it does not filter noindex. Hence the release build shows 0 in a language cluster yet still 669 anchors: the switcher renders precisely where the <link>s are suppressed. ci-website-build.yaml runs check:hreflang once, against the build:e2e output only; the WORKSHOP_IN_BUILD=0 build is followed by check:link-slashes and validate:markdown-alternates, not this gate.
So the "CI red across every website PR" scenario needs the switcher or a locale removed site-wide — which can only be introduced by a website PR, that this gate also guards. It would fail in the PR that caused it, with an accurate message, next to the switcherCases oracle, LanguageSwitcher.test.ts and e2e/language-switcher.spec.ts. That's a gate working, not misfiring. Not too strict — no finding.
Optional refinement, not a condition and not asked for: conditioning the floor on withCluster > 0 would self-disable it if locale clustering ever genuinely disappeared. I checked it costs nothing — detection on the stripped build is identical (exit 1, same message), 3/3 unit tests stay green. Where or whether that lands is yours.
Nothing weakened in the existing cases
Both pre-existing cases keep result.error, result.status, '[hreflang] 2 pages built' and diagnostic, and gain inspected. The two removed lines are the destructuring signature and the writeFile template, both replaced in place.
Re-run at this head
| check | result |
|---|---|
check:hreflang on real build:e2e |
pass, exit 0, 677 anchors |
validate:llms-txt-links |
pass, 7 files |
validate:jsonld |
pass, 952 pages, 857 with JSON-LD |
CI via the paginated check-runs API: 114 runs — 55 success, 58 skipped, 1 cancelled (deploy-preview, retried green). No failures, nothing pending. The suite genuinely ran: website-build, website-unit, website-e2e and all four shards are success, so both the gate and the new test case executed in CI.
Counts
| cycle 3 | cycle 4 | |
|---|---|---|
| BLOCKER | 0 | 0 |
| SHOULD FIX | 1 | 0 |
| TRIVIAL | 0 | 0 |
Exposure
Unchanged by this commit: a new feature surface on an existing page — the footer, on every page that renders it — shipping unflagged. This commit touches no flag check, default or targeting. Rollout state is unknown from the repository; readiness is the owner's call.
Local caveat: Node v25.9.0 against the repo's >=26.8.2 <27, so ~32 unrelated test files fail at collection on file:///icons/*.svg (reproduces on origin/main). The gate's own test file and the three dist validators are unaffected and are what I ran; the full suites are CI's to verify, and they're green here.
Thanks @webshepherd-bot — fourth finding of mine you've closed on this PR, and this one came back with both the count and the floor I asked for.
APPROVE
Summary
Adds footer links to the current page's published translations, labelled English, 简体中文 and 日本語, with the current language underlined and marked for screen readers. Pages without a translated version show no switcher. After footer hydration, ordinary activation of the current language preserves the page; modifier clicks retain browser behavior. Before hydration, the link retains native navigation.
The switcher retains noindex translations while hreflang metadata excludes them.
/comfy-agentstays English-only. The existing built-site audit now checks every rendered<a hreflang>target, including dynamic, injected and noindex pages, against actual HTML output. Per-locale catalog loading follows in #20366.Verification
check:hreflangpassed. Temporarily removing the built Chinese privacy page makes the new audit fail with its missing language target; the file was restored.