diff --git a/plugin-designs/research-map-plus-grid/research-map-plus-grid.vue b/plugin-designs/research-map-plus-grid/research-map-plus-grid.vue index d3a13ba7e..26d39dcfc 100644 --- a/plugin-designs/research-map-plus-grid/research-map-plus-grid.vue +++ b/plugin-designs/research-map-plus-grid/research-map-plus-grid.vue @@ -423,6 +423,13 @@ function pushToChildren() { let cfg = {} try { cfg = JSON.parse(map.getAttribute('profile-config') || '{}') } catch (_) { cfg = {} } cfg.externalFilters = { region: linked.region.value, religion: linked.religion, language: linked.language.label, fitSlugs: gridSlugs.value } + // ★ AND THE LOCALE. This rewrote the FILTERS and nothing else, so a live language switch moved + // the composite's own chrome and never reached the panes: the outer element got the new + // profile-config, this re-parsed the child's EXISTING attribute, and the boot `lang` survived + // every push. MEASURED: the map stayed English on a live en->ar switch while the composite + // around it changed. The leaf's own chain is fully reactive and was never at fault — it is + // reactive to its own prop, and its prop was frozen. + if (hostLang.value) cfg.lang = hostLang.value map.setAttribute('profile-config', JSON.stringify(cfg)) } const grid = rootEl.querySelector('people-groups-grid') @@ -433,8 +440,21 @@ function pushToChildren() { // so a stable ISO code matches in every locale while a display name only matches in the one it // was fetched in. grid.setAttribute('primary-language', gridLanguage()) + // The grid's three linked facets travel as their own attributes, but its LANGUAGE does not — + // it reads that from profile-config, which this composite set only when a host list was + // supplied, and never again. Same frozen-prop defect as the map above, one channel over. + if (hostLang.value) { + let gcfg = {} + try { gcfg = JSON.parse(grid.getAttribute('profile-config') || '{}') } catch (_) { gcfg = {} } + if (gcfg.lang !== hostLang.value) { + gcfg.lang = hostLang.value + grid.setAttribute('profile-config', JSON.stringify(gcfg)) + } + } } } +// A locale change has to reach the panes too; `linked` and `gridSlugs` only cover filter state. +watch(hostLang, pushToChildren) watch(linked, pushToChildren, { deep: true }) // The slug set changes without any facet changing (a search term, a cleared filter), so it needs // its own trigger — `linked` alone would leave the camera behind.