Skip to content

fix(hosting,inertia,client): per-tab i18n catalogs; adapter owns Inertia cache rules; lazy layout props - #805

Merged
antosubash merged 7 commits into
mainfrom
fix/hosting-review-inertia-i18n
Nov 3, 2026
Merged

antosubash merged 7 commits into
mainfrom
fix/hosting-review-inertia-i18n

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

  • hosting: i18n catalog marker is per-session, not per-tab — other tabs keep the old language after a locale switch #788, behaviour change: the client reports the catalog it holds in X-SM-I18n: <locale>:<audience> on every Inertia visit, and the server sends messages only on a mismatch. A second tab no longer stays on the old language after a locale switch. Without the header (older clients), the legacy session comparison stays, but only page-shaped requests write the marker. The client reloads only: ['i18n'] once if its locale and catalog disagree.
  • inertia: move cache rules (no-store, Vary: X-Inertia) and is_inertia_request into the adapter; three copies disagree #790, behaviour change: simple_module_inertia now exports is_inertia_request / INERTIA_HEADER (presence semantics). Its InertiaMiddleware forces private, no-store, drops ETag on page payloads and adds Vary: X-Inertia, so standalone adapter users are covered too. Hosting's InertiaCacheMiddleware and its divergent checks are removed. Every X-Inertia check now uses presence: error negotiation, i18n, setup gate, auth login redirect, OIDC/Keycloak logout, branding, the users demo guard and the adapter's error handler. Modules import the helper via simple_module_hosting.inertia_deps.
  • hosting: Inertia layout shared props (menus, providers) are built for every request, including /api JSON #791: layout shared props (menus, providers, i18n) are built once, on demand, for page and error renders. They are not built for /api JSON calls. Permissions stay eager. The build runs in the request context the middleware saw, so a 500 page keeps the tenant. An error page whose layout build fails still renders.
  • Docs, CLAUDE.md (middleware order) and the shipped simple-module-inertia-pages skill are updated.

Closes #788
Closes #790
Closes #791

Verification

  • Browser-verified on port 8234 with en+es: two tabs (a locale switch reaches the second tab), catalog omitted when unchanged, Inertia cache headers, 404 layout, re-login catalog
  • Console: no errors
  • Local CI: make lint, make test-py (7541 passed), make test-js (891), make doctor all green; e2e suite 53 passed
  • Verification report: https://claude.ai/artifact/Cacgg3QMn5DSKvpwHZy9Sa

QA Report

  • QA cycle completed (1 iteration), 0 bugs found
  • Categories tested: Happy Path, Edge Cases (two tabs, header spoofing via X-Inertia: 1)

Report links are Claude Artifacts and start private — the author can share them
from claude.ai/code/artifacts if reviewers need access.

Test plan

  • Two tabs: switch locale in one; the other follows on its next navigation
  • CI is green

https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq

…tia cache rules; lazy layout props

- client reports the catalog it holds (`X-SM-I18n: <locale>:<audience>`) and
  the server sends messages only on a mismatch, so a second tab is not left on
  the old language; non-rendering requests no longer touch the legacy session
  marker; one defensive reload when locale and catalog disagree (#788)
- simple_module_inertia exports is_inertia_request/INERTIA_HEADER and its
  middleware forces `private, no-store` and drops ETag on page payloads;
  hosting's InertiaCacheMiddleware and its divergent header checks are gone (#790)
- layout shared props (menus, providers, i18n) resolve once, on demand, for
  pages and error pages; permissions stay eager (#791)

Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
…ddleware saw

A 500 page resolves them after TenantMiddleware unbound its tenant.

Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
…790)

Setup gate, auth login-redirect, branding shared props and the demo guard
used truthiness or == 'true'; they now use is_inertia_request (presence),
re-exported from simple_module_hosting.inertia_deps for modules.

Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
- error page renders without layout props when building them fails
- i18n recovery reload clears its flag when the visit finishes
- adapter error handler uses is_inertia_request
- docs: shared props are resolved lazily (resolve_inertia_shared)

Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
- OIDC and Keycloak logout views use is_inertia_request (presence)
- resolve_inertia_shared exported from simple_module_hosting.inertia_deps;
  docs and CHANGELOG point there
- shipped skill simple-module-inertia-pages: lazy shared props, per-tab
  i18n catalog header and audience

Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4cee8a8
Status: ✅  Deploy successful!
Preview URL: https://21e8d6b6.simple-module-python.pages.dev
Branch Preview URL: https://fix-hosting-review-inertia-i.simple-module-python.pages.dev

View logs

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 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
🔒 Security Review ✅ Completed 2026-11-03T20:57:36.880855Z 4cee8a8 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.

@antosubash
antosubash merged commit d4b168e into main Nov 3, 2026
17 checks passed
@antosubash
antosubash deleted the fix/hosting-review-inertia-i18n branch November 3, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant