diff --git a/CLAUDE.md b/CLAUDE.md index 52db8d2..b7b7687 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -498,6 +498,15 @@ and `details()` (mobile/tablet `
` accordion). Both call the same internal `facet_form()` so the controls stay identical across viewports — only the wrapper differs. +Macros take TWO base URLs: `base_url` (slugged shop home, for the +"All" link) and `tag_base` (`request.shop.absolute_url(request, +slug=False)` = `/s/{id}`, no shop slug). Category links MUST use +`{tag_base}/tag/{slug}` so they match the `shop_tag_detail` route +(`/s/{shop_id}/tag/{slug}`). Using the slugged URL produces +`/s/{id}/{shop_slug}/tag/{slug}` which falls through to the +`shop_slug` catch-all and silently renders the shop home instead of +the filtered tag page (the 2.6b→2.6c defect). + Every page that opts into categorization (operator picks `home_layout >= 1`, or tag detail page) includes BOTH variants in the markup. CSS hides one per viewport: `details.facet-details` hidden ≥800px, `aside diff --git a/docs/tickets/mps-24.md b/docs/tickets/mps-24.md index de078a4..4ce8042 100644 --- a/docs/tickets/mps-24.md +++ b/docs/tickets/mps-24.md @@ -319,6 +319,26 @@ picker is Phase 2). | `tests/test_models.py` | `TestTagSuggestPureFunctions` — 11 unit tests over tokenize / stem / cluster | | `tests/test_functional.py` | `test_suggest_clusters_renders_candidates`, `test_apply_suggestion_creates_tag_and_attaches_products`, `test_dismiss_suggestion_adds_to_stopwords`, `test_apply_suggestion_rejects_empty_input` | +### Phase 2.6c — fix sidebar category links falling through to shop-home catch-all (shipped 2026-05-15) + +Defect from 2.6b operator review: clicking any category in the desktop +sidebar navigated to a page that "looked exactly like home" (screenshots +in chat). Root cause: the facet macro built category links as +`{absolute_url}/tag/{slug}` where `absolute_url` includes the shop slug +(`/s/{id}/{shop_slug}`). The resulting path `/s/{id}/{shop_slug}/tag/{slug}` +does **not** match the tag detail route `/s/{shop_id}/tag/{slug}` — it +falls through to the `shop_slug` catch-all (`/s/{shop_id}/{slug:.*}`) +and renders the shop home / lanes, ignoring the tag entirely. + +Fix: `_facet_nav.j2` macros take a new `tag_base` arg = +`request.shop.absolute_url(request, slug=False)` (= `/s/{id}`, no shop +slug). Category links now build `{tag_base}/tag/{slug}` which matches +`shop_tag_detail` exactly. The "All" link still uses the slugged +`base_url` (shop home). All three call sites (shop_tag.j2, home.j2, +shop.j2) updated. Regression test: +`test_facet_category_link_renders_tag_detail_not_home` + +hardened assertions in `test_tag_detail_renders_facet_sidebar`. + ### Phase 2.6b — facet nav on shop home (layout 2) + mobile SERP rows under each lane (shipped 2026-05-15) Follow-up to 2.6 after operator review on tablet: layout 2 (sectioned diff --git a/make_post_sell/templates/_facet_nav.j2 b/make_post_sell/templates/_facet_nav.j2 index 72a884d..36c2ae0 100644 --- a/make_post_sell/templates/_facet_nav.j2 +++ b/make_post_sell/templates/_facet_nav.j2 @@ -11,7 +11,12 @@ Args: variant — "sidebar" (desktop