From da13f919bf412d40f1f50c8c9c85788d9cd40d2b Mon Sep 17 00:00:00 2001 From: "Brennan Wilkes (Text Groove)" Date: Tue, 20 Jan 2026 16:29:04 -0800 Subject: [PATCH] fix: Recent SKUs --- viz/app/search_page.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/viz/app/search_page.js b/viz/app/search_page.js index d535b9d..2ba0e7e 100644 --- a/viz/app/search_page.js +++ b/viz/app/search_page.js @@ -157,16 +157,22 @@ export function renderSearch($app) { const when = r.ts ? prettyTs(r.ts) : r.date || ""; const rawSku = String(r.sku || ""); const sku = canon(rawSku); - const img = aggBySku.get(sku)?.img || ""; + + const agg = aggBySku.get(sku) || null; + const img = agg?.img || ""; + + // show "+N" if the canonical SKU exists in other stores (via SKU mapping) + const storeCount = agg?.stores?.size || 0; + const plus = storeCount > 1 ? ` +${storeCount - 1}` : ""; const href = String(r.url || "").trim(); const storeBadge = href ? `${esc( - r.storeLabel || "" + (r.storeLabel || "") + plus )}` - : `${esc(r.storeLabel || "")}`; + : `${esc((r.storeLabel || "") + plus)}`; // date as a badge so it sits nicely in the single meta row const dateBadge = when ? `${esc(when)}` : "";