# Catalog Listing Handoff

Date: 2026-04-03

## Scope

This handoff covers the `kaindl_catalog` listing/product import work completed across the recent catalog parity session.

Primary areas touched:

- `web/modules/custom/kaindl_catalog/`
- `scripts/catalog/build_catalog_seeds.py`
- generated seed files in `web/modules/custom/kaindl_catalog/data/`

## Core Decisions

1. Product import uses one card per product node.
   Live `kaindl.com` sometimes duplicates cards on listing pages. Dev intentionally does not.

2. English site language is `en-gb`.
   Importers and aliases must not hardcode `en`.

3. Catalog imports are explicit Drush operations.
   Install/update hooks should keep schema/model setup only, not mock content seeding.

4. Root catalog pages use direct membership, not blanket descendant expansion.
   This currently applies to:
   - `/en/boards/`
   - `/en/floors/`
   - `/en/boards/worktops/`

5. Empty filters should not render.
   A facet now needs actual options present in the current listing payload, otherwise it is removed before rendering.

6. Frontend asset edits must bump the owning library version.
   If CSS or JS changes in a custom module or theme, increment the related `version` in that module/theme `*.libraries.yml` file so browsers do not keep stale assets after deploys.

## Current Good State

### Import / Data Model

- `product_listing` and `product` imports are stable.
- Source-key upsert logic is in place.
- Aliases are created without the language prefix; Drupal adds `/en/...` correctly.
- Multivalue support is in place for:
  - `field_product_style_world`
  - `field_product_joining_picture`
  - `field_product_grading`

### Root Listing Pages

- `/en/boards/` root rail is correct.
- `/en/floors/` root rail is correct.
- `/en/doors/` exists as a real listing page.
- `/en/boards/wood-veneers/` rail and child indication are correct.

### Grouping

- Boards root groups correctly by board family.
- Floors root uses `format_group` instead of `style_world`.
- `/en/boards/worktops/` now groups by worktops-specific families:
  - `WORKtops`
  - `WORKtops - Antifingerprint`
  - `WORKtops - SLIMLINE`

### Filters

- Root `Boards` and `Floors` have the expected main filter groups.
- Decor grouping/order is aligned much more closely with live:
  - boards: `Wood`, `Uni`, `Concrete`, `Stone`, `Metal`, `Organic`, `Fabric`
  - floors: `Wood`, `Stone`, `Concrete`
- Empty facets are suppressed.

## Important Worktops Notes

`/en/boards/worktops/` is not a pure raw-taxonomy page on live.

Important observations:

- Live worktops visibly mixes products whose global family may still be `WOODline`, `ARTline`, etc.
- Live also duplicates some cards, which dev intentionally does not.
- The dev target for worktops is:
  - unique products only
  - worktops-specific grouping
  - worktops-specific style-world filter subset

Current intended root worktops unique set is `63` products.

Known anti-fingerprint-only products intentionally excluded from root worktops:

- `Agate Grey`
- `Black`
- `Crystal White`
- `Verde`

Special keep rule:

- `Marble Vicosa Escuro OM` remains on root worktops even though it is `WORKtops - Antifingerprint`, because live visibly includes it and its product-line flags include ABS worktop membership.

## Work Completed In This Session

### Import / Generator

- Expanded listing discovery to include menu-driven catalog pages and `/en/doors/`.
- Added real `/en/doors/` listing generation and door-product scoping.
- Extended imports to include live-only products when Excel coverage was missing.
- Added richer live filter extraction from listing card/filter metadata.
- Added floor `format_group` derivation and floor-specific grouping.
- Added multivalue import handling for `style_world`, `joining_picture`, and `grading`.
- Added worktops-specific scope rules in the seed builder.

### Drupal Output

- Fixed rails for root pages and subpages.
- Added child-link indication in the left rail.
- Switched root boards/floors/worktops query behavior away from descendant-overexpansion where needed.
- Limited worktops `Style world` grouping to worktops presentation families.
- Limited worktops `Style world` filter values to:
  - `WORKtops`
  - `WORKtops - Antifingerprint`
  - `WORKtops - SLIMLINE`
- Hid empty facets globally by requiring actual present values.

## Files Most Likely To Matter Next Session

- `scripts/catalog/build_catalog_seeds.py`
- `web/modules/custom/kaindl_catalog/kaindl_catalog.module`
- `web/modules/custom/kaindl_catalog/src/CatalogImportManager.php`
- `web/modules/custom/kaindl_catalog/js/kaindl-catalog-listing.js`
- `web/modules/custom/kaindl_catalog/css/kaindl-catalog-listing.css`
- `web/modules/custom/kaindl_catalog/data/catalog-listings.en.json`
- `web/modules/custom/kaindl_catalog/data/catalog-products.en.json`

## Server Commands Used Repeatedly

Only run on the server, not locally.

Typical cache-only pass:

```bash
vendor/bin/drush cr
```

Typical listings refresh:

```bash
vendor/bin/drush kaindl-catalog:import-listings
vendor/bin/drush cr
```

Typical products refresh:

```bash
vendor/bin/drush kaindl-catalog:import-products
vendor/bin/drush cr
```

Schema update when field storage/widget changes were introduced:

```bash
vendor/bin/drush updb -y
vendor/bin/drush cr
```

## Recommended Next Steps

1. Minor subpage parity QA only.
   Focus on a few important listing pages instead of broad refactors.

Suggested pages:

- `/en/boards/worktops/`
- `/en/doors/`
- `/en/boards/wood-veneers/`
- `/en/floors/laminate/`
- one `AQUA PRO` floor listing

2. Spot-check:

- left rail contents
- visible filter groups
- filter value counts
- group headings/order
- whether any empty facet still leaks through

3. If catalog listings are accepted, move to the next phase:

- non-product page seeding
- menu-target page completion
- page/header/body import work

## Known Constraint

Some live page behaviors are presentation-curated and not purely derivable from global taxonomy. `worktops` is the main example. When parity and raw taxonomy disagree, use the page presentation model rather than the raw multivalue family tags.
