4.8 KiB
Local language choice on the anonymous landing page
18 November 2026. Baseline A3 0765b15133da62b86fcc9a8bc29eb8d39c42d1a9; isolated branch codex/landing-local-language. This is a two-line consumer fix, not a public-site redesign, new locale, commercial claim or launch acceptance.
Behavior and boundary
The landing page first reads /auth/me: an authenticated result redirects to /dashboard; the anonymous/failure branch shows the public page. Its language toggle previously called the account-persisting setLanguage, attempting /auth/preferences/language despite being a public entry. The existing landing baseline review observed 24 rejected preference requests across 12 controlled journeys. LandingPage.tsx has the same original Git blob 8d7bdb3d70954186af78be32d4cf422fdce584d2 at that historical baseline and the current A3 baseline, so the finding was not inferred from missing manual review.
Only LandingPage now passes the existing setLocalLanguage to StackLanguageToggle. EN/NB content, HTML language and browser-local choice still update and survive a fresh provider mount. The shared toggle, I18nProvider, authenticated account writer, failure/retry behavior, server-preference hydration, login/deep-link intent and auth redirect are unchanged. Account preference PUTs remain available to authenticated callers; no runtime auth heuristic, new option or second preference store is added. No new strings, visual layout, provider/model, API/schema/dependency or document-renderer change.
Red/green verification
The existing landing-language case was extended to cover both EN→NB and NB→EN, localStorage/HTML/content, remount and zero preference PUTs. A separate authenticated-redirect control verifies the public page is not presented after a successful session read.
- Original runtime source with the new tests: FAILED two cases / passed two controls. Both failures were the zero-PUT assertion: exactly one rejected account-writer attempt would have occurred (
nb-NOoren). Content/local language assertions had already passed. This is fresh deterministic JSDOM failure proof, separate from the older browser baseline. - Fixed final affected run: 13 cases / three suites PASSED, zero failures/skips. Suites:
landing-page.test.tsx, unchangedi18n-provider.test.tsx, unchangedLandingPage.authRedirect.test.tsx. Existing tests retain persisted account saves, localized retries, hydration without writeback and deep-link forwarding. Intermediate results overlap and are not added to 13. - PASSED: full non-incremental TypeScript (
--noEmit --incremental false), scoped ESLint for the two changed files, and source diff whitespace check, exit 0 each. No source or rule warnings were suppressed.
Commands ran from job-tracker-ui with the existing qualified modules accessed through this worktree's own read-only junction to next-security-patch/job-tracker-ui/node_modules. No installation, lockfile or shared module mutation. Jest cache and TEMP/TMP remained under this E-drive worktree. Core final test command:
rtk proxy node node_modules/jest/bin/jest.js --runInBand --runTestsByPath src/landing-page.test.tsx src/i18n-provider.test.tsx src/LandingPage.authRedirect.test.tsx --cacheDirectory=<owned E-drive cache> --json --outputFile=../docs/ui-modernisation/evidence/landing-local-language/green-jest.json
The raw Jest JSON/logs and exact source bindings are in SOURCE_RECEIPTS.json. Source hashes normalize CRLF to LF; native artifact hashes use exact bytes. PowerShell's stderr wrapper appears as NativeCommandError in captured logs, including the successful run; the child exit code and structured Jest outcome determine the result. The original failure messages remain intact.
Limits and rollback
These are mocked API/JSDOM contract checks. No fresh browser, real preference API, cross-device account operation, public HTML/SEO, human/native-language/device/AT, security or whole-launch qualification is claimed. Root owns subsequent public-entry browser qualification. Existing launch design/claims and other roadmap gates remain open. No orchestrator, push, main merge or deployment.
Rollback restores the two LandingPage setter references and associated regression tests; no data migration or stored preference rollback is required.
Root recovery verification: independently verified all12 source/native receipt bindings and the structured13-case passing result, repeated nonincremental TypeScript and scoped ESLint (exit0), and completed graphify update . --no-cluster (19,888 nodes/49,292 edges, AST only). Missing SQL extractor and symbol-free file warnings remain. The worker usage interruption did not lose these changes. No browser result is implied by this checkpoint.