← back to Designer Wallcoverings
fix(theme): unhide DW density/grid slider on collection pages (DEV theme)
8eb976d71ccf830ceed8d743cf311692d3719f9e · 2026-06-23 16:26:52 -0700 · Steve
Remove dead CSS guard '.shopify-section > .dw-grid-slider{display:none !important}'
from snippets/dw-boost-overrides.liquid. The guard targeted a leftover STATIC slider
that no longer exists; the slider is now JS-injected into the Boost toolbar row, which
on the live DOM is a direct child of .shopify-section -> the guard killed the only
slider site-wide. JS dedup loop already handles stray duplicates. DTD verdict A.
Staged on DEV theme 143794536499 only; live untouched. Adds drift-safe push/rollback script.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
A shopify/push-grid-slider-unhide-to-dev-theme.shM shopify/theme-files/snippets/dw-boost-overrides.liquid
Diff
commit 8eb976d71ccf830ceed8d743cf311692d3719f9e
Author: Steve <steve@designerwallcoverings.com>
Date: Tue Jun 23 16:26:52 2026 -0700
fix(theme): unhide DW density/grid slider on collection pages (DEV theme)
Remove dead CSS guard '.shopify-section > .dw-grid-slider{display:none !important}'
from snippets/dw-boost-overrides.liquid. The guard targeted a leftover STATIC slider
that no longer exists; the slider is now JS-injected into the Boost toolbar row, which
on the live DOM is a direct child of .shopify-section -> the guard killed the only
slider site-wide. JS dedup loop already handles stray duplicates. DTD verdict A.
Staged on DEV theme 143794536499 only; live untouched. Adds drift-safe push/rollback script.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
shopify/push-grid-slider-unhide-to-dev-theme.sh | 84 ++++++++++++++++++++++
.../theme-files/snippets/dw-boost-overrides.liquid | 5 +-
2 files changed, 87 insertions(+), 2 deletions(-)
diff --git a/shopify/push-grid-slider-unhide-to-dev-theme.sh b/shopify/push-grid-slider-unhide-to-dev-theme.sh
new file mode 100755
index 00000000..2b68085e
--- /dev/null
+++ b/shopify/push-grid-slider-unhide-to-dev-theme.sh
@@ -0,0 +1,84 @@
+#!/usr/bin/env bash
+# Restore the hidden DW density/grid slider on COLLECTION pages by removing a dead
+# CSS guard rule from snippets/dw-boost-overrides.liquid on the DEV theme.
+#
+# ROOT CAUSE: `.shopify-section > .dw-grid-slider{display:none !important}` was an
+# old guard meant to hide a LEFTOVER STATIC slider. The slider is now injected by
+# the snippet's JS into the Boost toolbar row, which on the live DOM is a DIRECT
+# child of `.shopify-section` — so the guard kills the ONLY slider site-wide.
+# The JS already de-dupes stray sliders (querySelectorAll('div.dw-grid-slider'),
+# hides index>0), so the guard is dead weight. DTD verdict A (2026-06-23): delete it.
+#
+# Drift-safe: PULLS the dev theme's current snippet, removes exactly the one dead
+# rule (asserts exactly 1 occurrence), backs up the original, pushes, verifies.
+# Targets the DEV theme ONLY — refuses to touch the live/main theme.
+#
+# THEME_TOKEN=shpat_xxx bash push-grid-slider-unhide-to-dev-theme.sh
+# # rollback:
+# THEME_TOKEN=shpat_xxx ROLLBACK=1 bash push-grid-slider-unhide-to-dev-theme.sh
+set -euo pipefail
+cd "$(dirname "$0")"
+
+STORE="designer-laboratory-sandbox.myshopify.com"
+API="2024-10"
+SECRETS="$HOME/Projects/secrets-manager/.env"
+DEV_THEME_ID="143794536499" # "Updated copy of NewWall Template [Dev]"
+KEY="snippets/dw-boost-overrides.liquid"
+
+TOK="${THEME_TOKEN:-$(grep -hE '^SHOPIFY_THEME_TOKEN=' "$SECRETS" 2>/dev/null | head -1 | cut -d= -f2- | tr -d '"'"'"' ')}"
+[ -z "$TOK" ] && { echo "No theme token. Run: THEME_TOKEN=shpat_xxx bash $0"; exit 1; }
+echo "token …${TOK: -4} | rollback=${ROLLBACK:-0}"
+
+mkdir -p theme-backups
+python3 - "$STORE" "$API" "$TOK" "$DEV_THEME_ID" "$KEY" "theme-backups" "${ROLLBACK:-0}" <<'PY'
+import sys, json, urllib.request, urllib.parse, datetime
+store, api, tok, dev_id, key, bkdir, rollback = sys.argv[1:8]
+dev_id = int(dev_id); rollback = rollback == "1"
+TARGET = ".shopify-section > .dw-grid-slider{display:none !important}"
+COMMENT = "/* Hide static grid slider from main section — dynamic one is injected into Boost toolbar */\n"
+H = {"X-Shopify-Access-Token": tok, "Content-Type": "application/json"}
+def get(u): return json.load(urllib.request.urlopen(urllib.request.Request(u, headers=H)))
+
+themes = get(f"https://{store}/admin/api/{api}/themes.json")["themes"]
+dev = next((t for t in themes if t["id"] == dev_id), None)
+assert dev, f"dev theme {dev_id} not found"
+assert dev["role"] != "main", "REFUSE: target resolves to the live/main theme"
+print(f'target: {dev_id} "{dev["name"]}" role={dev["role"]} — live untouched')
+
+q = urllib.parse.urlencode({"asset[key]": key})
+cur = get(f"https://{store}/admin/api/{api}/themes/{dev_id}/assets.json?{q}")["asset"]["value"]
+stamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
+bk = f"{bkdir}/dw-boost-overrides.dev-{dev_id}.{stamp}.bak"
+open(bk, "w").write(cur); print(f"backup: {bk} ({len(cur)} bytes)")
+
+if rollback:
+ if TARGET in cur:
+ print("rule already present on dev — nothing to roll back"); sys.exit(0)
+ print("ERROR: rollback restores the hide rule, but choose a .bak file to restore exactly.")
+ print("Restore the most recent .bak via the assets PUT, or re-add the rule manually.")
+ sys.exit(2)
+
+n = cur.count(TARGET)
+print("hide-rule occurrences:", n)
+assert n == 1, f"expected exactly 1 hide rule, found {n} — abort"
+
+new = cur
+if COMMENT + TARGET + "\n" in new:
+ new = new.replace(COMMENT + TARGET + "\n", "", 1)
+elif COMMENT + TARGET in new:
+ new = new.replace(COMMENT + TARGET, "", 1)
+elif TARGET + "\n" in new:
+ new = new.replace(TARGET + "\n", "", 1)
+else:
+ new = new.replace(TARGET, "", 1)
+assert TARGET not in new, "rule still present after edit — abort"
+assert ".dw-grid-slider{display:inline-flex" in new, "slider style block missing — abort sanity"
+print(f"edit: removed dead guard ({len(cur)-len(new)} bytes)")
+
+body = json.dumps({"asset": {"key": key, "value": new}}).encode()
+req = urllib.request.Request(f"https://{store}/admin/api/{api}/themes/{dev_id}/assets.json",
+ data=body, headers=H, method="PUT")
+resp = json.load(urllib.request.urlopen(req))
+print("pushed updated_at:", resp["asset"].get("updated_at"))
+print("verify (read-replica may lag a few s): re-pull and confirm hide_rule absent.")
+PY
diff --git a/shopify/theme-files/snippets/dw-boost-overrides.liquid b/shopify/theme-files/snippets/dw-boost-overrides.liquid
index ec14bd07..df7ec126 100644
--- a/shopify/theme-files/snippets/dw-boost-overrides.liquid
+++ b/shopify/theme-files/snippets/dw-boost-overrides.liquid
@@ -36,8 +36,9 @@ body.dw-filters-collapsed .boost-sd__product-list[class*="grid--"]{grid-template
.dw-filter-toggle:hover{background:#f5f5f5}
.dw-filter-toggle svg{width:14px;height:14px}
-/* Hide static grid slider from main section — dynamic one is injected into Boost toolbar */
-.shopify-section > .dw-grid-slider{display:none !important}
+/* (removed 2026-06-23) dead guard `.shopify-section > .dw-grid-slider{display:none !important}`
+ hid the ONLY slider site-wide — it's injected into the Boost toolbar row which is a direct
+ child of .shopify-section. JS dedup loop already hides stray sliders. DTD verdict A. */
/* Hide old dw-gc grid control — replaced by toolbar grid slider */
.dw-gc{display:none !important}
← 1cd2c5df Stage You-May-Also-Like mobile 2-up grid fix on dev theme 5.
·
back to Designer Wallcoverings
·
Fix collection rotating-hero hydration race: re-home rotator c9b7c05e →