Skip to content

feat(website): add a footer language switcher - #20351

Merged
benceruleanlu merged 10 commits into
mainfrom
bl/website-language-switcher
Oct 9, 2026
Merged

benceruleanlu merged 10 commits into
mainfrom
bl/website-language-switcher

Conversation

@benceruleanlu

@benceruleanlu benceruleanlu commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

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-agent stays 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

  • 304 focused tests across hreflang, LanguageSwitcher, SiteFooter and the built-site audit passed with one worker.
  • Production website build and check:hreflang passed. Temporarily removing the built Chinese privacy page makes the new audit fail with its missing language target; the file was restored.
  • Both language-switcher browser cases passed: English-to-Chinese navigation, noindex language links, and no refetch when activating the current language after footer hydration. The request assertion guards navigation; the single-frame scroll check alone does not establish delayed scroll behavior.
  • Normal commit and push hooks passed. Existing desktop/mobile footer evidence below compares the original preview with the repaired noindex footer; styling is unchanged by the audit/navigation follow-up.
Before After
Original mobile privacy footer without language links Fixed mobile privacy footer with language links
Original desktop privacy footer without language links Fixed desktop privacy footer with language links

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.
@benceruleanlu
benceruleanlu requested a review from a team October 6, 2026 22:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T22:42:43.830625Z cda7d19 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

🌾 Fallow: ✅ Passed

Fallow 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 Preview

Website 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 1000c47

🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

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

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8105ac27-2b5f-4657-a7d4-25bdcd7277fa
📥 Commits

Reviewing files that changed from the base of the PR and between baf094f and c373ff2.

📒 Files selected for processing (12)
  • apps/website/e2e/language-switcher.spec.ts
  • apps/website/src/components/common/LanguageSwitcher.test.ts
  • apps/website/src/components/common/LanguageSwitcher.vue
  • apps/website/src/components/common/SiteFooter.test.ts
  • apps/website/src/components/common/SiteFooter.vue
  • apps/website/src/config/locales.ts
  • apps/website/src/config/routes.ts
  • apps/website/src/layouts/BaseLayout.astro
  • apps/website/src/lib/hreflang.test.ts
  • apps/website/src/lib/hreflang.ts
  • apps/website/src/locales/en/main.json
  • apps/website/src/locales/zh-CN/main.json

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

Website language switcher

Layer / File(s) Summary
Locale path generation
apps/website/src/lib/hreflang.ts, apps/website/src/lib/hreflang.test.ts, apps/website/src/config/routes.ts
localeAlternates returns normalized paths for supported locales. hreflangAlternates uses these paths to build locale URLs and the normalized English x-default URL. Tests cover route paths, no-indexable translations, and locale-invariant paths.
Localized language selector
apps/website/src/config/locales.ts, apps/website/src/components/common/LanguageSwitcher.vue, apps/website/src/components/common/LanguageSwitcher.test.ts, apps/website/src/locales/en/main.json, apps/website/src/locales/zh-CN/main.json
Locale configuration adds native names and localized footer labels. The selector renders links with locale names, paths, and language metadata, and marks the current locale. It omits navigation when fewer than two alternates are available.
Footer wiring and browser verification
apps/website/src/layouts/BaseLayout.astro, apps/website/src/components/common/SiteFooter.vue, apps/website/src/components/common/SiteFooter.test.ts, apps/website/e2e/language-switcher.spec.ts
BaseLayout passes locale alternates to SiteFooter, which renders the selector. Tests check footer rendering, language switching, and privacy-policy language links.

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
Loading

Merge Risk

Merge Risk: ⚪ Minimal · up to c373f

The language switcher appears mergeable after normal checks; no concrete code issue remains identified.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to c373f

The change adds language links without granting new access or changing stored data. Navigation and indexing remain separate: translated pages can retain language links while their noindex controls remain intact. No material security risk was identified in the reviewed change.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected change affects navigation presented to website visitors. It does not add an authorization operation, credential transfer, tenant selector, or data-store write; language links select page destinations rather than granting access.

Trust Boundaries and Controls

  • inferred — The configured static build prevents an arbitrary incoming request pathname from causing request-time execution of BaseLayout and generation of attacker-selected footer links. This resolves the identified fallback-routing question for the configured deployment. The path helper itself should not be interpreted as validating every arbitrary pathname.

Resilience and Maintainability Implications

  • observed — The new contract computes a fresh collection and passes render-time props without introducing reservations, persistence, cleanup, or recovery transitions. Existing per-locale translation instances are unchanged across the full PR comparison, and the new component only reads translations.
🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread apps/website/src/lib/hreflang.ts Resolved
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 6, 2026
@benceruleanlu
benceruleanlu added this pull request to stack #20355 October 6, 2026 22:47
@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

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     
Flag Coverage Δ
billing-web-unit ?
website-unit 80.21% <100.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...website/src/components/common/LanguageSwitcher.vue 100.00% <100.00%> (ø)
apps/website/src/components/common/SiteFooter.vue 95.45% <100.00%> (ø)
apps/website/src/config/locales.ts 100.00% <ø> (ø)
apps/website/src/config/routes.ts 100.00% <ø> (ø)
apps/website/src/lib/hreflang.ts 100.00% <100.00%> (ø)
apps/website/src/utils/hreflangAudit.ts 96.33% <100.00%> (+0.77%) ⬆️

... and 143 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Oct 6, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 7, 2026
…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.
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 7, 2026

@mrseek-reviews mrseek-reviews Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)
  1. 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.
  2. P3, PR description screenshots. The before shots come from the cda7d19 preview 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.
  3. 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.ts from cda7d19." I confirmed that claim: 19 tests fail with cda7d19's hreflang.ts, and exactly one, /comfy-agent/, fails with the pre-3bec55e routes.ts.
Existing findings (1)
  • chatgpt-codex-connector, P2 on hreflang.ts at cda7d19 ("Preserve noindex twins in the language menu"): confirmed and fixed in 7e4612b. localeAlternates now derives from route availability alone, and only hreflangAlternates applies isNoindexPathname. In the built site, /privacy-policy/, /zh-CN/privacy-policy/ and both booking-confirmation pages have robots=noindex, emit no hreflang, and render switcher links to both locales. Restoring cda7d19's hreflang.ts fails the three new rows and 16 page-tree rows.
Checked and cleared (5)
  • Using localizeHref instead of the hand-built ${prefix}${en} path in localeAlternates: 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: changing alternates.length > 1 to > 0 fails only that row, so it has its own falsifier.
  • Deleting the <html lang> assertion in the e2e spec: it is the only lang assertion in apps/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:27 comment 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 has scrollWidth 375, links at x 96 to 279 and 32px tall, with aria-current on 日本語. /zh-CN/privacy-policy/ underlines 简体中文, marks it aria-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, because ja/main.json has no footer section. Adding /comfy-agent changes no other supportsLocaleRoute consumer: nothing localizes a /comfy-agent href, and the header and footer link /agent/. nativeName duplicates no existing source: Intl.DisplayNames gives 中文(中国), not 简体中文. No any, assertions, suppressions, dark:, hex values or :class arrays.
Review record
  • Round 1 at 3bec55e. P2: e2e targets an indexable page (inline). P3 items: /comfy-agent reason, flatMap to filter/map, stale hreflang comment, languageAlternates naming (two comments), copied footer link classes, redundant localeAlternates table, three noindex rows as one case, LanguageSwitcher assertions and hreflang, translationsOf name, footer visual baseline question (all inline), plus three PR-description items above.
  • Checks at this head: vitest run on the hreflang, LanguageSwitcher and SiteFooter tests (3 files, 250 passed). eslint on the 9 changed source files (0 problems; eslint config ignores the two test files). pnpm typecheck:website (0 errors). Website format:check (clean). playwright test --list (1 test). pnpm build:e2e with a dist link audit (0 broken links). Base-vs-head hreflang comparison (identical apart from the synthetic /comfy-agent/index.html input). 10 mutation runs on tests and source. fallow audit (no issues in the 11 changed files). All CI checks green at 3bec55e.
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.

Comment thread apps/website/src/config/routes.ts Resolved
Comment thread apps/website/src/lib/hreflang.ts Resolved
Comment thread apps/website/src/lib/hreflang.ts Resolved
Comment thread apps/website/src/lib/hreflang.test.ts Resolved
Comment thread apps/website/src/lib/hreflang.test.ts Resolved
Comment thread apps/website/src/lib/hreflang.test.ts Resolved
@comfy-greenlight-bot

comfy-greenlight-bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Swarmhost agentic review

The 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.

@DrJKL DrJKL added webshepherd Ask the webshepherd-bot to get your code merged into main. webreviewer webbreaker Ask the webbreaker bot to QA this website PR. It tries to break the PR and posts proof. labels Oct 8, 2026
@webshepherd-bot

Copy link
Copy Markdown
Collaborator

🐑 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 3bec55e — the footer switcher on a real built page, not a dev server. deploy-preview is still in progress; once it's green, a quick look and a word here is enough.

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 comfy-greenlight-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@webshepherd-bot

Copy link
Copy Markdown
Collaborator

🐑 Verified 3bec55e. Logic is right; the gaps are in coverage. Two notes first.

The preview is up — deploy-preview succeeded at 09:34:35. The cancelled one at 09:32:59 was a superseded duplicate from the label change, not a failure. So the gate-1 look I asked for above is unblocked.

reviewDecision: APPROVED is @comfy-greenlight-bot's, whose evaluation isn't published publicly. @webreviewer-bot is still running, so please don't read the green decision as merge-ready — I'm not queueing on it.

What I checked and cleared. The noindex split is equivalent to the old filter (isNoindexPathname normalises away the trailing slash), and it's still load-bearing for hreflang only: re-adding the early return inside localeAlternates fails 19 tests, and dropping /comfy-agent from routes.ts fails the page-tree row. /comfy-agent being English-only is correct — no zh-CN or ja twin exists. SiteFooter carries no transition:persist, so the active-language marker can't go stale across a soft navigation, and aria-current="page" is on the anchor where it belongs. The page-tree table at hreflang.test.ts:324 is the strongest thing here: it derives the expected cluster from the filesystem, so a missing LOCALE_INVARIANT_* entry fails rather than shipping a 404.

Three gaps, none of them behavioural:

  1. SiteFooter.test.ts gives the switcher zero coverage. All 13 tests leave alternates at its [] default, so v-if="alternates.length > 1" is false in every one and nothing asserts the footer wires the switcher at all. Those 13 are part of the "250 focused tests" figure, which overstates it — the genuinely new coverage is 4 LanguageSwitcher tests plus the hreflang rows.
  2. The one e2e can't catch this PR's bug. language-switcher.spec.ts:17 visits /cli/, which is indexable. The regression this PR fixes is noindex pages losing their links. That's @mrseek-reviews' P2 and it's unanswered.
  3. New: SiteFooter.vue:285 adds flex-wrap items-center unconditionally, so bottom-bar alignment changes on the ~580 pages that render no switcher, and no screenshot baseline covers the footer (visual-responsive.spec.ts has no footer/contentinfo locator).

Also worth a parity assertion rather than a fix: customers/[slug] is the one dynamic route with a locale-derived slug set. content/customers/{en,zh-CN} are both 12 files today so there's no live 404, but an English-only story would put a broken /zh-CN/customers/<slug>/ link in that page's footer with nothing catching it.

Twelve review threads are unanswered, all @mrseek-reviews' at this head. Codex's is outdated and genuinely fixed.

Unless you'd rather take them yourself, @benceruleanlu, I'll fix 1, 2 and the cheap P3s once @webreviewer-bot reports — one push, one preview re-verify, rather than two rounds. Say the word if you're already on it.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@webreviewer-bot Thanks for clarifying. I should not have asked you to authorize resolution of my own settled threads.

The later comment chain reports that @webshepherd-bot resolved the three CodeRabbit threads. No further resolution of those threads is needed based on that report. Your count of 20 remaining threads is an earlier snapshot; I have not verified the current count.

My assessment at c373ff20 remains unchanged: I have no outstanding actionable CodeRabbit finding. That conclusion does not establish that another reviewer’s unresolved feedback needs no technical judgment.

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 used
Learnt from: webshepherd-bot
URL: https://github.com/Comfy-Org/ComfyUI_frontend/pull/20351

Timestamp: 2026-10-08T12:24:09.714Z
Learning: In Comfy-Org/ComfyUI_frontend, the footer language-switcher wiring test in apps/website/src/components/common/SiteFooter.test.ts deliberately renders locale 'zh-CN' and scopes assertions to navigation named '语言'. This checks that SiteFooter.vue passes both locale and alternates to LanguageSwitcher.vue. An English-only fixture would not detect a hardcoded default English locale.

Learnt from: webshepherd-bot
URL: https://github.com/Comfy-Org/ComfyUI_frontend/pull/20351

Timestamp: 2026-10-08T11:54:11.180Z
Learning: In Comfy-Org/ComfyUI_frontend, apps/website/e2e/language-switcher.spec.ts retains an HTTP 200 assertion for /zh-CN/privacy-policy/ to verify built-route availability. The page-tree tests in apps/website/src/lib/hreflang.test.ts check source-route availability and do not replace this check. The reviewer reports that removing the built Chinese privacy-policy output causes the HTTP assertion to fail while the unit suite remains green.

You are interacting with an AI system.

@benceruleanlu
benceruleanlu removed this pull request from stack #20355 October 8, 2026 21:31
@benceruleanlu
benceruleanlu added this pull request to stack #20584 October 8, 2026 21:31
@benceruleanlu
benceruleanlu removed the request for review from DrJKL October 8, 2026 21:37
@datadog-official

This comment has been minimized.

@benceruleanlu

Copy link
Copy Markdown
Member Author

Rechecked the outstanding automated feedback against ecdddfd8bb7fab5bcad5ba34439d5927fd2d2271:

  • Fixed or verified: noindex pages retain their published language twins; the browser case covers the privacy page and computed underline; link assertions include href, lang, and hreflang together. The duplicate browser cases, unused table, absence-only case, and redundant current-link assertions are gone. The duplicate locale rows are trimmed. After footer hydration, ordinary activation of the current language causes no page request while modifier clicks retain native behavior. The request assertion is the durable navigation guard; the single-frame scroll assertion alone does not prove delayed scroll behavior. Before hydration the current link retains native navigation, so the PR description now limits its no-op claim accordingly.
  • Built-output coverage now checks every rendered <a hreflang> target, including noindex and injected pages. The production build and 304 focused tests passed; both switcher browser cases passed. Moving the built Chinese privacy page aside makes the audit fail with the missing-target error. The single HTTP 200 browser probe remains: it proves the served boundary, whereas the source-tree tests prove route availability.
  • Intentionally retained: the small flatMap, local names, existing explanatory comment, and inline layout computation do not need another abstraction. The footer's short class string stays local; introducing a shared module for it would expand this change without fixing a demonstrated defect. The three noindex policy entries remain explicit coverage for those configured routes. The /comfy-agent route-policy regression and page-tree assertion already cover its lack of a translated twin. Canonical overrides currently belong to English-only model routes, which have no language menu; there is no present mismatch requiring a rewrite. The existing 375px screenshots, translated-page overflow guards, and computed underline check cover the unchanged footer layout; a new screenshot baseline is deferred.

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 hreflang today; two short tree walks do not warrant a generic helper in this change. The audit deliberately remains bounded to the site's current emitted links.

This closes the verified automated threads without changing human review ownership.

@benceruleanlu
benceruleanlu requested a review from DrJKL October 8, 2026 22:03
webreviewer-bot
webreviewer-bot previously approved these changes Oct 8, 2026

@webreviewer-bot webreviewer-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 +21 is purely additive (6 new it.for cases on click prevention, including each modifier key); nothing weakened. The spec's −2 lines are a hoist of const chinese above the first click plus an added waitForIsland — retargeted, not weakened.
  • hreflangAudit.test.ts mutations: widening the off-origin check to accept anything fails hreflangAudit.test.ts:55; making the not-built check always pass fails three cases at hreflangAudit.test.ts:38. Both real.
  • Removing event.preventDefault() fails language-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 === 0 at all three. aria-label "Language", focus outline visible, and aria-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 Unit and CI: Website E2E are all success. From CI's own results.json, both language-switcher.spec.ts tests 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.

Comment thread apps/website/scripts/check-hreflang.ts Outdated
const errors = auditBuiltSite({ pages, canonicals, sitemap, origin: ORIGIN })
const errors = [
...auditBuiltSite({ pages, canonicals, sitemap, origin: ORIGIN }),
...auditLanguageLinks(pageLanguageLinks, ORIGIN)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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:e2e of the merge base baf094fd (952 pages, 0 switcher anchors): the gate would print every alternate and language link resolves having 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:

Suggested change
...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(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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)"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@mrseek-reviews mrseek-reviews Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 run on the four changed test files: 304 passed.
  • pnpm typecheck:website and eslint: clean. oxfmt: clean.
  • build:e2e plus check: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-policy moved aside, check:hreflang fails on exactly that link.
  • With preventDefault removed from preventCurrentNavigation, 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:

  1. P3, /comfy-agent has no reason in the routes header (thread): declined. The page-tree row fails if the entry is removed.
  2. P3 Nit, flatMap in localeAlternates (thread): declined.
  3. P3 Nit, the hreflang cluster comment (thread): declined, kept.
  4. P3 Nit, languageAlternates naming in BaseLayout.astro (line 98, line 338): declined.
  5. P3, shared footer link class (thread): declined as scope growth.
  6. P3, explicit localeAlternates table (thread): addressed in ecdddfd, which keeps only the no-trailing-slash row. Reply.
  7. P3, three noindex hreflang rows (thread): declined, kept as explicit policy coverage.
  8. P3 Nit, translationsOf name (thread): declined with the other local names.
  9. P3 question, visual baseline for the footer bar (thread): deferred. The author points to the screenshots, the overflow guards and the computed-underline check.
  10. P3 body, PR description named only privacy and booking pages: addressed. The rewritten summary now covers all noindex translations.
  11. P3 Nit body, "which hreflang had only hidden" wording: addressed by the rewrite.
  12. 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. auditLanguageLinks reads every rendered <a hreflang> in every built page, not only the head <link> tags.
  • webreviewer-bot cycle 2, missing footer section in ja/main.json: agreed, no change. The whole Japanese footer already falls back to English.
  • coderabbitai, cover nonempty alternates in SiteFooter.test.ts: I contested this in round 4. webshepherd-bot added the case anyway in c373ff2. It sits at a lower level than the e2e and fails when the footer pins the switcher's locale to en, 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/ on main keeps 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 .map assertions: addressed in 767ce72, reply.
    • P3, explicit localeAlternates table: addressed in ecdddfd, 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.
  • Round 2 at 7ced5f1, five test comments: all addressed across 767ce72 and c40abba, with replies in four of the five threads.
  • Round 3 at 767ce72, two comments:
    • Collapse the current-link checks: addressed in c40abba.
    • Delete the request.get: withdrawn after webshepherd-bot's evidence. Re-raised this round, because ecdddfd's audit now covers the same built-output failure.
  • 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.
  • Checks at ecdddfd:
    • vitest run on the four changed test files: 304 passed.
    • typecheck:website: 0 errors. eslint and oxfmt: clean.
    • build:e2e plus check:hreflang: passed.
    • e2e: 2 passed.
    • Missing-target mutation fails check:hreflang. preventDefault mutation 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 preventDefault mutation.
    • CI's complete run set: green.

Comment on lines +61 to +64
expect((await page.request.get('/zh-CN/privacy-policy/')).status()).toBe(
200
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Suggested change
expect((await page.request.get('/zh-CN/privacy-policy/')).status()).toBe(
200
)

Comment on lines +65 to +82
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Suggested change
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 }) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Suggested change
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
}) => {

Comment on lines +32 to +42
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)`
])
}
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Suggested change
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)'
])
})

@benceruleanlu
benceruleanlu removed this pull request from stack #20584 October 8, 2026 23:15
@benceruleanlu
benceruleanlu added this pull request to stack #20593 October 8, 2026 23:16
@benceruleanlu
benceruleanlu removed this pull request from stack #20593 October 8, 2026 23:16
@benceruleanlu
benceruleanlu added this pull request to stack #20596 October 8, 2026 23:17
…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.
@webshepherd-bot

Copy link
Copy Markdown
Collaborator

🐑 1000c47b45 — @webreviewer-bot's SHOULD FIX is fixed. Re-review triggered; this is my last push.

The finding was that check:hreflang can pass having inspected zero anchors. I reproduced it before changing anything — the real gate against a zero-anchor dist:

anchors with hreflang: 0
[hreflang] 2 pages built, 2 in a language cluster, 0 standalone, 2 sitemap entries with alternates.
[hreflang] every alternate and language link resolves, every cluster is reciprocal, and every locale points where it claims.
EXIT=0

And on the real site rather than a fixture: with v-if="alternates.length > 1" forced false and a full build:e2e, anchor-carrying pages went 337 → 0, all 317 clusters still validated, and the gate had nothing to say. The reason it's invisible is that the two emitters are independent — head <link rel="alternate"> from BaseLayout.astro:214/221, the anchors from LanguageSwitcher.vue via SiteFooter.vue:287. Killing the switcher satisfies every pre-existing rule.

The fix is 7 lines in scripts/check-hreflang.ts. @benceruleanlu your hreflangAudit.ts is untouched — I didn't restructure your audit, just made the gate count what it inspected and fail on a site-wide zero.

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 comfy-greenlight-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 webreviewer-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

@benceruleanlu
benceruleanlu added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit e3e1b15 Oct 9, 2026
115 of 116 checks passed
@benceruleanlu
benceruleanlu deleted the bl/website-language-switcher branch October 9, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

greenlight risk:high PR risk grade (advisory shadow check; grader-owned) webbreaker Ask the webbreaker bot to QA this website PR. It tries to break the PR and posts proof. webreviewer webshepherd Ask the webshepherd-bot to get your code merged into main.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants