← back to Designer Wallcoverings
pending-approval: color-dot specific-product deeplink memo + staged push script (2026-07-09)
6a1dfb5e47e24c81dc3fe6d785c4138cf237a71b · 2026-07-09 08:13:38 -0700 · Steve Abrams
Files touched
A pending-approval/color-dot-specific-product-deeplink-2026-07-09/MEMO.mdA pending-approval/color-dot-specific-product-deeplink-2026-07-09/push-to-live.sh
Diff
commit 6a1dfb5e47e24c81dc3fe6d785c4138cf237a71b
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Jul 9 08:13:38 2026 -0700
pending-approval: color-dot specific-product deeplink memo + staged push script (2026-07-09)
---
.../MEMO.md | 78 ++++++++++++++++++++++
.../push-to-live.sh | 45 +++++++++++++
2 files changed, 123 insertions(+)
diff --git a/pending-approval/color-dot-specific-product-deeplink-2026-07-09/MEMO.md b/pending-approval/color-dot-specific-product-deeplink-2026-07-09/MEMO.md
new file mode 100644
index 00000000..cc2d28cf
--- /dev/null
+++ b/pending-approval/color-dot-specific-product-deeplink-2026-07-09/MEMO.md
@@ -0,0 +1,78 @@
+# PENDING APPROVAL — Color-dot click → specific product+variant (not the general collection)
+
+**Date:** 2026-07-09
+**Owner:** vp-dw-commerce
+**File:** `snippets/color-palette.liquid` (live theme 5.9.1 [Dev] hero-appt-CTA, #144076931123)
+**Status:** committed locally (`6ba5016`), verified live-read-only, STAGED — NOT pushed. Customer-facing → Steve-gated.
+
+## Steve's feedback (verbatim)
+> "on click dots should go to that color and not the general collection"
+
+North-star target URL shape:
+`/collections/green-wallpaper-collection/products/dwqw-56337-handle?...&variant=42301342187571`
+(specific product + specific variant; collection kept in the path for breadcrumb.)
+
+## Which dot-type is this? (proof)
+**Fork B — PALETTE-EXTRACTED HEXES**, not colorway-siblings.
+Proof from the snippet: dots are built by `makeSwatch(hex, …)` from three sources
+in priority order — (1) `custom.color_details` / `color_dots_json` metafield JSON,
+(2) canvas pixel extraction of the product image (`fromCanvas` → median buckets →
+`closestName`), (3) primary/single hex metafields. Each dot is a **measured hue
+with no single owning product** — plus ~20 interpolated in-between swatches per
+pair that own nothing at all. So "that color" cannot be a colorway-sibling; it must
+be resolved to the nearest SPECIFIC product OF that hue.
+
+The CLIP `/apps/similar` endpoint was evaluated and rejected for this: it **requires
+a `dw_sku`** (not a bare hex) and returns **no variant id** — wrong tool for a
+hex→product lookup. It stays where it is, powering the separate "More Wallcoverings
+Like This" strip (untouched).
+
+## What changed (before → after)
+Each dot's family (`familyFromHex`) → family collection handle (`FAM_COLL`) is
+unchanged. What changed is the **click target**:
+
+- **BEFORE:** `href = /collections/green-wallpaper-collection?sort_by=created-descending`
+ (the general listing — Steve's complaint).
+- **AFTER (verified live):** left-click runs `resolveSpecificHref(hex)` →
+ fetches `/collections/green-wallpaper-collection/products.json?limit=40`,
+ canvas-samples each product's dominant RGB, picks the nearest to the clicked hex,
+ and navigates to:
+ `/collections/green-wallpaper-collection/products/dwkk-119054?variant=42640920936499`
+ (specific product + **roll** variant — never the $4.25 Sample; collection in path).
+
+- **Fallback (edge case only):** if products.json is empty/unreachable, it falls
+ back to the family collection listing — so a dot is never dead. The plain `href`
+ is still the family collection so middle-click / new-tab / crawlers get a valid
+ destination.
+- **Unchanged:** the swatch hex fill (`el.style.background=hex`), the interpolated
+ spectrum, the legend/proportion bar, and the entire "More Wallcoverings Like This"
+ CLIP strip.
+
+## Local verification
+- `node --check` on both extracted `<script>` blocks → OK.
+- `shopify theme check` → 5 warnings, **all pre-existing** (e.g. `img_url`
+ deprecation); 0 new offenses, 0 errors.
+- Fresh live pull (`theme-LIVE-591-freshpull-20260709`) was byte-identical to the
+ edited base before edits — the staged file IS the live snippet + this change.
+- **Headless (puppeteer, live storefront)** on the real green PDP
+ `dwqw-56337-handle`: a forest-green dot (`#2E6B3E`) resolved to
+ `/collections/green-wallpaper-collection/products/dwkk-119054?variant=42640920936499`
+ (20 green products sampled; nearest rgb [29,132,56]). PASS regex:
+ `^/collections/green-wallpaper-collection/products/[^?]+\?variant=\d+$`.
+
+## Push command for Steve (ship it)
+```bash
+bash ~/Projects/Designer-Wallcoverings/pending-approval/color-dot-specific-product-deeplink-2026-07-09/push-to-live.sh
+```
+That script backs up the current live snippet to `shopify/theme-backups/` first, then
+PUTs `snippets/color-palette.liquid` to live theme #144076931123. Equivalent CLI:
+```bash
+cd ~/Projects/Designer-Wallcoverings/shopify/theme-LIVE-591-freshpull-20260709
+SHOPIFY_CLI_THEME_TOKEN=$SHOPIFY_THEME_TOKEN \
+ shopify theme push --allow-live --theme 144076931123 \
+ --store designer-laboratory-sandbox.myshopify.com \
+ --only snippets/color-palette.liquid
+```
+
+**Revert:** PUT the `theme-backups/color-palette.liquid.LIVE-144076931123.<ts>.bak`
+back to `snippets/color-palette.liquid` on theme 144076931123.
diff --git a/pending-approval/color-dot-specific-product-deeplink-2026-07-09/push-to-live.sh b/pending-approval/color-dot-specific-product-deeplink-2026-07-09/push-to-live.sh
new file mode 100755
index 00000000..fdecdaa0
--- /dev/null
+++ b/pending-approval/color-dot-specific-product-deeplink-2026-07-09/push-to-live.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+# STEVE-GATED: push the color-palette dot-click fix to the LIVE theme.
+# Ships snippets/color-palette.liquid ONLY. Backs up the current live version first.
+#
+# Change: a color-dot click now resolves to the ONE nearest SPECIFIC
+# product+variant of that hue and navigates to
+# /collections/<family>/products/<handle>?variant=<rollVariantId>
+# instead of the general /collections/<family> listing. (Steve 2026-07-09)
+set -euo pipefail
+
+STORE="designer-laboratory-sandbox.myshopify.com"
+API="2024-10"
+TID="144076931123" # live theme 5.9.1 [Dev] hero-appt-CTA
+SRC="$HOME/Projects/Designer-Wallcoverings/shopify/theme-LIVE-591-freshpull-20260709/snippets/color-palette.liquid"
+SECRETS="$HOME/Projects/secrets-manager/.env"
+
+TOK="$(grep -hE '^SHOPIFY_THEME_TOKEN=' "$SECRETS" | head -1 | cut -d= -f2- | tr -d '"'"'"'')"
+[ -z "$TOK" ] && { echo "no theme token"; exit 1; }
+[ -f "$SRC" ] || { echo "source snippet missing: $SRC"; exit 1; }
+echo "token …${TOK: -4} | live theme $TID"
+
+BK="$HOME/Projects/Designer-Wallcoverings/shopify/theme-backups/color-palette.liquid.LIVE-$TID.$(date +%Y%m%d-%H%M%S).bak"
+mkdir -p "$(dirname "$BK")"
+curl -s "https://$STORE/admin/api/$API/themes/$TID/assets.json?asset%5Bkey%5D=snippets/color-palette.liquid" \
+ -H "X-Shopify-Access-Token: $TOK" \
+ | python3 -c "import sys,json;open('$BK','w').write(json.load(sys.stdin)['asset']['value'])"
+echo "backup: $BK ($(wc -c < "$BK") bytes)"
+
+# PUT the new snippet
+python3 - "$STORE" "$API" "$TID" "$TOK" "$SRC" <<'PY'
+import sys, json, urllib.request
+store, api, tid, tok, src = sys.argv[1:6]
+val = open(src).read()
+body = json.dumps({"asset": {"key": "snippets/color-palette.liquid", "value": val}}).encode()
+r = urllib.request.Request(f"https://{store}/admin/api/{api}/themes/{tid}/assets.json",
+ data=body, method="PUT",
+ headers={"X-Shopify-Access-Token": tok, "Content-Type": "application/json"})
+resp = urllib.request.urlopen(r)
+print("PUT", resp.status, "OK", f"({len(val)} bytes)")
+PY
+
+echo "verify on a real green PDP:"
+echo " https://www.designerwallcoverings.com/products/dwqw-56337-handle"
+echo "click a green dot → should land on /collections/green-wallpaper-collection/products/<handle>?variant=<id>"
+echo "revert: PUT $BK back to snippets/color-palette.liquid on theme $TID"
← 6c3ffae7 auto-save: 2026-07-09T08:09:34 (7 files) — DW-Programming/Im
·
back to Designer Wallcoverings
·
color-dot deep-link SHIPPED to live theme #144076931123; mem 8a467c31 →