[object Object]

← back to All Designerwallcoverings

contrarian fixes: price-only live result gets neutral dot + 'availability unknown — price file only' disclosure + human tooltip; STOCK lookup falls back to -Sample-stripped key

c5afd0dc62244907a8ea35e84827d7a065da56c1 · 2026-07-15 14:39:50 -0700 · Steve Abrams

Files touched

Diff

commit c5afd0dc62244907a8ea35e84827d7a065da56c1
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 15 14:39:50 2026 -0700

    contrarian fixes: price-only live result gets neutral dot + 'availability unknown — price file only' disclosure + human tooltip; STOCK lookup falls back to -Sample-stripped key
---
 public/index.html | 9 +++++++--
 server.js         | 5 ++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/public/index.html b/public/index.html
index 219c581..153ff65 100644
--- a/public/index.html
+++ b/public/index.html
@@ -763,7 +763,10 @@ function actButtonsHTML(r) {
     const label = r.live_tier === 'DB_AUTHORITATIVE' ? 'Price ⚡ $0 · instant'
       : r.live_tier === 'PUBLIC_STOCK' ? 'Check Live · ~$0.03'
       : 'Check Live · ~$0.15–0.30';
-    face = `<button class="im livebtn face" type="button" data-sku="${esc(r.sku || '')}" title="${esc(r.live_reason || '')} · result cached 10 min">${label}</button>`;
+    const hint = r.live_tier === 'DB_AUTHORITATIVE'
+      ? 'Instant authoritative price from the vendor price file — price only, availability not checked'
+      : (r.live_reason || 'Live vendor check');
+    face = `<button class="im livebtn face" type="button" data-sku="${esc(r.sku || '')}" title="${esc(hint)} · result cached 10 min">${label}</button>`;
   } else if (r.stock) {
     const inS = !!r.stock.in_stock;
     face = `<button class="im stockbtn face ${inS ? 'in' : 'out'}" type="button" title="stored snapshot${r.stock.as_of ? ' · as of ' + esc(r.stock.as_of) : ''}">Stock ${inS ? '✓' : '✗'} (stored)</button>`;
@@ -850,7 +853,9 @@ function renderLive(pop, d) {
   // never "Availability: unknown" (frontend iteration 2 of the Phase-1 plan).
   if (d.in_stock == null && d.price != null) {
     const pcost = d.cached ? 'cached · $0' : '$' + Number(d.cost_usd || 0).toFixed(2);
-    pop.innerHTML = `<span class="sdot in">●</span> Authoritative price <b>$${Number(d.price).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</b><div class="sline mut">as of ${esc(fmtWhen(d.as_of))} · <b class="lcost">${pcost}</b></div>`;
+    // Price-file result, NOT an inventory read — neutral dot + explicit disclosure so the
+    // user never mistakes "we have an authoritative price" for "it's in stock".
+    pop.innerHTML = `<span class="sdot">●</span> Authoritative price <b>$${Number(d.price).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</b><div class="sline mut">availability unknown — price file only · use Email Vendor to confirm stock</div><div class="sline mut">as of ${esc(fmtWhen(d.as_of))} · <b class="lcost">${pcost}</b></div>`;
     return;
   }
   const dot = d.in_stock === true ? '<span class="sdot in">●</span> In stock (live)'
diff --git a/server.js b/server.js
index ba11d4c..9521c04 100644
--- a/server.js
+++ b/server.js
@@ -474,7 +474,10 @@ function deriveRow(r) {
       const entry = VENDOR_ITEM.get(slugify(r.vendor));
       return (entry && entry.handles.has(r.handle)) ? `${entry.url}product/${encodeURIComponent(r.handle)}` : null;
     })(),
-    stock: (sku && STOCK.get(String(sku).toUpperCase())) || null,
+    // Grid SKUs may carry a variant suffix (…-Sample) while STOCK is keyed by bare dw_sku —
+    // fall back to the stripped key so sample-variant rows still surface the snapshot.
+    stock: (sku && (STOCK.get(String(sku).toUpperCase())
+      || STOCK.get(String(sku).toUpperCase().replace(/-SAMPLE$/, '')))) || null,
     // live_capable + live_tier + live_reason come from the committed coverage audit. They drive the
     // card's "Check Live 🔄" enable/dim AND the per-tier dim reason (no-creds vs quote-only vs no-stock).
     // The endpoint self-gates again server-side against the same coverage entry.

← add8bb3 coverage hot-reload: re-read live-stock-coverage.json on mti  ·  back to All Designerwallcoverings  ·  auto-save: 2026-07-15T16:38:37 (4 files) — scripts/adapters/ 3658c7c →