Skip to content

test(web): verify locale switches, cookies and hard reloads - #11992

Merged
austinywang merged 8 commits into
mainfrom
issue-11979-language-switcher-followup
Sep 5, 2026
Merged

austinywang merged 8 commits into
mainfrom
issue-11979-language-switcher-followup

Conversation

@austinywang

@austinywang austinywang commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

The locale switcher must keep the selected language, NEXT_LOCALE cookie, URL, metadata, document language/direction, and rendered headings consistent when returning to English. The implementation now on main writes the locale cookie before a full document navigation; this follow-up retains it and removes the conflicting older navigation attempts.

This PR expands the previous browser regression into four behavior tests:

  • Korean, Japanese, and Arabic → English → the original locale → English, with a hard reload after every switch.
  • English selection wins over a Korean Accept-Language preference, preserves query strings/fragments, and updates the cookie, title, heading, html lang, and rtl/ltr direction.
  • A real client-side /ko → /ko/blog navigation followed by switching to English preserves /blog and its query/fragment across reload.

CMUX_WEB_TEST_BASE_URL lets the existing test:instant command run the same checks against a dev server or deployed preview. Default CI still builds and starts the production-style server.

Validation:

  • CMUX_WEB_TEST_BASE_URL=http://localhost:4077 bun run test:instant locale-navigation — 4 passed.
  • CMUX_WEB_TEST_BASE_URL=https://cmux.com bun run test:instant locale-navigation — 4 passed.
  • bun run typecheck — passed.
  • bun run lint -- e2e/instant/locale-navigation.instant.ts e2e/instant/marketing-navigation.instant.ts playwright.instant.config.ts — passed.
  • Right-hand cmux browser verified Korean/Japanese/Arabic → English and English reload, including matching title, heading, selector, cookie, lang and direction.
  • bun run test — 2,565 passed, 211 skipped; two unrelated existing vm-cmux-tui mount-supervisor timeout failures on this Mac (the isolated retry also hit supervisor timeouts).

Locale changes perform a full document load, trading preservation of transient page state for a single server-rendered locale. This behavior already exists on main; the final diff changes tests and their runner configuration only. All localized routes and catalogs are preserved; localization audit found no changed user-facing strings.

Closes #11979

Deployment note: Vercel previews for this branch are still queued in the shared team build queue (confirmed with Vercel CLI). The running local dev server is http://localhost:4077/ko. The final PR diff changes no production runtime files.

Summary by CodeRabbit

  • Tests
    • Added end-to-end coverage for locale switching, including URL, content, metadata, language direction, cookies, query parameters, and fragments.
    • Added verification that locale changes persist across nested routes and page reloads.
    • Removed an existing marketing navigation test.
  • Developer Experience
    • End-to-end tests can now target an externally running server through configuration, while retaining local server support by default.

@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@vercel

vercel Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cmux166 Ready Ready Preview Sep 5, 2026 4:57am UTC
cmux41 Ready Ready Preview Sep 5, 2026 4:57am UTC

@coderabbitai

coderabbitai Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: df1661f4-5005-4f2d-b474-210877997128

📥 Commits

Reviewing files that changed from the base of the PR and between ff2c115 and db2458f.

📒 Files selected for processing (1)
  • web/e2e/instant/locale-navigation.instant.ts

📝 Walkthrough

Walkthrough

Adds Playwright coverage for locale switching, nested-route preservation, reload behavior, and locale metadata. Adds an environment-controlled mode for running tests against an external web server. Removes overlapping marketing navigation coverage.

Changes

Locale navigation regression coverage

Layer / File(s) Summary
Locale navigation regression tests
web/e2e/instant/locale-navigation.instant.ts, web/e2e/instant/marketing-navigation.instant.ts
The new tests verify locale content, metadata, cookies, URL query and fragment state, nested routes, and reload behavior. The overlapping marketing navigation test is removed.
External Playwright server targeting
web/playwright.instant.config.ts
Playwright uses CMUX_WEB_TEST_BASE_URL when set and otherwise retains the local server configuration.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to ff2c1

This change adds locale-navigation regression coverage and optional preview-server test targeting. It covers the reported stale-content behavior across multiple locales and reloads, with no current merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address [#11979] by adding regression coverage for Korean, Japanese, and Arabic locale switches, repeated navigation, cookies, URLs, metadata, headings, document language and direction, cl…
Out of Scope Changes check ✅ Passed The changes remain within the issue scope. The new regression tests, replacement of overlapping test coverage, and external-server configuration directly support locale-navigation validation.
Cmux Swift Actor Isolation ✅ Passed PASS — The PR range contains no Swift changes. The full diff from the mainline parent changes only web TypeScript test/config files, and the two production commits modify only `web/app/[locale]/compon…
Cmux Swift Blocking Runtime ✅ Passed The pull-request diff changes only TypeScript Playwright tests and configuration. git diff HEAD^ HEAD -- '*.swift' is empty, so the PR introduces no production Swift synchronization, blocking wait, …
Cmux Browser Automation Off-Main ✅ Passed PASS. The PR diff changes only web/e2e/instant/*.instant.ts and web/playwright.instant.config.ts. It does not modify Sources/TerminalController.swift, ControlCommandExecutionPolicy.swift, or a…
Cmux Expensive Synchronous Load ✅ Passed PASS. The locale PR changes are confined to web TypeScript tests/configuration and do not add or move a Swift agent-history load. The changed Swift diff contains no RestorableAgentSessionIndex, `Sha…
Cmux Cache Substitution Correctness ✅ Passed PASS. The submitted diff adds and updates Playwright E2E tests and test-server configuration only. It does not replace an authoritative read with a cached value in a persistence, history, undo, or sna…
Cmux No Hacky Sleeps ✅ Passed No explicit hacky sleep condition is introduced. The locale runtime changes use navigation, cookie assignment, and a locale-driven router.refresh() state effect; they do not use sleep, timers, fix…
Cmux Algorithmic Complexity ✅ Passed PASS. The commit changes only Playwright E2E tests and web/playwright.instant.config.ts; it changes no production Swift, TypeScript, JavaScript, shell, or runtime code. The added loops cover three f…
Cmux Swift Concurrency ✅ Passed The pull-request diff relative to its merged mainline parent changes only web TypeScript test/configuration files. It contains no Swift paths or Swift concurrency constructs. Therefore, the Swift-spec…
Cmux Swift @Concurrent ✅ Passed PASS: The pull-request diff from the merged mainline parent changes only TypeScript E2E files and web/playwright.instant.config.ts. It contains no Swift paths, @concurrent annotations, or `nonisol…
Cmux Swift Package Boundaries ✅ Passed The custom check is not triggered. The PR net diff against its mainline parent contains only three web files: the locale-navigation Playwright test, the marketing-navigation test, and the Playwright c…
Title check ✅ Passed The title clearly describes the main change: testing locale switches, cookie behavior, and hard reloads.
Description check ✅ Passed The description provides a detailed summary, rationale, testing results, deployment context, and known unrelated failures. It omits the template’s demo video, review trigger, and checklist sections, b…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-11979-language-switcher-followup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@austinywang
austinywang changed the base branch from issue-11979-language-switcher to main September 5, 2026 02:21
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@austinywang austinywang changed the title fix(web): derive canonical path for English switch test(web): verify locale switches, cookies and hard reloads Sep 5, 2026
@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@austinywang
austinywang enabled auto-merge (squash) September 5, 2026 02:29
@austinywang
austinywang merged commit bb9d7f5 into main Sep 5, 2026
14 of 17 checks passed
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 5, 2026
d7df76b Merge pull request manaflow-ai#11950 from manaflow-ai/fix-sidebar-ctrl4-current
f6bcab4 fix sidebar settings refresh and accessibility
7e841b3 test: update sidebar shortcut snapshot count
4b93b37 inject host-scoped shortcut defaults
518b173 fix settings shortcut override synchronization
37e26cb fix(sidebar): remove duplicate defaults observer
59c0c4f fix(sidebar): refresh gated shortcuts and preserve visible tab
ff99843 Right sidebar: drag a mode-bar pill to reorder tabs inline
bc99270 Rebuild shortcut matcher snapshots after installing the default-stroke provider
b13fdc4 Right sidebar: customizable tabs and positional digit shortcuts
9dc605b test: right-sidebar digit shortcuts should follow visible tab positions
ec4d9c8 fix: revalidate load generation after scope await (manaflow-ai#11995)
bb9d7f5 test(web): verify locale switches, cookies and hard reloads (manaflow-ai#11992)
4382448 Merge pull request manaflow-ai#11988 from manaflow-ai/feat/new-machine-size-picker
6b28f66 Complete machine size localization
dd74333 Fix machine size picker label
0231b0e Improve cloud machine size picker
48440db fix(computer-use): require explicit setup and skill installation (manaflow-ai#11972)
e2b7300 Fix iOS connection handoff and stale computer lists (manaflow-ai#11880)
1e871f4 Stabilize Iroh multi-Mac sessions and sign-out cleanup (manaflow-ai#11874)
aerickson pushed a commit to aerickson/cmux that referenced this pull request Sep 13, 2026
…-ai#11992)

* fix(web): refresh content after locale navigation

* fix(web): navigate directly to canonical English URL

* fix(web): derive canonical path from browser URL

* test(web): cover locale cookies, client navigation and reloads

* test(web): await document load before checking persisted locale

This branch was successfully deployed

2 active deployments
Preview – cmux166 — db2458f0 Deployed Sep 5, 2026 by vercel[bot]
Preview – cmux41 — db2458f0 Deployed Sep 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language switcher keeps stale Korean content

1 participant