From 02b81a8b76fe7d54d9909c0cb5ce93886e353f0f Mon Sep 17 00:00:00 2001
From: SkateSpots
Date: Thu, 1 Oct 2026 14:07:14 +0700
Subject: [PATCH] feat(stats): put the region backfill right on the stats page
The admin backfill lived only in Settings -> Advanced, so an admin staring at
the 'Uncategorised' row had no obvious way to fix it. Render the admin-only
RegionBackfillCard inline in the region section when uncategorised > 0, and
clarify the zero-state (remaining untagged pins belong to other mappers).
---
src/components/RegionBackfillCard.tsx | 3 ++-
src/pages/CommunityStatsPage.tsx | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/components/RegionBackfillCard.tsx b/src/components/RegionBackfillCard.tsx
index 8ff2845..67c820d 100644
--- a/src/components/RegionBackfillCard.tsx
+++ b/src/components/RegionBackfillCard.tsx
@@ -80,7 +80,8 @@ export function RegionBackfillCard() {
Scanning your spots…
) : count === 0 ? (
- Every spot & shop you own already has a region tag. 🎉
+ Every spot & shop you own already has a region tag. 🎉 Any remaining
+ “Uncategorised” pins belong to other mappers — only their own keys can tag them.
) : (
<>
diff --git a/src/pages/CommunityStatsPage.tsx b/src/pages/CommunityStatsPage.tsx
index 2039797..ba00076 100644
--- a/src/pages/CommunityStatsPage.tsx
+++ b/src/pages/CommunityStatsPage.tsx
@@ -7,6 +7,7 @@ import { useAuthor } from '@/hooks/useAuthor';
import { genUserName } from '@/lib/genUserName';
import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar';
import { useGrowthStats } from '@/hooks/useGrowthStats';
+import { RegionBackfillCard } from '@/components/RegionBackfillCard';
import { cn } from '@/lib/utils';
import { formatAge } from '@/lib/routeCache';
@@ -449,6 +450,9 @@ export default function CommunityStatsPage() {
<> {uncategorised} of {locationsTotal} location{locationsTotal === 1 ? '' : 's'} have no location tag and show as “Uncategorised”.>
)}
+ {/* Admin-only (renders null otherwise): fix the gap right where it
+ shows up — re-derive region tags for the viewer's own legacy pins. */}
+ {uncategorised > 0 &&
}
)}