Repository navigation
perf(web): load admin text in its own catalog chunk - #3903
Conversation
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 57 minutes. View limit details
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
08d5032 to
fa1c490
Compare
ceb1a2e to
a257dd7
Compare
a257dd7 to
6a93e8a
Compare
fa1c490 to
2066036
Compare
6a93e8a to
8c40b2b
Compare
210bd13 to
5e90e60
Compare
The admin extraction puts about 7,800 web.admin.* messages, roughly 1 MB of JSON, in the English catalog that every launch downloads. A Vite plugin now serves each catalog as two parts, and the admin part loads only when AdminLayout or the setup wizard (which reuses admin forms) asks, or once an admin's session starts. Both wait for it before they render. A web.admin.* message formatted before then renders empty and asks for the part after the render. A failed admin chunk reaches the error boundary instead of leaving the admin area blank; a cancelled load records nothing, and a missing translated admin part falls back to English. useAppLanguage() components re-render when the part arrives under the same language. Co-Authored-By: Claude Opus 5.5 <[email protected]>
8c40b2b to
d262d19
Compare
Problem
Related issue: #3188
Validation tasks: none (no visible change)
Stacked on #3902; the full stack order is in #3723.
The English catalog the app downloads at launch carries every admin message, about 1 MB of JSON, so every user pays for text only administrators see. This splits admin text into its own chunk.
Approach
A Vite plugin serves each generated catalog as two parts,
?part=appand?part=admin(web.admin.*). The app part loads as before. The admin part, in English and in the current language, loads when the admin layout or the setup wizard asks (both wait for it), or when an administrator's session starts. A language change keeps it loaded. If the English admin part fails to load, the admin area reaches the app's error screen, as a failed lazy route does; a missing translated part falls back to English. Text a non-administrator can see stays outsideweb.admin.*.Validation
Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3903/
Surface and build: web admin, desktop; no visible change, captures show the admin dashboard rendering in each language.
Risks
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Load admin text in its own catalog chunk and localize the web UI
web.admin.prefix (catalog.ts, vite.config.ts)useT/useAppLanguage/useAdminMessageshooks, andLocaleProvider— plus locale resolution with eight shipped languages and pseudo-locale support (format.ts, appLocale.ts, useAppLocale.tsx)sessionActive(session.last_seen_at), the web-pushdeliveredmarker), and ESLint enforces the new translation conventionsMacroscope summarized 8c40b2b.