toga-ai 1.0.415 → 1.0.416

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,78 @@
1
+ ---
2
+ type: session
3
+ slug: compass-canada-french-localization
4
+ title: Compass Canada French localization — storefront done, persona DB backend deferred
5
+ author: tcox
6
+ repos: [toga2-commerce, dbchanges2, _underscore]
7
+ framework: "2.0"
8
+ client: compass-canada
9
+ status: active
10
+ created: 2026-07-22
11
+ updated: 2026-07-22
12
+ ---
13
+
14
+ # Session: compass-canada-french-localization
15
+ **Date:** 2026-07-22
16
+ **Project/Repo:** toga2-commerce (2.0), plus dbchanges2 + _underscore for the deferred backend
17
+ **Task:** Finish Compass Canada French localization in the toga2-commerce storefront (Manage Requests, persona names, Account settings, Get Support, Kits, Open TOGa Supply, Orders for Others, order search, Get Support image) — frontend shipped; persona-name DB backend drafted but explicitly deferred.
18
+
19
+ ---
20
+
21
+ ## What WORKED
22
+ - Account "Settings" tab → "Paramètres" and persona placeholder → "p. ex. Jean Tremblay" in all 4 French role files (`src/pages/Account/viewModel/FIELDS/COMPASSCANADA/FRENCH/<ROLE>/{ACCOUNTTABFIELDS,MYACCOUNTFIELDS}.json`). Evidence: JSON parse + EN/FR key-parity script passed.
23
+ - Home page French: ADMIN file Kits→Trousses fixes (5 values); SUPERUSER `HOMEPAGEFIELDS.json` was mostly English and was fully rewritten to match USER/MANAGER French conventions; MANAGER itemsSection → "Articles". Evidence: parity + parse OK.
24
+ - Hardcoded JSX keyed through HEADERFIELDS with in-code English fallbacks (COMPASS/QUAD unaffected): new `adminSubmenu.manageRequests` ("Gérer les demandes") and `alertsSubmenu.*` (markAllAsRead/openExternalLink/alertSingular/alertPlural/allUpToDate) in all 8 COMPASSCANADA HEADERFIELDS files; wired in `NavIconItem.tsx`, `AlertSubmenu.tsx` (+ `Submenus/types.ts`). Evidence: `npx tsc --noEmit` exit 0.
25
+ - Orders for Others heading/subheading keyed (`ordersForOthersHeading`/`ordersForOthersSubheading`) and order search keyed (`pageSearchInput`) in ORDERHISTORYFIELDS (8 files); wired in `AccountPage.tsx` and `MyOrdersView.tsx`. French matches each role's existing phrasing style.
26
+ - Get Support illustration switches by language: `GetSupportPage.tsx` uses `language?.startsWith("fr") ? get-support-img-french.svg : get-support-img.svg`; view model exposes `language`. Evidence: developer confirmed "Seeing it now".
27
+ - Persona query cache fix: added `userPersonaDataOnLogin` + `userPersonaDataOnViewAs` to `LANGUAGE_SENSITIVE_QUERY_KEYS` in `src/queries/queries.ts` so persona names refetch on language switch.
28
+ - Backend persona-translation artifacts drafted (5 files, see file table) — sql-reviewer verdict SAFE TO MERGE, 0 critical; reviewer's one warning (name-based JOIN) fixed by switching the 30 known personas to uuid-based JOIN.
29
+ - Knowledge captured & pushed: CREATE `2.0/apps/_underscore/features/persona-name-translation.md` (status: draft), UPDATE `client-fields.md` (fr-CA correction), UPDATE compass-canada profile.
30
+
31
+ ## What did NOT work — DO NOT RETRY THESE
32
+ - **`language === "fr"` comparison for French detection** — fails silently. The fields registry key and stored language value for COMPASSCANADA French is **`fr-CA`** (see `src/fieldsConfig/index.ts:909`; Account settings save stores the option uuid `en`/`fr-CA` via `setLanguage`). The team doc client-fields.md previously claimed `en`/`fr` — that was stale and is now corrected. Always use `startsWith("fr")`.
33
+ - **Direct DB verification from this dev machine** — ALL endpoints timed out (connect ETIMEDOUT): `reader1.client.database.togahub.com`, `reader1.core.database.togahub.com`, both `production-*-global...rds.amazonaws.com` endpoints, `dev.sandbox.database.togahub.com`, and localhost MySQL (refused — none running). RDS clusters are VPC-restricted; needs VPN or the claude.ai "TOGa Database Integration" connector (not authorized in this session). A ready-to-run check script exists but the scratchpad is session-specific — recreate from the queries in the persona-name-translation.md doc.
34
+ - **Seeding PersonaTranslations by joining on `Personas.name` for all rows** — sql-reviewer flagged it: `Personas.name` has no unique constraint, so a name join can fan out / mis-attach translations. Fixed: the 30 known personas join on `uuid`; only the 3 out-of-band personas (Admin Canada, MacBooks, Managers/VIPs) still match by name because their uuids exist only in the live DB.
35
+
36
+ ## Not tried yet (candidates for next session)
37
+ - Run the DB pre-flight checks (needs VPN or TOGa DB connector): live `MAX(Core.Records.id)` must be 345 and `MAX(Core.RecordFields.id)` 2457 (migrations claim 346 / 2458-2462); `SELECT id,uuid,name,number FROM Personas ORDER BY id` on the Compass Canada client DB — confirm the 3 out-of-band personas exist and `GROUP BY name HAVING COUNT(*)>1` returns nothing; confirm `Languages` has `fr-CA`.
38
+ - Confirm with the business whether the persona glossary has rows below "Managers/VIPs → Gestionnaires/VIP" (screenshot was cut off there) and extend the seed if so.
39
+ - Commit/PR the frontend work (feature branch per git rules — never commit to `_main`); commit the backend files separately when un-deferred.
40
+ - Visual verification pass against the developer's screenshots (was planned; not yet done in-session).
41
+ - toga2-commerce full `npm run build` / smoke run (only `tsc --noEmit` was run).
42
+
43
+ ## Current file state
44
+ | File | Status | Notes |
45
+ |------|--------|-------|
46
+ | toga2-commerce `.../FIELDS/COMPASSCANADA/FRENCH/<4 roles>/ACCOUNTTABFIELDS.json` | modified | Settings → Paramètres |
47
+ | toga2-commerce `.../FRENCH/<4 roles>/MYACCOUNTFIELDS.json` | modified | persona placeholder French |
48
+ | toga2-commerce `.../FRENCH/{ADMIN,SUPERUSER,MANAGER}/HOMEPAGEFIELDS.json` | modified | Trousses/Trousse; SUPERUSER fully retranslated |
49
+ | toga2-commerce `.../COMPASSCANADA/{ENGLISH,FRENCH}/<4 roles>/HEADERFIELDS.json` | modified | + adminSubmenu, alertsSubmenu keys (8 files) |
50
+ | toga2-commerce `.../COMPASSCANADA/{ENGLISH,FRENCH}/<4 roles>/ORDERHISTORYFIELDS.json` | modified | + ordersForOthers*, pageSearchInput (8 files) |
51
+ | toga2-commerce `src/components/NavIcons/NavIconItem.tsx` | modified | labels from fields w/ fallbacks |
52
+ | toga2-commerce `src/components/Submenus/AlertSubmenu.tsx` + `types.ts` | modified | 4 new optional label props |
53
+ | toga2-commerce `src/pages/Account/AccountPage.tsx` | modified | orders-others heading from fields |
54
+ | toga2-commerce `src/pages/Account/view/MyOrdersView.tsx` | modified | search label/placeholder from fields |
55
+ | toga2-commerce `src/pages/GetSupport/GetSupportPage.tsx` + `viewModel/useGetSupportViewModel.ts` | modified | language-switched illustration |
56
+ | toga2-commerce `src/queries/queries.ts` | modified | + 2 persona keys in LANGUAGE_SENSITIVE_QUERY_KEYS |
57
+ | dbchanges2 `Client/2026-07-22a - PersonaTranslations.sql` | created — NOT run | sidecar DDL |
58
+ | dbchanges2 `Core/2026-07-22a - PersonaTranslationsRecord.sql` | created — NOT run | record 346, fields 2458-2462, translation link |
59
+ | dbchanges2 `Client/2026-07-22b - PersonaTranslationsAcl.sql` | created — NOT run | Base-role ACL chain |
60
+ | dbchanges2 `Client_CompassCanada/2026-07-22a - PersonaTranslationsFrench.sql` | created — NOT run | fr-CA seed (30 by uuid + 3 by name) |
61
+ | _underscore `Model/Client/PersonaTranslation.php` | created — NOT deployed | declarative sidecar model |
62
+
63
+ ## Decisions made
64
+ - **Persona names translate server-side** via the metadata sidecar pattern (PersonaTranslations, mirror of AssortmentTranslations) — zero api2 code changes; rejected: client-side name mapping in the frontend (violates "business logic stays in API", wouldn't cover other consumers).
65
+ - **Hardcoded JSX strings get FIELDS keys with in-code English fallbacks** so COMPASS/QUAD need no JSON changes; rejected: adding keys to every tenant's files (churn) or leaving literals (blocks localization).
66
+ - **Header "Admin" stays "Admin" in French** — natural French abbreviation; "Administration" was applied then reverted at developer request.
67
+ - **Backend/DB rollout DEFERRED** — developer decision 2026-07-22; frontend ships independently (fields labels French now; persona *values* go French when migrations run).
68
+ - Identical-in-both-languages names (Servomax, ESFM, MacBooks…) are seeded anyway so the API translation layer finds sidecar rows instead of queueing missing-translation warnings.
69
+
70
+ ## Blockers
71
+ - No network route to any TOGa RDS cluster from this dev machine (VPN needed), and the claude.ai "TOGa Database Integration" connector is unauthorized — blocks the pre-run DB verification for the persona migrations.
72
+ - Persona glossary possibly incomplete (screenshot cut off after "Managers/VIPs").
73
+
74
+ ## Exact next step
75
+ > When backend work resumes: connect VPN (or authorize the TOGa DB connector), run the three pre-flight queries in `knowledge/2.0/apps/_underscore/features/persona-name-translation.md` (next-free ids 346/2458-2462; the 3 name-matched personas + duplicate-name check; `fr-CA` in Languages), then commit the 4 dbchanges2 files + `_underscore/Model/Client/PersonaTranslation.php` on a `feature/persona-translations` branch. For frontend-only shipping: branch + PR the toga2-commerce changes listed above.
76
+
77
+ ---
78
+ _Saved by /session-save on 2026-07-22_
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.415",
3
+ "version": "1.0.416",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",