[object Object]

← back to Dw Discovery

Add Contents/Pattern/Color/SKU card-field chips + widen search to match sku/subtype/category/style/palette names (:8771 request)

cfcc937287c9541c5db0f2d7d46af6bfd3025338 · 2026-06-24 09:38:04 -0700 · Steve Abrams

Files touched

Diff

commit cfcc937287c9541c5db0f2d7d46af6bfd3025338
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jun 24 09:38:04 2026 -0700

    Add Contents/Pattern/Color/SKU card-field chips + widen search to match sku/subtype/category/style/palette names (:8771 request)
---
 dw-discovery.js | 11 +++++++++--
 index.html      |  2 ++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dw-discovery.js b/dw-discovery.js
index 1f848d5..dc3fca9 100644
--- a/dw-discovery.js
+++ b/dw-discovery.js
@@ -53,7 +53,7 @@
       sort: LS('sort', 'featured'),
       cols: LS('cols', 4),
       layout: LS('layout', 'sidebar'),     // Filter layout
-      cardFields: LS('cardFields', { price: true, vendor: true, swatch: true }),
+      cardFields: LS('cardFields', { price: true, vendor: true, swatch: true, contents: true, pattern: false, color: true, sku: true }),
       merchandising: LS('merch', { featuredFirst: true, inStockFirst: true }),
       query: ''
     };
@@ -74,7 +74,10 @@
     function passes(p) {
       if (state.query) {
         const q = state.query.toLowerCase();
-        if (!(p.title + ' ' + p.vendor + ' ' + p.colorName).toLowerCase().includes(q)) return false;
+        const pal = Array.isArray(p.palette) ? p.palette.map(c => c.name).join(' ') : '';
+        const hay = [p.title, p.vendor, p.colorName, p.sku, p.subtype, p.category, p.style, pal]
+          .filter(Boolean).join(' ').toLowerCase();
+        if (!hay.includes(q)) return false;
       }
       for (const f in state.facets) {
         const sel = state.facets[f]; if (!sel.length) continue;
@@ -272,6 +275,10 @@
           ${p.goLiveAt ? `<span class="dwd-golive" title="Going live ${p.goLiveAt}">🕓 Live ${new Date(p.goLiveAt).toLocaleString(undefined,{month:'short',day:'numeric',hour:'numeric',minute:'2-digit'})}</span>` : ''}
           <div class="dwd-title">${p.title}</div>
           ${cf.vendor ? `<div class="dwd-vendor">${p.vendor}</div>` : ''}
+          ${cf.pattern && p.title ? `<div class="dwd-fld"><b>Pattern</b> ${p.title}</div>` : ''}
+          ${cf.contents && p.subtype ? `<div class="dwd-fld"><b>Contents</b> ${p.subtype}</div>` : ''}
+          ${cf.color && p.colorName ? `<div class="dwd-fld"><b>Color</b> ${p.colorName}</div>` : ''}
+          ${cf.sku && p.sku ? `<div class="dwd-fld"><b>SKU</b> ${p.sku}</div>` : ''}
           ${pal}
           <div class="dwd-row2">
             ${cf.price ? `<span class="dwd-price">$${p.price.toFixed(2)}</span>` : '<span></span>'}
diff --git a/index.html b/index.html
index 36ca220..787a4eb 100644
--- a/index.html
+++ b/index.html
@@ -90,6 +90,8 @@
   .dwd-pal span{display:block;height:100%}
   .dwd-pal-legend{font-size:10px;color:var(--mut);line-height:1.3;margin-bottom:2px}
   .dwd-golive{display:inline-block;font-size:10px;font-weight:600;color:#9a6a00;background:#fff7e6;border:1px solid #e7c98a;border-radius:4px;padding:2px 6px;margin:0 0 4px 4px}
+  .dwd-fld{font-size:11px;color:var(--mut);line-height:1.35}
+  .dwd-fld b{color:var(--ink);font-weight:600;text-transform:uppercase;font-size:9px;letter-spacing:.04em;margin-right:4px}
   .dwd-meta{padding:11px 13px 14px}
   .dwd-title{font-weight:600;font-size:14px;line-height:1.25}
   .dwd-vendor{color:var(--mut);font-size:12px;margin-top:2px}

← 54b5813 Add Staged for New cohort (56 cadence-queued SKUs) with proj  ·  back to Dw Discovery  ·  Staged-for-New chip: show full launch date+time with year (� b5e553d →