On a phone the research map offered no export at all

The desktop legend gets :export-enabled and @export from this file's template, so
a reader at a desk can print a poster or a packet. LegendMobile does not read
props from here. It reaches for an injected handler and decides whether to offer
the control at all by whether one exists -- mobileExportEnabled is
`typeof onLegendExport === 'function'`. Nothing here provided it, so the phone
showed no export while the same map on a desktop showed both.

That is why it went unreported for so long: it is an ABSENCE, not a broken
button. Nobody clicks a control that was never drawn, and the desktop, where this
kind of thing gets checked, was always correct.

The provide carries EXPORT_FEATURE_ENABLED rather than the bare function. The
desktop already passes that flag, so providing unconditionally would hand a phone
an affordance the desktop deliberately hides when the flag is off; and because
"is there a handler" IS the mobile switch, passing null when it is off is exactly
what makes the sheet hide the control. countries-map fixed this first and its
comment records the same two causes on my-upg-100-list, so this is the third
instance of one pattern rather than a new bug.

Measured before building: the sibling item in the same diff, the RTL-safe CSS the
research map was said to owe the country map, is already done -- zero physical
declarations remain once comments are excluded, and the one apparent hit is prose
describing why a padding exists.

closes #15 of COUNTRY-RESEARCH-MAP-DIFF
This commit is contained in:
Doxa Maps 2026-09-29 01:06:16 +00:00
parent 21d1b9f0cf
commit 7e6d3324ec

View file

@ -1542,6 +1542,20 @@ function onExport(kind) {
if (kind === 'packet') return openPacket()
}
// ★ THE PHONE HAD NO EXPORT AT ALL. The desktop legend gets :export-enabled and @export in the
// template, but LegendMobile does not read props from here — it reaches for an injected handler, and
// decides whether to offer the control at all by whether one exists: mobileExportEnabled is
// `typeof onLegendExport === 'function'` (LegendMobile.vue:412-413). Nothing provided it here, so a
// reader on a phone saw no poster and no packet, while the same map on a desktop offered both. Not a
// leak — an absence, which is why it never showed up as a broken control.
//
// ⚠ IT MUST CARRY EXPORT_FEATURE_ENABLED, not just the function. The desktop passes that flag, so
// providing unconditionally would hand the phone an affordance the desktop deliberately hides when
// the flag is off. Passing null when it is off is what makes the mobile sheet hide the control,
// because "is there a handler" IS the mobile switch. Same shape as countries-map.vue, which fixed
// this first (its comment records the same two causes on my-upg-100-list).
provide('onLegendExport', EXPORT_FEATURE_ENABLED ? onExport : null)
// ─── Packet export (printed, multi-page: map + a card per people group) ──────
// Lazy-loaded on first use, the same pattern openPoster() uses. Defensive throughout: never throw
// uncaught into the UI; guard against double-run.