Regions list: India's card follows the large-sheet rule, printing the whole-India poster on a desktop and saying so on a phone

This commit is contained in:
Doxa Maps 2026-10-01 05:56:49 +00:00
parent 455fa8ab7d
commit 386e269fe6

View file

@ -70,7 +70,8 @@ import PosterWall from '@map/components/poster/PosterWall.vue'
import RegionSectionCard from '@map/components/regions/RegionSectionCard.vue'
import posterData from '@map/data/country-posters.json'
import { createPeopleGroupRecords } from '@map/lists/peopleGroupRecords.js'
import { makeCountrySheet } from '@map/packet/countrySheet.js'
import { makeCountrySheet, largeSheet } from '@map/packet/countrySheet.js'
import { isPhonePrint } from '@map/composables/printInPlace.js'
import { resolveAssetsBase } from '@map/utils/embedBase.js'
import { onBeforeUnmount } from 'vue'
import { cyrillicHeading } from '@map/styles/portedGlobals.js'
@ -366,7 +367,14 @@ function postersFor(region) {
// eleven, and needs no number in it: the card already shows the count directly above.
// India is the only country in the dataset carrying one (855 people groups, no sheet); China is
// fine at 3x4. My own not-yet reason, for a country with no record at all, is already through t().
const posterUnsupported = (c) => (c.unsupportedReason ? tKey('messages.countryPosterTooMany') : null)
// ★ A COUNTRY TOO LARGE FOR PAPER (countrySheet.js's LARGE_SHEETS; India) prints as one large sheet through the same
// makeCountrySheet, so its record's "too many" note no longer makes it unsupported here. It is DESKTOP-ONLY: on a phone
// its card says so and offers no rows, rather than failing (the Country Posters wall applies the same rule, same table).
const ON_PHONE = isPhonePrint()
const phoneBlocked = (c) => ON_PHONE && Boolean(largeSheet(c)?.desktopOnly)
const posterUnsupported = (c) => (phoneBlocked(c) ? tKey('poster.phoneLimit')
: c.unsupportedReason && !largeSheet(c) ? tKey('messages.countryPosterTooMany') : null)
const posterRows = (item) => (phoneBlocked(item) ? Promise.resolve([]) : countryRecords({ type: 'country', values: [item.iso3] }))
// One region's wall is already inside a region section, so it needs no second level of
// collapsing and no grouping: everything in it is that one region.
@ -585,7 +593,7 @@ useShadowStyles(
:min-card-px="150"
:item-noun-plural="t('Countries')"
item-count-key="regions.countryCount"
:records="countryRecords ? (item) => countryRecords({ type: 'country', values: [item.iso3] }) : null"
:records="countryRecords ? posterRows : null"
:sheet="countrySheet"
:card-stocks="true"
:collapsible="false"