From 2dc945d6797ace8bc37d9ba5b4a0fa7e2495ad49 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sun, 27 Sep 2026 07:28:32 +0000 Subject: [PATCH] Country posters: Show on map, go to the map, come back: the same card shows the country again The composite now marks its inactive pane inert, the contract upg-100-mfe follows, so PosterWall forgets its shown card when the wall is out of view and a second press selects the country instead of toggling it off to the world view. --- .../country-posters/country-posters-mfe.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugin-designs/country-posters/country-posters-mfe.vue b/plugin-designs/country-posters/country-posters-mfe.vue index d2184575c..183ec01e7 100644 --- a/plugin-designs/country-posters/country-posters-mfe.vue +++ b/plugin-designs/country-posters/country-posters-mfe.vue @@ -127,9 +127,25 @@ function paneElement(pane) { return el } +// `inert` on every pane except the active one: the same contract as upg-100-mfe (4642e78d). The panes +// are stacked in one scroll-snap column, so the hidden pane is still full-size geometry; inert tells +// PosterWall (67e9ede5) the wall is out of view so it forgets its shown card, and a second +// "Show on map" after Map -> back SHOWS the country again instead of toggling it off (rega row 79). +// inert, not display:none: hiding would tear down the live map. +function markActivePane(activeId) { + if (!column || !activeId) return + for (const pane of column.panes) { + const el = column.mountEl(pane.id) + if (!el) continue + if (pane.id === activeId) el.removeAttribute('inert') + else el.setAttribute('inert', '') + } +} + function go(id) { view.value = id column?.scrollTo(id) + markActivePane(id) // now, not after the smooth scroll settles } // ── tab 1 -> tab 2 (shell seam) ───────────────────────────────────────────── @@ -183,9 +199,11 @@ onMounted(() => { column.mountEl(pane.id)?.appendChild(el) } // Tabs are a readout as well as a control — follow the user's scroll. + markActivePane(column.current() || view.value) // the fresh-load state, before any switch offScroll = column.onScroll(() => { const cur = column.current() if (cur && cur !== view.value) view.value = cur + if (cur) markActivePane(cur) // always: a switcher-driven scroll already set view.value }) window.addEventListener(SHOW_ON_MAP, onShowOnMap) // profile-config `view` opens a chosen pane ("map" or "wall"), so an embed can start on the map.