← back to Designer Wallcoverings
auto-save: 2026-06-26T15:34:21 (6 files) — pending-approval/boost-filter-consolidation-2026-06-25 shopify/_cwGRID/sections/pattern-page.liquid shopify/_cwGRID/sections/similar-designs.liquid shopify/scripts/anna-french-repair-inplace.mjs vendor-scrapers/china-seas-refresh
d0429e1abcbff8f0a4c68541e2ae48d4622863b0 · 2026-06-26 15:34:26 -0700 · Steve Abrams
Files touched
M shopify/_cwGRID/sections/pattern-page.liquidM shopify/_cwGRID/sections/similar-designs.liquidA shopify/grid-js-fix/.gitignoreM shopify/scripts/anna-french-repair-inplace.mjs
Diff
commit d0429e1abcbff8f0a4c68541e2ae48d4622863b0
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Fri Jun 26 15:34:26 2026 -0700
auto-save: 2026-06-26T15:34:21 (6 files) — pending-approval/boost-filter-consolidation-2026-06-25 shopify/_cwGRID/sections/pattern-page.liquid shopify/_cwGRID/sections/similar-designs.liquid shopify/scripts/anna-french-repair-inplace.mjs vendor-scrapers/china-seas-refresh
---
shopify/_cwGRID/sections/pattern-page.liquid | 5 +-
shopify/_cwGRID/sections/similar-designs.liquid | 64 +++++++++++++++----------
shopify/grid-js-fix/.gitignore | 2 +
shopify/scripts/anna-french-repair-inplace.mjs | 9 ++--
4 files changed, 48 insertions(+), 32 deletions(-)
diff --git a/shopify/_cwGRID/sections/pattern-page.liquid b/shopify/_cwGRID/sections/pattern-page.liquid
index df2bac94..464ad05a 100644
--- a/shopify/_cwGRID/sections/pattern-page.liquid
+++ b/shopify/_cwGRID/sections/pattern-page.liquid
@@ -36,8 +36,6 @@
</header>
<div class="dw-pattern__grid" id="dw-pattern-grid" role="list"></div>
-
- <div id="similar-mount"></div>
</section>
<style>
@@ -162,6 +160,9 @@
if (sim && cw.length) {
sim.setAttribute('data-source-handle', cw[0].handle || '');
sim.setAttribute('data-source-sku', cw[0].dw_sku || '');
+ // similar-designs.liquid wires a one-time 'dw:similar-seed' listener when
+ // it parses without an identifier (no Shopify product object on this page).
+ document.dispatchEvent(new CustomEvent('dw:similar-seed'));
}
})
.catch(function () {
diff --git a/shopify/_cwGRID/sections/similar-designs.liquid b/shopify/_cwGRID/sections/similar-designs.liquid
index 8c7c8c89..f9ccfe32 100644
--- a/shopify/_cwGRID/sections/similar-designs.liquid
+++ b/shopify/_cwGRID/sections/similar-designs.liquid
@@ -98,22 +98,10 @@
if (!root) return;
var endpoint = root.getAttribute('data-similar-endpoint');
- var handle = root.getAttribute('data-product-handle');
- var sku = root.getAttribute('data-product-sku');
- // Pattern page (no Shopify product object) can set data-source-handle directly.
- if (!handle) handle = root.getAttribute('data-source-handle') || '';
- if (!sku) sku = root.getAttribute('data-source-sku') || '';
- var hasIdentifier = (sku && sku.length) || (handle && handle.length);
- if (!hasIdentifier) return;
- root.hidden = false;
-
- var cta = root.querySelector('.similar-designs__cta');
- var panel = document.getElementById('similar-designs-panel');
- var grid = document.getElementById('similar-designs-grid');
- var cols = document.getElementById('similar-designs-cols');
- var colsVal = document.getElementById('similar-designs-cols-val');
- var countEl = document.getElementById('similar-designs-count');
+ var handle, sku;
+ var cta, panel, grid, cols, colsVal, countEl;
var loaded = false;
+ var started = false;
function esc(s) {
return String(s == null ? '' : s)
@@ -136,7 +124,6 @@
cols.addEventListener('input', apply);
apply();
}
- wireSlider();
function renderSkeletons(n) {
var html = '';
@@ -193,16 +180,41 @@
.catch(function () { grid.innerHTML = '<div class="similar-designs__empty">Could not load similar designs right now.</div>'; });
}
- cta.addEventListener('click', function () {
- var open = cta.getAttribute('aria-expanded') === 'true';
- if (open) {
- cta.setAttribute('aria-expanded', 'false');
- panel.hidden = true;
- return;
- }
- cta.setAttribute('aria-expanded', 'true');
- load();
- });
+ // Resolve an identifier and wire the section. On product pages the product
+ // handle/SKU are present at parse time so this runs immediately. On the
+ // Pattern page there is no Shopify product object — pattern-page.liquid sets
+ // data-source-handle/sku after its colorways fetch resolves, then dispatches
+ // 'dw:similar-seed', at which point start() runs.
+ function start() {
+ if (started) return;
+ handle = root.getAttribute('data-product-handle') || root.getAttribute('data-source-handle') || '';
+ sku = root.getAttribute('data-product-sku') || root.getAttribute('data-source-sku') || '';
+ if (!((sku && sku.length) || (handle && handle.length))) return;
+ started = true;
+
+ root.hidden = false;
+ cta = root.querySelector('.similar-designs__cta');
+ panel = document.getElementById('similar-designs-panel');
+ grid = document.getElementById('similar-designs-grid');
+ cols = document.getElementById('similar-designs-cols');
+ colsVal = document.getElementById('similar-designs-cols-val');
+ countEl = document.getElementById('similar-designs-count');
+ wireSlider();
+
+ cta.addEventListener('click', function () {
+ var open = cta.getAttribute('aria-expanded') === 'true';
+ if (open) {
+ cta.setAttribute('aria-expanded', 'false');
+ panel.hidden = true;
+ return;
+ }
+ cta.setAttribute('aria-expanded', 'true');
+ load();
+ });
+ }
+
+ start();
+ if (!started) document.addEventListener('dw:similar-seed', start);
})();
</script>
diff --git a/shopify/grid-js-fix/.gitignore b/shopify/grid-js-fix/.gitignore
new file mode 100644
index 00000000..26bf96a3
--- /dev/null
+++ b/shopify/grid-js-fix/.gitignore
@@ -0,0 +1,2 @@
+# throwaway pre-edit dev-theme snapshot (not a deliverable)
+backups/custom.css.dev-143947038771.before
diff --git a/shopify/scripts/anna-french-repair-inplace.mjs b/shopify/scripts/anna-french-repair-inplace.mjs
index d6870e2c..465f0942 100644
--- a/shopify/scripts/anna-french-repair-inplace.mjs
+++ b/shopify/scripts/anna-french-repair-inplace.mjs
@@ -186,11 +186,12 @@ function computeProductPlan(stage, live, sibling /* the wrong-type ghost, if any
};
// --- 1. handle ---
+ // Always normalize a live handle that differs from the clean staging handle
+ // (leaky live handles are the common case; RE_LEAKY_HANDLE is kept above as the
+ // leak-detection vocabulary, but the flip decision is simply "differs from clean").
if (live.handle !== stage.clean_handle) {
- if (RE_LEAKY_HANDLE.test(live.handle) || RE_LEAKY_HANDLE.test('') === false) {
- plan.handle_flip = { from: live.handle, to: stage.clean_handle };
- plan.actions.push('handle-flip');
- }
+ plan.handle_flip = { from: live.handle, to: stage.clean_handle, leaky: RE_LEAKY_HANDLE.test(live.handle) };
+ plan.actions.push('handle-flip');
} else {
plan.handle_flip = 'NOOP';
}
← d1277e57 cadence/activate-gated: publish DRAFT->ACTIVE promotes to On
·
back to Designer Wallcoverings
·
auto-save: 2026-06-26T16:04:29 (16 files) — pending-approval ca8adbdf →