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
- computeFacets: build subcategory facet counts within the active category from website_subcategory.
- FilterSidebar: render an expandable subcategory group under the selected category (FilterRow reused).
- Add ?sub= to the shop query state; ShopPage filters on website_subcategory.
- 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
- Unit: facet counts per subcategory match filtered results (shared predicate).
- 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.