← All 34 tasks · Navigation · Shop filters
NAV-4Chat ASophieDeploy laneP1done

In-shop subcategory filters (every category)

Element: FilterSidebar 'Product Categories' group
Source: Sophie Nagano · Jun 11, 4:08 PMTarget build: v234 (shipped)Depends on: NAV-1 · NAV-2

● Current state — verified on live v230

LIVE /v230/shop sidebar = flat 'Product Categories' (All Products, Flower, Pre-Rolls…). No subcategories; selecting a category does not reveal sub-filters.

◎ Target outcome

Clicking a category (e.g. Flower) expands its subcategories as selectable filter rows; selections AND with the category. Set up for every category.

✓ Output — closed & verified

CLOSED & VERIFIED. Shipped v233 → v234. Selecting a category reveals a facet-driven Subcategory filter section; the dropdown sub-link now actually filters — Whole Flower → 8 products (was 0 before the enum-normalize fix). Chrome-verified on /v234/shop.

Assets, colours & references

Reference: Sophie's in-shop subcategory filter mockup (in her Jun 11 email) + the mapping sheet.

Technical steps to achieve it

  1. computeFacets: build subcategory facet counts within the active category from website_subcategory.
  2. FilterSidebar: render an expandable subcategory group under the selected category (FilterRow reused).
  3. Add ?sub= to the shop query state; ShopPage filters on website_subcategory.
  4. Read ?cat=&sub= from NAV-3 deep links on load.

Files to change

src/components/shop/FilterSidebar.jsxsrc/utils/computeFacets.jssrc/pages/ShopPage.jsx

Testing

  1. Unit: facet counts per subcategory match filtered results (shared predicate).
  2. Canary: pick Flower → subcats appear → pick Pre-Milled → grid narrows; count == grid.

Milestones

Spec'd from feedback
Source located
Code change
Local test (vitest + vite preview)
Canary verify + ship v234 (shipped)

Verify live

Progress URL updates here when this task ships to its target /vN/. Current column always points at the live baseline.

← NAV-3indexHOME-1 →