[object Object]

← back to Designer Wallcoverings

card-hover: mobile shows ONLY pattern name (always-visible, vendor hidden); add to live-push bundle

3af4a7054482daf1a3fbeac5a4d5c44eee90519a · 2026-06-22 19:16:40 -0700 · Steve Abrams

Files touched

Diff

commit 3af4a7054482daf1a3fbeac5a4d5c44eee90519a
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Jun 22 19:16:40 2026 -0700

    card-hover: mobile shows ONLY pattern name (always-visible, vendor hidden); add to live-push bundle
---
 shopify/push-hfilter-to-live-5.0.py                | 75 ++++++++++++++++++++++
 .../theme-5.0-duplicate/assets/dw-card-hover.js    |  4 +-
 2 files changed, 78 insertions(+), 1 deletion(-)

diff --git a/shopify/push-hfilter-to-live-5.0.py b/shopify/push-hfilter-to-live-5.0.py
new file mode 100644
index 00000000..01c46270
--- /dev/null
+++ b/shopify/push-hfilter-to-live-5.0.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python3
+"""
+Push the horizontal collapsible Boost filter bar (+ closed product padding)
+onto the LIVE theme "Steves Version 5.0" (142250278963).
+
+Ships (from the verified 5.1 build in theme-5.0-duplicate/):
+  - assets/dw-hfilter.css            (new)
+  - assets/dw-hfilter.js             (new)
+  - snippets/dw-boost-overrides.liquid  (edited: horizontal bar wiring, single
+    toggle, real Boost selectors, gap:0 / padding:0 on the product grid)
+  - layout/theme.liquid              (surgically add the collection/search-guarded
+    dw-hfilter include after the existing dw-card-hover.js include; idempotent)
+
+SAFE: every asset is backed up (GET-before-PUT) into live-5.0-hfilter-backups/
+before writing. theme.liquid is edited surgically (not overwritten). Idempotent.
+Revert: re-PUT each live-5.0-hfilter-backups/*.bak to its key on theme 142250278963.
+
+Run:  python3 ~/Projects/Designer-Wallcoverings/shopify/push-hfilter-to-live-5.0.py
+"""
+import os, re, json, urllib.request, urllib.parse, datetime, sys
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+os.chdir(HERE)
+STORE = 'designer-laboratory-sandbox.myshopify.com'
+TT = re.search(r'shpat_[a-f0-9]{32}', open('../DW-Agents/dw-agents/update-theme-quantity.js').read()).group(0)
+THEME = '142250278963'   # LIVE Steves Version 5.0
+H = {'X-Shopify-Access-Token': TT, 'Content-Type': 'application/json'}
+base = 'https://%s/admin/api/2024-01/themes/%s/assets.json' % (STORE, THEME)
+LOCAL = 'theme-5.0-duplicate'
+
+def get(key):
+    u = base + '?' + urllib.parse.urlencode({'asset[key]': key})
+    return json.load(urllib.request.urlopen(urllib.request.Request(u, headers=H)))['asset']['value']
+def put(key, val):
+    body = json.dumps({'asset': {'key': key, 'value': val}}).encode()
+    return urllib.request.urlopen(urllib.request.Request(base, data=body, method='PUT', headers=H)).status
+def norm(s): return s.replace('\r\n', '\n').rstrip()
+
+os.makedirs('live-5.0-hfilter-backups', exist_ok=True)
+stamp = datetime.datetime.now().strftime('%Y%m%d-%H%M%S')
+
+# 1) assets + the edited override snippet (full-file replace; mine = live base + my edits)
+for key in ['assets/dw-hfilter.css', 'assets/dw-hfilter.js', 'assets/dw-card-hover.js', 'snippets/dw-boost-overrides.liquid']:
+    want = open(os.path.join(LOCAL, key), encoding='utf-8').read()
+    try:
+        cur = get(key)
+        open('live-5.0-hfilter-backups/%s.%s.bak' % (key.replace('/', '_'), stamp), 'w', encoding='utf-8').write(cur)
+        print('backup existing', key)
+    except Exception:
+        print('new asset', key)
+    put(key, want); ver = get(key)
+    print('PUT', key, 'verify=', 'OK' if norm(ver) == norm(want) else 'MISMATCH')
+
+# 2) theme.liquid — surgical, idempotent insert of the guarded include after dw-card-hover.js
+tl = get('layout/theme.liquid')
+open('live-5.0-hfilter-backups/layout_theme.liquid.%s.bak' % stamp, 'w', encoding='utf-8').write(tl)
+if 'dw-hfilter.js' in tl:
+    print('theme.liquid already has dw-hfilter include — skip')
+else:
+    anchor = '<script src="{{ \'dw-card-hover.js\' | asset_url }}" defer></script>'
+    if anchor not in tl:
+        print('!! anchor (dw-card-hover include) not found in live theme.liquid — ABORT theme.liquid edit'); sys.exit(1)
+    inject = (anchor +
+              "\n{%- comment -%} DW horizontal collapsible Boost filter bar (2026-06-22) {%- endcomment -%}"
+              "\n{%- if template contains 'collection' or template contains 'search' -%}"
+              "\n  {{ 'dw-hfilter.css' | asset_url | stylesheet_tag }}"
+              "\n  <script src=\"{{ 'dw-hfilter.js' | asset_url }}\" defer></script>"
+              "\n{%- endif -%}")
+    tl2 = tl.replace(anchor, inject, 1)
+    put('layout/theme.liquid', tl2); ver = get('layout/theme.liquid')
+    print('PUT layout/theme.liquid verify=', 'OK' if 'dw-hfilter.js' in ver else 'MISMATCH',
+          '(+%d bytes)' % (len(tl2) - len(tl)))
+
+print('\nDONE. Backups in shopify/live-5.0-hfilter-backups/ (stamp %s).' % stamp)
+print('Verify live: https://www.designerwallcoverings.com/collections/new-arrivals')
diff --git a/shopify/theme-5.0-duplicate/assets/dw-card-hover.js b/shopify/theme-5.0-duplicate/assets/dw-card-hover.js
index 8f7a43c1..c9d5ca46 100644
--- a/shopify/theme-5.0-duplicate/assets/dw-card-hover.js
+++ b/shopify/theme-5.0-duplicate/assets/dw-card-hover.js
@@ -21,7 +21,9 @@
       '.boost-sd__product-item:hover .dw-hover-label{opacity:1;}' +
       '.dw-hover-label{opacity:0;transition:opacity .15s;padding:6px 2px 0;pointer-events:none;}' +
       '.dw-hover-label .pat{font-size:13px;font-weight:600;color:#1a1a1a;line-height:1.2;}' +
-      '.dw-hover-label .ven{font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:#888;margin-top:2px;}';
+      '.dw-hover-label .ven{font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:#888;margin-top:2px;}' +
+      /* Mobile: no real hover -> always show, and ONLY the pattern name (hide vendor). */
+      '@media(max-width:768px){.boost-sd__product-item .dw-hover-label{opacity:1 !important;}.dw-hover-label .ven{display:none !important;}}';
     document.head.appendChild(st);
   }
 

← e837c6e6 Add Approach B testing checklist + troubleshooting guide  ·  back to Designer Wallcoverings  ·  Fix UI bugs: hide product info at rest, tight margins (2px), 9afd52da →