From e16e204530386d2ed00c0120b3d59808fba31ed3 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Thu, 1 Oct 2026 00:48:51 +0000 Subject: [PATCH] PosterWall: an optional sectionTotal, so a section whose cards overlap counts its people groups once A section's total (its header count, and what orders the sections) defaults to the sum of its cards' counts, unchanged for every wall that does not pass the prop. The Country Posters India section holds India's own card and one card per state and union territory (the same 855 groups twice), so it passes India's count instead. --- library/components/poster/PosterWall.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/components/poster/PosterWall.vue b/library/components/poster/PosterWall.vue index 6be0706ee..20d35f7c2 100644 --- a/library/components/poster/PosterWall.vue +++ b/library/components/poster/PosterWall.vue @@ -80,6 +80,10 @@ const props = defineProps({ itemCountKey: { type: String, default: '' }, collapsible: { type: Boolean, default: false }, collapsedBy: { type: Function, default: () => false }, + // A section's people-group total, shown in its header and used to order the sections (largest first). + // Default: the sum of its cards' counts. A caller whose cards overlap overrides it, so a group is counted + // once: the Country Posters India section holds India's own card AND one card per state, the same 855 groups. + sectionTotal: { type: Function, default: null }, // A card may declare itself unsupported (India: 855 groups do not fit a sheet). // The caller supplies the reason; the wall renders it instead of a poster. unsupported: { type: Function, default: () => null }, @@ -351,7 +355,7 @@ const sections = computed(() => { .map(([name, items]) => ({ name, items: items.slice().sort((a, b) => (b.count || 0) - (a.count || 0)), - total: items.reduce((n, x) => n + (x.count || 0), 0), + total: props.sectionTotal ? props.sectionTotal(name, items) : items.reduce((n, x) => n + (x.count || 0), 0), })) .sort((a, b) => b.total - a.total) })