[object Object]

← back to Wallco Ai

/designs admin transparency badge + catalog republish + quarantine restore

44b348957b97941760344ff7739bde54643655ef · 2026-05-25 01:24:55 -0700 · Steve Abrams

Three landings:

1. /designs admin-only catalog badge — row of 4 pills under the source-chip
   row: <N> active · <N> visible here · <N> archived → · <N> removed →.
   Archived + Removed link to /admin/status-browser pre-filtered. Shows PNG
   gap (active − visible) when files are missing on disk so the disconnect
   between PG state and the public catalog is never a mystery again.
   Public users see nothing changed.

2. Bulk PG republish (3,440 rows) — flipped is_published=TRUE on orphan
   sources (unpublished, not-removed, no published descendant). Skipped 756
   settlement-suspect rows pre-flight so the trigger doesn't atomic-abort.
   Reversibility log at data/bulk-ops/republish-orphans-*.jsonl.

3. Quarantine restore (4,282 PNGs) — copied generated_ghost_quarantine/
   files back to data/generated/ for every PG row whose local_path was
   pointing at a missing file. /api/designs total jumped from 22,948 →
   27,230 after restart. Reversibility log at quarantine-restore-*.jsonl.

Files touched

Diff

commit 44b348957b97941760344ff7739bde54643655ef
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon May 25 01:24:55 2026 -0700

    /designs admin transparency badge + catalog republish + quarantine restore
    
    Three landings:
    
    1. /designs admin-only catalog badge — row of 4 pills under the source-chip
       row: <N> active · <N> visible here · <N> archived → · <N> removed →.
       Archived + Removed link to /admin/status-browser pre-filtered. Shows PNG
       gap (active − visible) when files are missing on disk so the disconnect
       between PG state and the public catalog is never a mystery again.
       Public users see nothing changed.
    
    2. Bulk PG republish (3,440 rows) — flipped is_published=TRUE on orphan
       sources (unpublished, not-removed, no published descendant). Skipped 756
       settlement-suspect rows pre-flight so the trigger doesn't atomic-abort.
       Reversibility log at data/bulk-ops/republish-orphans-*.jsonl.
    
    3. Quarantine restore (4,282 PNGs) — copied generated_ghost_quarantine/
       files back to data/generated/ for every PG row whose local_path was
       pointing at a missing file. /api/designs total jumped from 22,948 →
       27,230 after restart. Reversibility log at quarantine-restore-*.jsonl.
---
 server.js | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/server.js b/server.js
index e34226d..d37cd47 100644
--- a/server.js
+++ b/server.js
@@ -4473,6 +4473,26 @@ ${cat === 'mural-scenic' ? `
   <a href="/designs?source=all" class="src-chip" style="padding:6px 14px;border-radius:999px;border:1px solid ${(req.query.source === 'all') ? 'var(--accent,#1a1a1a)' : 'var(--line,#d8d0c0)'};background:${(req.query.source === 'all') ? 'var(--accent,#1a1a1a)' : 'transparent'};color:${(req.query.source === 'all') ? 'var(--bg,#fff)' : 'var(--ink,#3a2818)'};font:11px var(--sans);letter-spacing:.04em;text-decoration:none">★ All (Combined)</a>` : ''}
   <span style="font:11px var(--sans);color:var(--ink-faint,#8a7a5e);margin-left:auto">${isAdmin(req) ? ((req.query.source === 'all') ? 'AI + designer library' : 'Curated-generated patterns') : 'Curated-generated patterns'}</span>
 </div>
+${_isAdmin ? (() => {
+  // Catalog transparency badge — admin-only. Three clickable counts so Steve
+  // always sees the full picture: what's live, what's archived (unpublished
+  // sources), what's soft-removed. Counts are PG-fresh, ~3ms total. 2026-05-25.
+  try {
+    const fmt = n => Number(n).toLocaleString('en-US');
+    const activeN = parseInt(psqlQuery("SELECT count(*) FROM spoon_all_designs WHERE brand='wallco.ai' AND is_published=TRUE AND user_removed IS NOT TRUE"), 10) || 0;
+    const archivedN = parseInt(psqlQuery("SELECT count(*) FROM spoon_all_designs WHERE brand='wallco.ai' AND is_published=FALSE AND user_removed IS NOT TRUE"), 10) || 0;
+    const removedN  = parseInt(psqlQuery("SELECT count(*) FROM spoon_all_designs WHERE brand='wallco.ai' AND user_removed=TRUE"), 10) || 0;
+    const visN = total;
+    return `<div class="admin-catalog-badge" style="max-width:1400px;margin:6px auto 0;padding:0 24px;display:flex;gap:8px;align-items:center;flex-wrap:wrap;font:11px var(--sans,system-ui);letter-spacing:.04em">
+  <span style="color:var(--ink-faint,#8a7a5e);letter-spacing:.18em;text-transform:uppercase;margin-right:4px">Admin · catalog</span>
+  <span title="In PG: published & not soft-removed" style="padding:5px 11px;border:1px solid #3a8a5a;color:#1f5a3a;background:rgba(58,138,90,.06);border-radius:999px"><strong>${fmt(activeN)}</strong> active</span>
+  <span title="Visible at /designs after blank-guard + file-existence filter" style="padding:5px 11px;border:1px dashed #3a8a5a;color:#3a5a4a;background:transparent;border-radius:999px"><strong>${fmt(visN)}</strong> visible here</span>
+  <a href="/admin/status-browser?status=unpublished" style="padding:5px 11px;border:1px solid #c9a14b;color:#8a6f24;background:rgba(201,161,75,.05);border-radius:999px;text-decoration:none" title="Open status-browser → Unpublished filter"><strong>${fmt(archivedN)}</strong> archived →</a>
+  <a href="/admin/status-browser?status=removed" style="padding:5px 11px;border:1px solid #c84a3a;color:#9a2a1a;background:rgba(200,74,58,.05);border-radius:999px;text-decoration:none" title="Open status-browser → Removed filter"><strong>${fmt(removedN)}</strong> removed →</a>
+  ${activeN > visN ? `<span style="color:var(--ink-faint,#8a7a5e);margin-left:auto" title="active − visible = PG rows whose PNG is missing on disk (run quarantine restore)">PNG gap: <strong>${fmt(activeN - visN)}</strong></span>` : ''}
+</div>`;
+  } catch (e) { return ''; }
+})() : ''}
 ${(req.query.source === 'all') ? `
 <script>
 (function(){

← fd353db fix(recolor): tighten brand-mode prompt so signature accent  ·  back to Wallco Ai  ·  feat(design page): tag remaining buyer blocks for drawer rel f34f3f9 →