Skip to content

fix: restore Korean locale switching and touch menu behavior - #115

Merged
minpeter merged 2 commits into
mainfrom
fix/language-switcher
Oct 5, 2026
Merged

minpeter merged 2 commits into
mainfrom
fix/language-switcher

Conversation

@minpeter

@minpeter minpeter commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Why

  • Selecting Korean used an unprefixed URL, so next-intl redirected back to the saved non-default locale.
  • Opening the menu on touch-down could deliver the release click to the first language item instead of the trigger.

Changes

  • Force an explicit locale prefix on language links so middleware updates the preference cookie before the canonical redirect. Keep full-document navigation to avoid the existing Next.js RSC stream issue.
  • Apply touch toggles after the release click, capturing the intended state before Radix can dismiss the open menu. Preserve mouse and keyboard handling.
  • Add desktop/mobile coverage for all six locale directions on five page types, preference persistence, keyboard selection, and touch open/close/reopen. Include the new suite in CI.

Verification

  • Reproduced both bugs before fixing them; regression assertions fail against the prior implementation.
  • Local browser QA: 64 scenarios repeated twice, 128 passes.
  • Isolated PR worktree: pnpm check and all 162 unit tests pass.
  • Production build passed during QA; GitHub CI will validate the isolated PR including the new browser suite.

Only the language-switcher fix and its regression coverage are included. Unrelated local showcase, error-panel, and preview work is excluded.


Summary by cubic

Fixes the language switcher so selecting Korean actually persists and touch users can open the menu without accidentally activating a language.

  • Forced locale prefixes update the preference cookie before the canonical redirect, so non-default choices like Korean stick.
  • Touch toggles are applied only on release click, and canceled touches no longer leak their intent into later clicks; mouse and keyboard behavior is unchanged.
  • E2E coverage spans all six locale directions across five page types, preference persistence, keyboard selection, and touch open/close/reopen scenarios, wired into CI.

Written for commit 080ae30. Summary will update on new commits.

Review in cubic

Force locale prefixes so selecting Korean updates the preference cookie before canonical redirection. Defer touch menu changes until click completion to prevent accidental first-item selection.

Cover all locale directions, keyboard and touch interactions in desktop/mobile E2E and include the regression suite in CI.

Amp-Thread-ID: https://ampcode.com/threads/T-01a10d98-c339-71bf-9384-556d1fecb514
Co-authored-by: Amp <amp@ampcode.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
minpeter.v2 Ready Ready Preview, v0 Oct 5, 2026 8:27pm UTC

@minpeter minpeter left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Self-review completed for the four-file PR diff. No merge-blocking correctness or security issues found.

Checked the default-locale redirect/cookie flow against the as-needed routing contract; full-document navigation remains intact. Checked touch pointer-down/up/click ordering and the captured open/close intent, with mouse and Radix keyboard handlers preserved. Regression assertions cover both observed failures, all locale directions, page/locale consistency, persisted preference, and touch reopen behavior.

Review follow-up addressed: the new language-selector suite is now explicitly included in the CI E2E command. Unrelated local changes are not in this PR.

Validation: isolated-worktree type/lint checks and 162 unit tests pass; local browser QA passed 128 executions. Waiting for GitHub CI and the Vercel preview before merging. The automatic Codex review did not run because its account review quota is exhausted.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread components/language-selector.tsx
Comment thread e2e/language-selector.spec.ts
Reset pending touch intent on cancellation and keyboard input. Check visible page-specific landmarks across locale changes and reloads.

Amp-Thread-ID: https://ampcode.com/threads/T-01a10d98-c339-71bf-9384-556d1fecb514
Co-authored-by: Amp <amp@ampcode.com>
@minpeter

minpeter commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Review follow-up: both cubic findings are addressed and regression-tested. Final isolated-worktree validation passed: pnpm check (types + lint), 162 unit tests, production build with the testing API enabled, pnpm audit --prod (no known vulnerabilities), and all 84 CI E2E scenarios repeated twice with no retries (168 passed). The initial local run accidentally reused an unrelated existing server; final evidence comes from a new isolated server with reuse disabled.

GitHub-hosted runner assignment is currently degraded: https://www.githubstatus.com/incidents/3q1yb5m7ltvb . The Actions jobs are queued, not passed. This repository has no required branch checks/rules. Once the updated Vercel preview is successful, the merge decision will use the equivalent local checks above; it will not treat queued CI as green. Production deployment and live locale switching will be verified after merge.

@minpeter
minpeter merged commit 04195c4 into main Oct 5, 2026
7 of 10 checks passed
@minpeter
minpeter deleted the fix/language-switcher branch October 5, 2026 20:32
@minpeter

minpeter commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Delivery complete: #115 and the test-only follow-up #116 are merged. The final main commit is deployed successfully to https://minpeter.com (Vercel Production deployment 6869389578).

Final evidence: 162 unit tests, type/lint checks, production build and production dependency audit passed locally. The full local CI browser suite passed 84/84; the live production language suite passed 132/132 executions with no retries; an additional 8 desktop/mobile smoke tests passed after the final deployment. Home locale rendering and persisted preference on returning home/reloading were also verified.

The intermittent hover QA failure was traced to Playwright 1.63 implicit smooth scrolling and fixed only in the tests by #116; no production workaround was introduced. Both PRs completed review with no unresolved findings.

CI limitation remains explicit: some GitHub-hosted jobs could not acquire a runner and were canceled without executing (annotation: "The job was not acquired by Runner of type hosted even after multiple attempts"). These were not counted as passing; equivalent local checks and live verification supplied the release evidence.

This branch was successfully deployed

1 active deployment
Preview — 080ae30a Deployed Oct 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.

1 participant