From 82b2e2aa5af94c45b8f7b140d844606b0bcd35cc Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Mon, 28 Sep 2026 20:24:29 +0000 Subject: [PATCH] Call the layer setup unconditionally, and stop the figure being crushed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The guard added last time is what kept this broken. createBoardMap resolves only after awaiting the load event, so by the time the component runs, load has fired. The guard asked map.loaded() — which does not mean "the load event fired" but "the style and every tile are loaded" — and the basemap tiles were still arriving. It returned false, took the else branch, and registered a handler for an event that had already happened. A check added for a hypothetical future engine broke the only case that exists. Defensive code that changes behaviour is not defensive. If a check is ever wanted here it is isStyleLoaded(), which is true at this point; loaded() answers a different question than the one being asked. The figure was crushed rather than unstyled. The zero flex-basis shipped correctly and the figure was still 39 pixels wide: a basis of zero lets it grow from nothing, but min-width:0 also lets it be squeezed to nothing, and the decoder card's own content width wins that contest. The figure now refuses to go below a usable size and the card shrinks or scrolls instead, because the chart is the main view and the legend explains it. --- .../gospel-internet/src/components/GiBoundedSetMap.vue | 10 +++++++++- .../gospel-internet/src/components/GiCenteredSet.vue | 7 ++++++- .../src/components/GiCenteredSetMap.vue | 10 +++++++++- public/dx-maps/doxa-maps-spa/manifest.json | 4 ++-- public/dx-maps/gospel-internet/board/board/index.html | 2 +- public/dx-maps/gospel-internet/board/index.html | 2 +- .../gospel-internet/board/india-china/index.html | 2 +- .../gospel-internet/board/language-tree/index.html | 2 +- .../dx-maps/gospel-internet/board/platforms/index.html | 2 +- .../gospel-internet/board/project-700/index.html | 2 +- public/dx-maps/gospel-internet/board/zero/index.html | 2 +- public/dx-maps/gospel-internet/gospel-internet.js | 2 +- public/dx-maps/manifest.json | 4 ++-- 13 files changed, 36 insertions(+), 15 deletions(-) diff --git a/plugin-designs/gospel-internet/src/components/GiBoundedSetMap.vue b/plugin-designs/gospel-internet/src/components/GiBoundedSetMap.vue index 492fef198..d9a003c4f 100644 --- a/plugin-designs/gospel-internet/src/components/GiBoundedSetMap.vue +++ b/plugin-designs/gospel-internet/src/components/GiBoundedSetMap.vue @@ -86,7 +86,15 @@ onMounted(async () => { font: labelFont, })) } - if (map.loaded()) setup(); else map.once('load', setup) + // ★ CALLED UNCONDITIONALLY, AND THE GUARD THAT USED TO BE HERE IS WHY THIS WAS BROKEN TWICE. + // createBoardMap only resolves after `await map.once('load')`, so by here the event HAS fired. + // The previous line read `map.loaded() ? setup() : map.once('load', setup)` — but loaded() + // does not mean "the load event fired", it means "the style AND every tile are loaded", and + // the basemap tiles were still arriving. So it returned false, took the else branch, and + // registered a handler for an event that had already happened. A guard added for a + // hypothetical future engine broke the only case that actually exists. + // If a defensive check is ever wanted here it is isStyleLoaded(), not loaded(). + setup() } catch (e) { failed.value = String(e?.message || e) } diff --git a/plugin-designs/gospel-internet/src/components/GiCenteredSet.vue b/plugin-designs/gospel-internet/src/components/GiCenteredSet.vue index 29a7d752f..270544426 100644 --- a/plugin-designs/gospel-internet/src/components/GiCenteredSet.vue +++ b/plugin-designs/gospel-internet/src/components/GiCenteredSet.vue @@ -132,9 +132,14 @@ useShadowStyles( // the legend beside it takes the column. rega measured the figure at 39px across while the // decoder card had the rest. Growing from zero makes the figure take the remaining space // whatever it happens to contain. - '.gcs-fig{position:relative;flex:1 1 0%;align-self:stretch;min-width:0;min-height:240px;' + + // min-width is a FLOOR, not 0. The shipped CSS was right and the figure was still 39px wide: + // flex:1 1 0% lets it GROW from nothing, but min-width:0 also lets it be CRUSHED to nothing, + // and the decoder card's own content width wins that contest. The figure now refuses to go + // below a usable size and the card shrinks or scrolls instead — the chart is the main view. + '.gcs-fig{position:relative;flex:1 1 0%;align-self:stretch;min-width:280px;min-height:240px;' + 'display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden}' + '.gcs-aside{flex:0 1 340px;min-width:0;min-height:0;overflow:auto;display:flex;align-items:flex-start}' + + '.gcs-aside .grl{min-width:0}' + '.gcs-legend-toggle{width:100%;padding:6px 10px;border:1px solid #d1d4cd;border-radius:8px;' + 'background:#fff;color:#3b463d;font:inherit;font-size:12.5px;cursor:pointer;text-align:start}' + '@media (max-width:900px){.gcs{flex-direction:column;overflow:auto}' + diff --git a/plugin-designs/gospel-internet/src/components/GiCenteredSetMap.vue b/plugin-designs/gospel-internet/src/components/GiCenteredSetMap.vue index 87f0176a7..b63e4dceb 100644 --- a/plugin-designs/gospel-internet/src/components/GiCenteredSetMap.vue +++ b/plugin-designs/gospel-internet/src/components/GiCenteredSetMap.vue @@ -103,7 +103,15 @@ onMounted(async () => { })) ready.value = true } - if (map.loaded()) setup(); else map.once('load', setup) + // ★ CALLED UNCONDITIONALLY, AND THE GUARD THAT USED TO BE HERE IS WHY THIS WAS BROKEN TWICE. + // createBoardMap only resolves after `await map.once('load')`, so by here the event HAS fired. + // The previous line read `map.loaded() ? setup() : map.once('load', setup)` — but loaded() + // does not mean "the load event fired", it means "the style AND every tile are loaded", and + // the basemap tiles were still arriving. So it returned false, took the else branch, and + // registered a handler for an event that had already happened. A guard added for a + // hypothetical future engine broke the only case that actually exists. + // If a defensive check is ever wanted here it is isStyleLoaded(), not loaded(). + setup() } catch (e) { // FAILS VISIBLY: an empty whiteboard is indistinguishable from a chart with no groups. failed.value = String(e?.message || e) diff --git a/public/dx-maps/doxa-maps-spa/manifest.json b/public/dx-maps/doxa-maps-spa/manifest.json index 4d95a9262..f0b9770f7 100644 --- a/public/dx-maps/doxa-maps-spa/manifest.json +++ b/public/dx-maps/doxa-maps-spa/manifest.json @@ -615,7 +615,7 @@ "bundle": "gospel-internet", "scriptUrl": "./gospel-internet/gospel-internet.js", "output": "dx-maps/gospel-internet/gospel-internet.js", - "integrity": "sha384-uO9AAvtmwvTpQ6t6lc2Vfz7mIdJ7CelCSoLjz9SAMkXFm4/Cmfh4Xn5vOYCmbZNM", + "integrity": "sha384-pUPKyPwSUmuPNnaWk/PmZhfH1oKiUBeHeiUqX6X9YOhQppNqP8fDWMJGxBJMUUZX", "elements": [ "gospel-internet-board" ], @@ -635,7 +635,7 @@ "scriptUrl": "./gospel-internet/gospel-internet.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n" + "script": "\n\n\n\n\n" }, "instances": [ { diff --git a/public/dx-maps/gospel-internet/board/board/index.html b/public/dx-maps/gospel-internet/board/board/index.html index 2710a2e05..c8675caf4 100644 --- a/public/dx-maps/gospel-internet/board/board/index.html +++ b/public/dx-maps/gospel-internet/board/board/index.html @@ -36,7 +36,7 @@ - + - + - + - + - + - + - + \n\n\n" + "script": "\n\n\n\n\n" }, "instances": [ {