From adf145a7e8ef6079b6762ed63eb118f32505e9ec Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Fri, 15 May 2026 13:16:14 -0400 Subject: [PATCH] fix: tag chip "All" navigates fully from a filtered URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the page loads at ?tag=, the server has rendered a SUBSET of products (the tag-filtered grid). The DOM only contains that subset, so clicking "All" via the in-place filter just unhides what's already visible — it can't synthesize the rest of the shop, and on the lanes home_layout it can't rebuild the lane sections at all. tag_filter.js now bails on init when the URL carries a ?tag= param. Chips on filtered pages do normal navigation, so clicking "All" hits the server and gets back the correct unfiltered home (flat grid for home_layout 0/1, sectioned lanes for home_layout 2). The fast in-place path still works on the unfiltered home, which is when it's correct anyway (full set of products is in the DOM). --- make_post_sell/static/js/tag_filter.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/make_post_sell/static/js/tag_filter.js b/make_post_sell/static/js/tag_filter.js index d2d5c55..4d5a657 100644 --- a/make_post_sell/static/js/tag_filter.js +++ b/make_post_sell/static/js/tag_filter.js @@ -33,6 +33,18 @@ return; } + // When the page was loaded with ?tag=, the server rendered a + // SUBSET of products (filtered to that tag). The DOM here doesn't + // contain the rest of the shop, so clicking "All" — or another tag — + // via in-place filter would only ever toggle what's already visible. + // Worse, on the lanes layout (home_layout=2), the unfiltered home is + // a different markup entirely (lanes, not flat grid) — only a full + // navigation can rebuild it. Bail and let chips navigate normally. + const initialParams = new URLSearchParams(window.location.search); + if (initialParams.get("tag")) { + return; + } + const items = grid.querySelectorAll(".serp-item"); function applyFilter(slug) {