From 67e9ede5507b8d32aa85c6d83a5c61df1528ccc2 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sun, 27 Sep 2026 06:20:41 +0000 Subject: [PATCH] Show zone, go to the map, come back: the same card shows the zone again PosterWall remembered the card it had shown, so after Show zone -> Map -> back the same press toggled the selection off instead of showing it (rega row 79; UPG-100 and country-posters share the shape). The wall now forgets its last-shown card when its pane goes inactive: it watches its ancestor chain, through shadow roots, for the inert / hidden / aria-hidden a composite puts on an inactive view (the PinHint contract). dx-shepherd ruled option (a). Needs eyes: rega row 79 plus the same arm on country-posters. --- library/components/poster/PosterWall.vue | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/library/components/poster/PosterWall.vue b/library/components/poster/PosterWall.vue index 14d0be893..60008fab9 100644 --- a/library/components/poster/PosterWall.vue +++ b/library/components/poster/PosterWall.vue @@ -39,7 +39,7 @@ * CROSS-PANE COMMS — this wall NEVER imports a map. It dispatches a window * CustomEvent scoped by instanceId, so several embeds on one page never cross-talk. */ -import { computed, ref, watch, onBeforeUnmount } from 'vue' +import { computed, ref, watch, onBeforeUnmount, onMounted } from 'vue' import { tStatic } from '../../i18n/index.js' // This component's chrome, read out of the catalogue. tStatic and not useI18n: these mount inside @@ -284,6 +284,24 @@ const toggleSection = (name) => { const lastShown = ref(null) const missing = ref({}) +// FORGET the shown card when the wall's view goes inactive (dx-shepherd, row 79). A composite marks its +// inactive pane `inert` (the PinHint contract); after "Show zone" -> Map -> back, the same card must SHOW +// again, not toggle off a selection the reader can no longer see. Watches the ancestor chain, through +// shadow roots, for inert/hidden/aria-hidden; clears lastShown only (the map keeps its selection). +const wallEl = ref(null) +let paneMOs = [] +onMounted(() => { + const chain = [] + for (let n = wallEl.value; n; n = n.parentNode || n.host || null) if (n.nodeType === 1) chain.push(n) + const inactive = () => chain.some((a) => a.hasAttribute('inert') || a.hasAttribute('hidden') || a.getAttribute('aria-hidden') === 'true') + if (typeof MutationObserver === 'undefined') return + for (const a of chain) { + const mo = new MutationObserver(() => { if (inactive()) lastShown.value = null }) + mo.observe(a, { attributes: true, attributeFilter: ['inert', 'hidden', 'aria-hidden'] }) + paneMOs.push(mo) + } +}) +onBeforeUnmount(() => { for (const mo of paneMOs) mo.disconnect(); paneMOs = [] }) function showOnMap(item) { // TOGGLE, not a one-way set: a control the user can turn on but not off reads as @@ -949,7 +967,7 @@ useShadowStyles(