From 072b1ff216f9e4b0f2c8c8714aecae59777dc50c Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Wed, 30 Sep 2026 00:00:00 +0000 Subject: [PATCH] Regions-tab print: pass the same series as the Country Posters wall Every country poster printed from the Regions tab read "map 1 of 0" and "This map is one of a 0-map set called the Country Maps" -- nonsense on a printed poster, on the demo's showcase flow (Regions -> a country -> Poster Map). Found by the served check on FINAL. WHY: makeCountrySheet called generateCountrySheet with no series, so generateSheet fell back to its default { totalGroups:0, totalLists:0, index:1 }. NOT A REGRESSION from the one-definition change, and worth recording because it was first reported as one. The plugin-local copy regions-list used before that change passed no series either; across it regions-list.vue changed by exactly one line, the import. The defect has been in the Regions print since 168b1f1bd. The Country Posters wall was never affected because it computes its own. THE FIX computes the series exactly as the wall does (country-poster-wall.vue): the tier is every country printed at the same sheet size, the total is that tier's length, and the index is the country's position in it by id. It lives in ONE place, seriesFor() in the library, rather than as a second inline copy of the wall's formula -- the same duplication this branch's parent removed for the sheet itself. regions-list passes the FULL country list, not a region's sublist: indexing a region's own list would print "map 3 of 12" beside a thumbnail that says "map 57 of 173". PROVED, rendered with the values seriesFor returns: Sudan index 1 of 173 -> "map 1 of 173" | "one of a 170-map set" Chad index 4 of 173 -> "map 4 of 173" | "one of a 170-map set" which is exactly the text the wall prints for the same two countries on FINAL, measured on the served page, and what their thumbnails say. A row with no sheet tier gets undefined, keeping the renderer's own default rather than a fabricated position. KNOWN, NOT CHANGED: China is the only 3x4 sheet, so its tier has one member and it prints "map 1 of 1" / "a 0-map set" -- here AND on the wall, identically, because this matches the wall by design. Its thumbnail says "174 of 174". Fixing it means choosing whole-series numbering over per-tier, which is the carded 174-vs-173 question, not a freeze-night change. --- library/packet/countrySheet.js | 26 ++++++- .../regions-dashboard/regions-list.vue | 3 + public/dx-maps/doxa-maps-spa/manifest.json | 12 +-- public/dx-maps/manifest.json | 12 +-- .../region-dashboards/index.html | 2 +- .../regions-dashboard/regions-dashboard.js | 76 +++++++++---------- .../regions-dashboard/regions-list/index.html | 2 +- .../regions-dashboard/regions-mfe/index.html | 2 +- 8 files changed, 81 insertions(+), 54 deletions(-) diff --git a/library/packet/countrySheet.js b/library/packet/countrySheet.js index 8bd7c09d3..c0243e71f 100644 --- a/library/packet/countrySheet.js +++ b/library/packet/countrySheet.js @@ -40,7 +40,30 @@ * assetsBase () => string where boundaries/ is served from * @returns {(item, format) => Promise} the sheet's HTML, or '' when it cannot be drawn */ -export function makeCountrySheet({ records, assetsBase }) { +/** + * The sheet's SERIES facts, computed exactly as the Country Posters wall computes them + * (country-poster-wall.vue): the tier is every country printed at the same sheet size, the total is + * that tier's length, and the index is the country's position in it by id. So a country's printed + * "map N of M" and "one of a ~M-map set" agree with the wall's print and with its own thumbnail. + * + * ★ WHY THIS EXISTS: without a series, generateCountrySheet falls back to totalLists 0, and every + * Regions-tab print read "map 1 of 0" and "one of a 0-map set called the Country Maps" -- nonsense + * on a printed poster, on the demo's showcase flow (Regions -> a country -> Poster Map). This was + * not introduced by the one-definition change: the plugin-local copy regions-list used before it + * passed no series either. The wall was never affected because it computes its own. + * + * Returns undefined when the item has no sheet tier, so a row without a poster keeps the renderer's + * own default rather than a fabricated position. + */ +export function seriesFor(countries, item) { + if (!item || !item.sheet || !Array.isArray(countries)) return undefined + const tier = countries.filter((x) => x.sheet === item.sheet) + const index = tier.findIndex((x) => x.id === item.id) + 1 + if (!index) return undefined + return { totalGroups: tier.reduce((a, x) => a + (x.count || 0), 0), totalLists: tier.length, index } +} + +export function makeCountrySheet({ records, assetsBase, countries = null }) { return async function countrySheet(item, format) { const iso3 = item && item.iso3 if (!iso3) return '' // a selection or a row without a country: no sheet @@ -60,6 +83,7 @@ export function makeCountrySheet({ records, assetsBase }) { assetsBase: assetsBase(), ISO3_NAME, format, + series: seriesFor(countries, item), }) } } diff --git a/plugin-designs/regions-dashboard/regions-list.vue b/plugin-designs/regions-dashboard/regions-list.vue index 834c882ef..9784882c6 100644 --- a/plugin-designs/regions-dashboard/regions-list.vue +++ b/plugin-designs/regions-dashboard/regions-list.vue @@ -302,6 +302,9 @@ const countryRecords = createPeopleGroupRecords({ const countrySheet = makeCountrySheet({ records: countryRecords, assetsBase: () => posterAssetsBase.value, + // The same list the Country Posters wall computes its series from, so this tab's printed + // "map N of M" agrees with the wall's print and with the country's thumbnail. + countries: posterData.countries || [], }) const openPosters = ref(new Set()) diff --git a/public/dx-maps/doxa-maps-spa/manifest.json b/public/dx-maps/doxa-maps-spa/manifest.json index 57fec5db3..98839c462 100644 --- a/public/dx-maps/doxa-maps-spa/manifest.json +++ b/public/dx-maps/doxa-maps-spa/manifest.json @@ -1126,7 +1126,7 @@ "bundle": "regions-dashboard", "scriptUrl": "./regions-dashboard/regions-dashboard.js", "output": "dx-maps/regions-dashboard/regions-dashboard.js", - "integrity": "sha384-fFUWFalJ2ez00eKzDirvW1u9kZDjSmRiFg9rX4pYYDXOxsQJs6iFxqOIrkugUozV", + "integrity": "sha384-SvNK71FRRE64yBif1UpuXVelD7l13MRfbVb6T2a9ai4SDKP4xlbBKiDo22nQEBne", "elements": [ "regions-dashboard" ], @@ -1149,8 +1149,8 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -1166,7 +1166,7 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } }, { @@ -1182,8 +1182,8 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } } ] diff --git a/public/dx-maps/manifest.json b/public/dx-maps/manifest.json index 57fec5db3..98839c462 100644 --- a/public/dx-maps/manifest.json +++ b/public/dx-maps/manifest.json @@ -1126,7 +1126,7 @@ "bundle": "regions-dashboard", "scriptUrl": "./regions-dashboard/regions-dashboard.js", "output": "dx-maps/regions-dashboard/regions-dashboard.js", - "integrity": "sha384-fFUWFalJ2ez00eKzDirvW1u9kZDjSmRiFg9rX4pYYDXOxsQJs6iFxqOIrkugUozV", + "integrity": "sha384-SvNK71FRRE64yBif1UpuXVelD7l13MRfbVb6T2a9ai4SDKP4xlbBKiDo22nQEBne", "elements": [ "regions-dashboard" ], @@ -1149,8 +1149,8 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -1166,7 +1166,7 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } }, { @@ -1182,8 +1182,8 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } } ] diff --git a/public/dx-maps/regions-dashboard/region-dashboards/index.html b/public/dx-maps/regions-dashboard/region-dashboards/index.html index 923debdf7..1476ffd2f 100644 --- a/public/dx-maps/regions-dashboard/region-dashboards/index.html +++ b/public/dx-maps/regions-dashboard/region-dashboards/index.html @@ -70,7 +70,7 @@ - + - + - +