Category Page Update Summary
Summary of the category page redesign and brands SEO improvements shipped in the category-page-update feature branch.
Feature Branch: feature/category-page-update — Summary
Branch: https://github.com/CT-CROP/CROP-front/tree/feature/category-page-update Commits:
3a2cbf11— feat: category page update and brands SEOd18d6922— refactor: update styling for cart summary and safety bannersAnalysis date: 2026-02-22 Diff: 407 files, +11 275 / -9 776 lines
1. Main Change: /catalog -> /parts
The entire app/catalog/ directory has been renamed to app/parts/.
All links, imports, and routes have been updated.
Redirects (301, middleware.ts)
| Old URL | New URL | Type |
|---|---|---|
/catalog | /parts | 301 |
/catalog/[id] | /parts/[id] | 301 |
/hydraulics (root-level category) | /parts/hydraulics | 301 |
?manufacturer=xxx | ?brand=xxx | 301 |
?brand=VNT (vendor code) | ?brand=ventrac (slug) | 301 |
2. New URL Structure
2.1 Parts (parts catalog)
/parts — All parts (catalog main page)
/parts/[slug] — Category OR specific part (SKU)
/parts/[slug]/[subcategory] — Subcategory
/parts/[slug]/[subcategory]/[brand] — Subcategory + brandHow /parts/[slug] distinguishes category from SKU:
- Checks
CATEGORY_SLUG_SET.has(slug)(O(1) lookup) - If slug is in the category set (
hydraulics,electrical, ...) — renders category page - Otherwise — tries to find a part by slug/SKU
- If neither found — 404
2.2 Brands (SEO pages) — NEW
/brands — Grid of all brands
/brands/[brand] — All parts for a brand
/brands/[brand]/[category] — Brand + category
/brands/[brand]/[category]/[subcategory] — Brand + category + subcategory2.3 Inventory (equipment)
/inventory — Used equipment catalog
/inventory/[category] — Equipment category OR equipment detail/inventory/[category] — dual-purpose: if slug matches a known category (tractors, mowers, ...) — category page. Otherwise — tries to load as equipment detail.
3. Taxonomy: Categories, Subcategories, Brands
3.1 Parts Categories
Defined in lib/catalog-taxonomy.ts
| Name | Slug | API categoryName | Sort |
|---|---|---|---|
| Hydraulics | hydraulics | HYDRAULICS | 1 |
| Electrical | electrical | ELECTRICAL | 2 |
| Engine | engine | ENGINE | 3 |
| Filters | filters | FILTERS | 4 |
| Drivetrain | drivetrain | DRIVETRAIN | 5 |
3.2 Subcategories
| Category | Subcategories (slug) | categoryPath (API) |
|---|---|---|
| Hydraulics | pumps, valves, cylinders, hoses, fittings, motors, filters, accumulators | HYDRAULICS > PUMPS, ... |
| Electrical | batteries, switches | ELECTRICAL > BATTERIES, ... |
| Engine | filters, belts | ENGINE > FILTERS, ... |
| Filters | air-filters, oil-filters | FILTERS > AIR FILTERS, ... |
| Drivetrain | transmissions | DRIVETRAIN > TRANSMISSIONS |
3.3 Brands
| Name | Slug | Vendor Code | Sort |
|---|---|---|---|
| New Holland | new-holland | NHL | 1 |
| McHale | mchale | MCH | 2 |
| Ventrac | ventrac | VNT | 3 |
| Club Car | club-car | CLC | 4 |
| Briggs & Stratton | briggs-stratton | BNS | 5 |
3.4 Equipment Categories (Inventory)
Defined in lib/inventory-categories.ts
| Slug | Name |
|---|---|
tractors | Tractors |
mowers | Mowers |
loaders | Loaders |
skid-steers | Skid Steers |
combines | Combines |
hay | Hay |
tillage | Tillage |
sprayers | Sprayers |
planters | Planters |
attachments | Attachments |
4. Query Parameters
4.1 Parts Catalog (/parts/*)
Defined in lib/catalog/catalog-search-params.ts (nuqs)
| URL param | Description | Default |
|---|---|---|
q | Search query (formerly search) | "" |
brand | Brand slug (formerly manufacturer) | "" |
categoryId | Category slug | "" |
categoryPath | Path CATEGORY > SUBCATEGORY for API | "" |
page | Page number | 1 |
sortBy | relevance / price_asc / price_desc | "relevance" |
priceBucket | priced / contact | "" |
priceMin / priceMax | Price range | — |
inStock | In stock | false |
hasImage | Has image | false |
has360 | Has 360 photo | false |
mode | auto / parts / equipment | "parts" |
availability | in_stock / out_of_stock | "" |
status | active / discontinued / superseded | "" |
equipmentFitment | Equipment fitment | "" |
equipmentModelKey | Equipment model | "" |
Important: manufacturer -> brand and search -> q — URL-level renames (nuqs urlKeys).
4.2 Inventory (/inventory/*)
Defined in lib/catalog/inventory-search-params.ts
| URL param | Description | Default |
|---|---|---|
category | Equipment category slug | "" |
brand | Manufacturer slug (formerly manufacturer) | "" |
year | Year | "" |
condition | Condition | "" |
search | Search | "" |
sortBy | price_asc / price_desc / year_desc | — |
hasPrice | Price available only | false |
hasImage | Image filter | "all" |
page | Page | 1 |
5. Middleware (middleware.ts)
Processing order:
- Redirect
?manufacturer=->?brand=(301) - Redirect
?brand=vendorCode->?brand=slug(301, e.g.vnt->ventrac) - Redirect
/catalog->/parts(301) - Redirect
/catalog/[id]->/parts/[id](301) - Redirect
/[categorySlug]->/parts/[categorySlug](301, for root-level categories) - Redirect non-www -> www (308, for clintontractor.net)
- Auth enforcement for protected routes (
/account,/admin,/rnd) - ISR cache for
/parts/*,/inventory/*,/brands/*
Caching:
Cache-Control: public, s-maxage=60, stale-while-revalidate=300/parts/*,/inventory/*,/brands/*— cached (60s TTL)/cart/*,/checkout/*,/account/*— NOT cached
6. Navigation: Multiple Paths to the Same Content
The same set of parts can be found via different paths:
Category-first: /parts/hydraulics
With brand filter: /parts/hydraulics?brand=new-holland
Subcategory: /parts/hydraulics/pumps
Subcategory+brand: /parts/hydraulics/pumps/new-holland
Brand-first: /brands/new-holland
Brand+category: /brands/new-holland/hydraulics
Brand+subcategory: /brands/new-holland/hydraulics/pumps7. Data Fetching
fetchCatalogByTaxonomy() — lib/catalog/fetch-catalog-by-taxonomy.ts
Unified function for loading data on all category/brand pages.
Input:
{
category?: string; // "HYDRAULICS" (API categoryName)
categoryPath?: string; // "HYDRAULICS > PUMPS" (exact path for API)
categorySlug?: string; // "hydraulics" (for initialFilters)
manufacturer?: string; // "new-holland" (slug, resolved to vendorCode)
}Output:
{
parts: UnifiedCatalogPart[];
total: number;
currentPage: number;
totalPages: number;
hasNextPage: boolean;
manufacturers: ManufacturerFacetSummary[];
facets: SearchFacets | null;
equipmentFacet: EquipmentFacet | null;
initialFilters: CatalogFilters;
}Pagination: 20 items per page
8. Breadcrumbs
| Page | Breadcrumbs |
|---|---|
/parts | Home > Parts |
/parts/hydraulics | Home > Parts > Hydraulics |
/parts/hydraulics/pumps | Home > Parts > Hydraulics > Pumps |
/parts/hydraulics/pumps/new-holland | Home > Parts > Hydraulics > Pumps > New Holland |
/brands/new-holland | Home > Parts > Brands > New Holland |
/brands/new-holland/hydraulics | Home > Parts > Brands > New Holland > Hydraulics |
/brands/new-holland/hydraulics/pumps | Home > Parts > Brands > New Holland > Hydraulics > Pumps |
/inventory/tractors | Home > Inventory > Tractors |
9. New Components
| Component | File | Purpose |
|---|---|---|
CategoryHybridHero | components/catalog/category-hybrid-hero.tsx | Universal hero block for categories/brands/subcategories. Supports breadcrumbs, watermark image, background, subcategory carousel |
SubcategoryNav | components/catalog/subcategory-nav.tsx | Subcategory carousel (3 cols mobile, 4 tablet, 6 desktop) |
TaxonomyBreadcrumbs | components/catalog/taxonomy-breadcrumbs.tsx | Breadcrumb rendering (shadcn Breadcrumb) |
CatalogBottomCta | components/catalog/catalog-bottom-cta.tsx | CTA block below catalog results |
SurfaceCard | components/ui/surface-card.tsx | Universal card component |
SVG illustrations for equipment categories:
public/images/category/combines.svg
public/images/category/loaders.svg
public/images/category/mowers.svg
public/images/category/skid-steers.svg
public/images/category/tractors.svg10. File Structure (new/moved files)
app/
├── parts/ # RENAMED from catalog/
│ ├── page.tsx # /parts — catalog main page
│ ├── loading.tsx
│ ├── error.tsx
│ ├── not-found.tsx
│ ├── [slug]/
│ │ └── page.tsx # /parts/[slug] — category OR part detail
│ │ └── [subcategory]/
│ │ └── page.tsx # /parts/[slug]/[subcategory]
│ │ └── [brand]/
│ │ └── page.tsx # /parts/[slug]/[subcategory]/[brand]
│ ├── [id]/ # Part detail page (moved from catalog/)
│ │ ├── page.tsx # (resolved from [slug] page via redirect)
│ │ ├── _components/
│ │ ├── _view-model/
│ │ └── ...
│ └── _components/
│ └── parts-catalog-client.tsx
│
├── brands/ # NEW
│ ├── page.tsx # /brands
│ └── [brand]/
│ ├── page.tsx # /brands/[brand]
│ └── [category]/
│ ├── page.tsx # /brands/[brand]/[category]
│ └── [subcategory]/
│ └── page.tsx # /brands/[brand]/[category]/[subcategory]
│
├── inventory/
│ ├── (catalog)/
│ │ └── page.tsx # /inventory
│ └── [category]/ # NEW
│ ├── page.tsx # /inventory/[category]
│ └── not-found.tsx
│
lib/
├── catalog-taxonomy.ts # NEW — category/subcategory/brand definitions
├── inventory-categories.ts # NEW — equipment category definitions
├── catalog/
│ ├── fetch-catalog-by-taxonomy.ts # NEW — unified data fetch
│ ├── catalog-search-params.ts # updated (manufacturer -> brand)
│ └── inventory-search-params.ts # updated (manufacturer -> brand)
│
components/
└── catalog/
├── category-hybrid-hero.tsx # NEW
├── subcategory-nav.tsx # NEW
├── taxonomy-breadcrumbs.tsx # NEW
├── taxonomy-hero.tsx # NEW
└── catalog-bottom-cta.tsx # NEW11. SEO & Metadata
Each page generates generateMetadata() with:
title— SEO title from taxonomydescription— meta description from taxonomyopenGraph— OG title, description, imagesalternates.canonical— canonical URL
Examples:
/parts/hydraulics->"Hydraulics Parts | Pumps, Valves, Cylinders | CROP Prime"/brands/new-holland->"New Holland Parts | OEM Tractors & Equipment | CROP Prime"/inventory/tractors-> fromgetInventoryCategoryBySlug("tractors").seoTitle
Static Generation:
// app/parts/[slug]/page.tsx
export function generateStaticParams() {
return CATEGORY_SLUGS.map((slug) => ({ slug }));
}5 categories are statically generated. Other pages use ISR (revalidate: 300s).
12. Development Guide
Adding a new category:
- Add object to
MOCK_CATEGORIESinlib/catalog-taxonomy.ts - Add slug to the
CATEGORY_SLUGSarray - Add subcategories to
MOCK_SUBCATEGORIES - Optionally: add SVG to
public/images/category/
Adding a new brand:
- Add object to
MOCK_BRANDSinlib/catalog-taxonomy.ts - Ensure
vendorCodematches the API
Adding an equipment category:
- Add slug to
INVENTORY_CATEGORY_SLUGSinlib/inventory-categories.ts - Add metadata to
MOCK_INVENTORY_CATEGORIES
Catalog links:
// Correct (new format):
href="/parts"
href="/parts/hydraulics"
href="/parts/hydraulics/pumps"
href={`/parts/${partSku}`}
href="/brands/new-holland"
href="/inventory/tractors"
// Incorrect (old format, will redirect):
href="/catalog" // 301 -> /parts
href="/catalog/ABC123" // 301 -> /parts/ABC123
href="/hydraulics" // 301 -> /parts/hydraulicsQuery params:
// Correct (new names):
?brand=new-holland
?q=pump
// Incorrect (will redirect):
?manufacturer=NHL // 301 -> ?brand=new-holland13. Removed Files / Deprecated Code
app/catalog/— fully removed (moved toapp/parts/)app/api/commerce/[...path]/route.ts— removedservices/ai-chat/commerce-api.ts— removedservices/ai-chat/utils.ts— removedcomponents/ai-input/chat-commerce.tsx— removedcomponents/ai-input/image-lightbox.tsx— removedfeatures/catalog/card-image-carousel.tsx— removedfeatures/catalog/filters/filter-multiselect-group.tsx— removedfeatures/catalog/filters/filter-show-more-button.tsx— removedfeatures/catalog/filters/slice-with-selected.ts— removedfeatures/product-detail/service-unavailable.tsx— removedfeatures/product-detail/try-again-button.tsx— removedfeatures/command-menu/model/use-command-menu-chat.ts— removedlib/constants/cache.ts— removedlib/constants/pagination.ts— removedlib/utils/format-currency.ts— removedcloudbuild.yaml/cloudbuild-deploy.yaml— removedscripts/check-ci-health.sh— removedscripts/check-env-parity.ts— removedscripts/test-consultant-api.sh— removedscripts/toggle-cloud-build.sh— removedCLAUDE.md— removed (180 lines)
14. Other Changes (non-URL)
- Cart summary and safety banner styles — updated colors to semantic tokens
- AI chat — refactored, removed commerce-api, simplified client
- Voice overlay — simplified
- Search bar — refactored navigation and search hooks
- Equipment filters — added new filters, refactored
- Parts schematics — SVG viewer improvements, prediction API
- Delivery API — updated client
- Auth — updated sign-in/sign-up flow
- Product detail — updated purchase panel, price display, media gallery, more-info sheet
- CI/CD — updated GitHub Actions workflows, removed Cloud Build configs