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.
This commit is contained in:
Doxa Maps 2026-09-27 07:28:32 +00:00
parent 8c16e73420
commit 2dc945d679

View file

@ -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.