[object Object]

← back to Designer Wallcoverings

Graft native-grid infinite scroll onto LIVE theme (newwall-infinite.js + 1 layout include)

ffd94410428356ea46f0e4726dc4590edb479e6e · 2026-06-23 13:19:48 -0700 · Steve Abrams

Surgical alternative to publishing the divergent dev theme 143947038771 (which differs
from live on header/templates/theme.css/grid.js and would regress live work). Adds only:
assets/newwall-infinite.js (2.7KB self-contained) + one defer script include before </body>
in live layout/theme.liquid. Verified live: include at L1265, JS asset 200, collections clean.
Native-paginated grids (brands/blog) now infinite-scroll; Boost product grids unchanged (Boost
app setting). Backup layout__theme.liquid.MAIN-142250278963.20260623-130648.bak.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit ffd94410428356ea46f0e4726dc4590edb479e6e
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Jun 23 13:19:48 2026 -0700

    Graft native-grid infinite scroll onto LIVE theme (newwall-infinite.js + 1 layout include)
    
    Surgical alternative to publishing the divergent dev theme 143947038771 (which differs
    from live on header/templates/theme.css/grid.js and would regress live work). Adds only:
    assets/newwall-infinite.js (2.7KB self-contained) + one defer script include before </body>
    in live layout/theme.liquid. Verified live: include at L1265, JS asset 200, collections clean.
    Native-paginated grids (brands/blog) now infinite-scroll; Boost product grids unchanged (Boost
    app setting). Backup layout__theme.liquid.MAIN-142250278963.20260623-130648.bak.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 shopify/push-infinite-graft-live.sh | 45 +++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/shopify/push-infinite-graft-live.sh b/shopify/push-infinite-graft-live.sh
new file mode 100644
index 00000000..03d15af8
--- /dev/null
+++ b/shopify/push-infinite-graft-live.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+# SURGICAL graft: add native-grid infinite scroll to the LIVE theme without the
+# divergent dev-theme cruft. Two changes only, both additive/reversible:
+#   1) copy assets/newwall-infinite.js (2.7KB, self-contained) from dev 143947038771 -> live
+#   2) add ONE <script src="newwall-infinite.js" defer> include before </body> in live's OWN layout
+# Live resolved dynamically (role==main). Backs up the layout; verifies after.
+# Note: this powers infinite scroll on NATIVE-paginated grids (brands/collections-list, blog).
+# The main Boost collection PRODUCT grids' infinite scroll is a Boost app setting (Shopify admin),
+# not a theme asset — out of scope here by design.
+set -euo pipefail
+cd "$(dirname "$0")"
+STORE="designer-laboratory-sandbox.myshopify.com"; API="2024-10"; DEV="143947038771"
+SECRETS="$HOME/Projects/secrets-manager/.env"
+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"; exit 1; }
+mkdir -p theme-backups
+python3 - "$STORE" "$API" "$TOK" "$DEV" <<'PY'
+import sys,json,urllib.request,urllib.parse,datetime
+store,api,tok,dev=sys.argv[1:5]
+H={"X-Shopify-Access-Token":tok,"Content-Type":"application/json"}
+def gget(u): return json.load(urllib.request.urlopen(urllib.request.Request(u,headers=H)))
+def aurl(tid,k): return f"https://{store}/admin/api/{api}/themes/{tid}/assets.json?"+urllib.parse.urlencode({"asset[key]":k})
+def put(tid,k,v):
+    return urllib.request.urlopen(urllib.request.Request(f"https://{store}/admin/api/{api}/themes/{tid}/assets.json",
+        data=json.dumps({"asset":{"key":k,"value":v}}).encode(),method="PUT",headers=H)).status
+live=str(next(t["id"] for t in gget(f"https://{store}/admin/api/{api}/themes.json")["themes"] if t["role"]=="main"))
+print("LIVE (role=main):",live)
+stamp=datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
+js=gget(aurl(dev,"assets/newwall-infinite.js"))["asset"]["value"]
+print(f"PUT assets/newwall-infinite.js -> live HTTP {put(live,'assets/newwall-infinite.js',js)} ({len(js)}b)")
+lay=gget(aurl(live,"layout/theme.liquid"))["asset"]["value"]
+open(f"theme-backups/layout__theme.liquid.MAIN-{live}.{stamp}.bak","w").write(lay)
+inc='  <script src="{{ \'newwall-infinite.js\' | asset_url }}" defer></script>\n'
+if "newwall-infinite.js" in lay:
+    print("already wired on live — layout unchanged")
+else:
+    idx=lay.rfind("</body>")
+    if idx==-1: print("ABORT: no </body>"); sys.exit(3)
+    new=lay[:idx]+inc+lay[idx:]
+    assert lay.count("</body>")==new.count("</body>") and len(new)-len(lay)==len(inc)
+    print(f"PUT layout/theme.liquid -> live HTTP {put(live,'layout/theme.liquid',new)} (+{len(inc)}b, backup {stamp})")
+chk=gget(aurl(live,"layout/theme.liquid"))["asset"]["value"]
+print("verify include on live:", "newwall-infinite.js" in chk, "| JS asset on live:", len(gget(aurl(live,'assets/newwall-infinite.js'))['asset'].get('value',''))>0)
+print(f"ROLLBACK: restore theme-backups/layout__theme.liquid.MAIN-{live}.{stamp}.bak and delete assets/newwall-infinite.js")
+PY

← d4a51d6f Fix room-setting pattern scale: drive tiling by real repeat,  ·  back to Designer Wallcoverings  ·  Add REGEN mode to room generator: replace our 557 rooms at c 144635ea →