library: PosterWall and SemanticTreeLegend no longer require i18n to render
Some checks are pending
build-gate / build (push) Waiting to run
Some checks are pending
build-gate / build (push) Waiting to run
Both called useI18n() UNGUARDED. That function THROWS ("Need to install with
`app.use` function") on any host that never installed vue-i18n, and seven
bundles here do not — big-picture, doxa-maps-spa, doxa-vision-card,
golden-path-check, people-groups-grid, plugin-studio, stack-demo. In a library
component this widely consumed, an unguarded call is a BLANK PAGE waiting for
the first bare host that renders it: exactly how library FilterDropdown blanked
people-groups-grid, a production plugin, fixed by studio in 6603dc17.
★ THIS IS PREVENTIVE, NOT A FIX FOR AN OBSERVED BREAK, and the distinction
matters. MEASURED: no bare bundle currently consumes either component, so the
blank page cannot be reproduced today — which matches the shepherd's framing
("LIVE today: none; latent debt"). What is fixed is the embedding hazard, and
the gift policy asks for plugins that work "standalone AND embedded".
⚠ THE FALLBACK IS DERIVED, NOT A TABLE. Hardcoding English for these eleven
keys would put a second copy of the `en` catalog inside the component, and two
copies of one fact drift — the exact trap behind the embedBase asset-path bug
this week. Humanizing the key's last segment gives "buttons.prayerList" ->
"Prayer List", "buttons.cardDeck" -> "Card Deck", "legend.columns.name" ->
"Name": readable English that CANNOT go stale, rather than a raw key shown to a
reader. te() answers false so every caller falls through to its own default.
VERIFIED: the fallback produces the correct English for every real key these
components use; with i18n present nothing changes —
check:legend-info-localized PASS (es/ar/zh still translate, 0 blank),
check:poster-card-fits PASS across 5 widths x 3 locales,
check:a11y-button-names PASS, SRI consistent.
I also confirmed 6603dc17 is an ancestor of my HEAD before pushing, per the
shepherd's warning: the FilterDropdown fix is intact in my tree, not reverted.
This commit is contained in:
parent
8810046bee
commit
6494b97993
8 changed files with 111 additions and 82 deletions
|
|
@ -29,7 +29,18 @@ import LegendProgressBar from './LegendProgressBar.vue'
|
|||
// one proven on .dt-scrim / .lt-overlay / .modal-scrim; it is correct-if-enabled, not observed.
|
||||
import { useViewportScrim } from '../../utils/viewportScrim.js'
|
||||
|
||||
const { t, te } = useI18n()
|
||||
// ★ i18n IS OPTIONAL IN A LIBRARY COMPONENT. useI18n() THROWS on a host that never installed
|
||||
// vue-i18n, and seven bundles here do not. Unguarded, this legend renders NOTHING on such a host —
|
||||
// the failure that blanked people-groups-grid via library FilterDropdown (fixed in 6603dc17).
|
||||
// Same shape of fix as PinHint.vue and PosterWall.vue.
|
||||
// The fallback humanizes the key's last segment, so a bare host sees readable English
|
||||
// ("legend.columns.name" -> "Name") rather than a raw key. `te` answers false so every caller
|
||||
// falls through to its own default — which is what the defaultTab and columnLabel paths expect.
|
||||
const humanizeKey = (k) => String(k).split('.').pop()
|
||||
.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/^./, (c) => c.toUpperCase())
|
||||
let t = (k) => humanizeKey(k)
|
||||
let te = () => false
|
||||
try { const i18n = useI18n(); t = i18n.t; te = i18n.te } catch (_) { /* no i18n on this host */ }
|
||||
|
||||
// Translate a tab's display name from the `tabs.<key>` catalog, keyed by the
|
||||
// tab's stable `i18nKey` (preferred) or `id`. Falls back to the hardcoded
|
||||
|
|
|
|||
|
|
@ -324,7 +324,25 @@ async function exportPoster(item) {
|
|||
// `t` for the wall's own labels, `locale` for the card deck's language. Both come
|
||||
// from the SAME instance so a label and a printed deck can never disagree about
|
||||
// which language the reader chose.
|
||||
const { t, locale: wallLocale } = useI18n()
|
||||
// ★ i18n IS OPTIONAL IN A LIBRARY COMPONENT, NOT REQUIRED. useI18n() THROWS ("Need to install
|
||||
// with `app.use` function") on any host that never installed vue-i18n, and seven bundles here do
|
||||
// not — big-picture, doxa-maps-spa, doxa-vision-card, golden-path-check, people-groups-grid,
|
||||
// plugin-studio, stack-demo. An unguarded call in a component this widely consumed is a BLANK
|
||||
// PAGE waiting for the first bare host that renders it: exactly how library FilterDropdown
|
||||
// blanked people-groups-grid, a production plugin, fixed by studio in 6603dc17. Same shape of
|
||||
// fix as PinHint.vue.
|
||||
//
|
||||
// ⚠ THE FALLBACK IS DERIVED, NOT A TABLE. Hardcoding English for these eleven keys would put a
|
||||
// second copy of the `en` catalog inside this file, and two copies of one fact drift — the exact
|
||||
// trap behind the embedBase asset-path bug this week. Humanizing the last path segment gives
|
||||
// "buttons.prayerList" -> "Prayer List", "buttons.cardDeck" -> "Card Deck",
|
||||
// "buttons.posterMap" -> "Poster Map": readable English that CANNOT go stale, rather than a raw
|
||||
// key shown to a reader.
|
||||
const humanizeKey = (k) => String(k).split('.').pop()
|
||||
.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/^./, (c) => c.toUpperCase())
|
||||
let t = (k) => humanizeKey(k)
|
||||
let wallLocale = 'en'
|
||||
try { const i18n = useI18n(); t = i18n.t; wallLocale = i18n.locale } catch (_) { /* no i18n on this host */ }
|
||||
// ⚠ ONE exportState, not two. The composable owns a ref of its own; if the HUD
|
||||
// keeps rendering the wall's while the print actions write to the composable's, a
|
||||
// card-deck print shows NO progress and its errors vanish silently — the mechanism
|
||||
|
|
|
|||
2
public/doxa-maps/index.html
generated
2
public/doxa-maps/index.html
generated
File diff suppressed because one or more lines are too long
8
public/doxa-maps/manifest.json
generated
8
public/doxa-maps/manifest.json
generated
|
|
@ -681,7 +681,7 @@
|
|||
"bundle": "my-upg-100-list",
|
||||
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
|
||||
"output": "doxa-maps/my-upg-100-list/my-upg-100-list.js",
|
||||
"integrity": "sha384-nzolEnrOfJrY1qd67PyWpwNB6JFgKTsmIaCpvpL+XAdfmuMYmNGf0NAlk/Gi79Ak",
|
||||
"integrity": "sha384-mb0a3w3W6EiyAv5tQ6SpKpEbigF2HIArUes+z4SG2uobtD+siUkdkTLvBAzqSidO",
|
||||
"elements": [
|
||||
"my-upg-100-list-map"
|
||||
],
|
||||
|
|
@ -701,7 +701,7 @@
|
|||
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
|
||||
"embed": {
|
||||
"iframe": "<iframe src=\"./my-upg-100-list/poster-wall/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./my-upg-100-list/my-upg-100-list.js\" integrity=\"sha384-nzolEnrOfJrY1qd67PyWpwNB6JFgKTsmIaCpvpL+XAdfmuMYmNGf0NAlk/Gi79Ak\" crossorigin=\"anonymous\"></script>\n<my-upg-100-list-map profile-config='{\"profile\":\"poster-wall\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></my-upg-100-list-map>"
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./my-upg-100-list/my-upg-100-list.js\" integrity=\"sha384-mb0a3w3W6EiyAv5tQ6SpKpEbigF2HIArUes+z4SG2uobtD+siUkdkTLvBAzqSidO\" crossorigin=\"anonymous\"></script>\n<my-upg-100-list-map profile-config='{\"profile\":\"poster-wall\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></my-upg-100-list-map>"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -715,7 +715,7 @@
|
|||
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
|
||||
"embed": {
|
||||
"iframe": "<iframe src=\"./my-upg-100-list/upg-100-list/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./my-upg-100-list/my-upg-100-list.js\" integrity=\"sha384-nzolEnrOfJrY1qd67PyWpwNB6JFgKTsmIaCpvpL+XAdfmuMYmNGf0NAlk/Gi79Ak\" crossorigin=\"anonymous\"></script>\n<my-upg-100-list-map profile-config='{\"profile\":\"upg-100-list\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></my-upg-100-list-map>"
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./my-upg-100-list/my-upg-100-list.js\" integrity=\"sha384-mb0a3w3W6EiyAv5tQ6SpKpEbigF2HIArUes+z4SG2uobtD+siUkdkTLvBAzqSidO\" crossorigin=\"anonymous\"></script>\n<my-upg-100-list-map profile-config='{\"profile\":\"upg-100-list\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></my-upg-100-list-map>"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -729,7 +729,7 @@
|
|||
"scriptUrl": "./my-upg-100-list/my-upg-100-list.js",
|
||||
"embed": {
|
||||
"iframe": "<iframe src=\"./my-upg-100-list/upg-100-mfe/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./my-upg-100-list/my-upg-100-list.js\" integrity=\"sha384-nzolEnrOfJrY1qd67PyWpwNB6JFgKTsmIaCpvpL+XAdfmuMYmNGf0NAlk/Gi79Ak\" crossorigin=\"anonymous\"></script>\n<my-upg-100-list-map profile-config='{\"profile\":\"upg-100-mfe\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></my-upg-100-list-map>"
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./my-upg-100-list/my-upg-100-list.js\" integrity=\"sha384-mb0a3w3W6EiyAv5tQ6SpKpEbigF2HIArUes+z4SG2uobtD+siUkdkTLvBAzqSidO\" crossorigin=\"anonymous\"></script>\n<my-upg-100-list-map profile-config='{\"profile\":\"upg-100-mfe\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></my-upg-100-list-map>"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
144
public/doxa-maps/my-upg-100-list/my-upg-100-list.js
generated
144
public/doxa-maps/my-upg-100-list/my-upg-100-list.js
generated
File diff suppressed because one or more lines are too long
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <my-upg-100-list-map> custom element. -->
|
||||
<script src="../my-upg-100-list.js" integrity="sha384-nzolEnrOfJrY1qd67PyWpwNB6JFgKTsmIaCpvpL+XAdfmuMYmNGf0NAlk/Gi79Ak" crossorigin="anonymous"></script>
|
||||
<script src="../my-upg-100-list.js" integrity="sha384-mb0a3w3W6EiyAv5tQ6SpKpEbigF2HIArUes+z4SG2uobtD+siUkdkTLvBAzqSidO" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <my-upg-100-list-map> custom element. -->
|
||||
<script src="../my-upg-100-list.js" integrity="sha384-nzolEnrOfJrY1qd67PyWpwNB6JFgKTsmIaCpvpL+XAdfmuMYmNGf0NAlk/Gi79Ak" crossorigin="anonymous"></script>
|
||||
<script src="../my-upg-100-list.js" integrity="sha384-mb0a3w3W6EiyAv5tQ6SpKpEbigF2HIArUes+z4SG2uobtD+siUkdkTLvBAzqSidO" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <my-upg-100-list-map> custom element. -->
|
||||
<script src="../my-upg-100-list.js" integrity="sha384-nzolEnrOfJrY1qd67PyWpwNB6JFgKTsmIaCpvpL+XAdfmuMYmNGf0NAlk/Gi79Ak" crossorigin="anonymous"></script>
|
||||
<script src="../my-upg-100-list.js" integrity="sha384-mb0a3w3W6EiyAv5tQ6SpKpEbigF2HIArUes+z4SG2uobtD+siUkdkTLvBAzqSidO" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
Loading…
Reference in a new issue