fix: MPS-24 — top chips navigate to the tag SERP like the left nav

Operator: the top chips should do what the new left-nav category links
do (navigate to the per-tag SERP rendered in the shop's configured
home_layout), not the in-place 'default cards' hide/show.

Root cause: tag_filter.js decided whether to intercept by checking
chips[0].href for '/tag/'. chips[0] is the 'All' chip, which points at
the shop home (shop_url, no '/tag/'), so the category chips' real
{tag_base}/tag/{slug} hrefs were never detected → tag_filter.js always
intercepted → in-place card filter. Now scan ALL chips: if any links
to /tag/<slug>, bail and let full navigation happen, so a chip behaves
exactly like its matching left-nav category link. JS-only defect fix;
tag_filter.js is ?v={{ request.git_hash }} cache-busted.
This commit is contained in:
russell@unturf.com 2026-05-16 11:02:30 -04:00
parent 98939fbc80
commit bcd8c2471b
No known key found for this signature in database

View file

@ -25,11 +25,17 @@
return;
}
// If chips link to /tag/<slug> (tag detail page), keep full navigation —
// the server already filters; in-place filter would be wrong context.
const firstChip = chips[0];
const href = firstChip.getAttribute("href") || "";
if (href.indexOf("/tag/") !== -1) {
// If the category chips link to /tag/<slug> (the tag-detail SERP),
// keep full navigation so a chip behaves EXACTLY like the matching
// left-nav category link — the server renders that page in the
// shop's configured home_layout, instead of an in-place "default
// cards" hide/show. NOTE: chips[0] is the "All" chip, which points
// at the shop home (no /tag/), so deciding from chips[0] alone
// wrongly kept the in-place filter — scan ALL chips.
const navigatesToSerp = Array.prototype.some.call(chips, function (c) {
return (c.getAttribute("href") || "").indexOf("/tag/") !== -1;
});
if (navigatesToSerp) {
return;
}