[object Object]

← back to Wallco Ai

feat(/designs): tighten NEW window 72h→6h; was firing on every single design (6010/6010) after generator burst; env-overridable via NEW_BADGE_HOURS for future tuning

2fae7d57e91fb6df33b72db7508f4c423c535f65 · 2026-05-14 09:29:48 -0700 · SteveStudio2

Files touched

Diff

commit 2fae7d57e91fb6df33b72db7508f4c423c535f65
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Thu May 14 09:29:48 2026 -0700

    feat(/designs): tighten NEW window 72h→6h; was firing on every single design (6010/6010) after generator burst; env-overridable via NEW_BADGE_HOURS for future tuning
---
 server.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/server.js b/server.js
index 7b932d8..7abd0ac 100644
--- a/server.js
+++ b/server.js
@@ -3219,11 +3219,14 @@ app.get('/designs', (req, res) => {
       const roomOverlay = roomKey
         ? `<img class="card-room" src="/designs/room/design_${d.id}_${roomKey}.png" loading="lazy" alt="" aria-hidden="true"><span class="card-room-badge">${badgeText}</span>`
         : '';
-      // NEW badge — fires for any design created within the last 72 hours so freshly-
-      // generated batches visually stand out from the back-catalog. Top-right corner,
-      // sits above the favorite heart (which is top-left).
+      // NEW badge — fires for designs created within the last NEW_BADGE_HOURS.
+      // Was 72h; tightened to 6h on 2026-05-14 after observing every card glowed
+      // gold (6010/6010 designs <72h old after recent generator burst). At 6h
+      // the cohort drops to ~450 designs (about 1 page worth of "actually new"),
+      // making the ring a real signal again. Env-overridable for tuning.
+      const NEW_BADGE_HOURS = parseFloat(process.env.NEW_BADGE_HOURS || '6');
       const createdMs = Date.parse(d.created_at || '') || 0;
-      const isNew = createdMs && (Date.now() - createdMs < 72 * 3600 * 1000);
+      const isNew = createdMs && (Date.now() - createdMs < NEW_BADGE_HOURS * 3600 * 1000);
       const newBadge = isNew ? `<span class="card-new-badge" aria-label="Newly added">NEW</span>` : '';
       // DW-style SKU — derived from the design id with a stable two-letter prefix
       // for the wallco.ai sub-label (WC). Designer Wallcoverings catalog convention

← 2cc97c7 feat(/designs): density slider shows current col count + ari  ·  back to Wallco Ai  ·  feat(/designs): add 'Clear filters' chip when any hue/motif/ f69b164 →