Skip to content

feat: five distinct widgets per category - #83

Merged
bgard68 merged 2 commits into
mainfrom
claude/widget-catalog-25
Aug 25, 2026
Merged

feat: five distinct widgets per category#83
bgard68 merged 2 commits into
mainfrom
claude/widget-catalog-25

Conversation

@bgard68

@bgard68 bgard68 commented Aug 25, 2026

Copy link
Copy Markdown
Owner

What changed

The demo catalog held one product per category, so "Standard" the department and "Standard Widget" the product were the same single thing — the category tiles led to a shelf of one, and clicking Mega couldn't pull Mega widgets because only one existed.

The seeder now creates 25 widgets — five per department. Within a department the five differ by form factor, not by size:

Type Form
Block the classic housing
Rotary dial face and pointer
Valve inline body, handwheel, ports
Hub four-port junction
Turbine impeller in a housing

Kits, being containers rather than machines, vary by case instead: Pro, Starter, Builder, Travel, Master.

Each product carries its department in its name, so the existing keyword refinement in lib/catalog.ts routes it with no new endpoints and no filter changes.

Twenty-five illustrations follow — one per SKU, drawn from the same parametric machine in each department's finish, so a shelf reads as one product line. productImage() now matches the WW-001WW-025 range rather than a set literal, so a SKU outside it still falls back to the generic widget instead of a missing file.

Validation

  • tsc -b --noEmit clean
  • 243 frontend tests pass
  • Coverage: 100% lines, 100% functions, 98.4% branches — above the CI floors
  • Category routing verified against the running SPA, not assumed:
    • all departments → 25 products
    • ?cat=mega → 5 (Block, Rotary, Valve, Hub, Turbine)
    • ?cat=mini → 5
    • ?cat=kit → 5

Generated by Claude Code

claude added 2 commits August 25, 2026 19:04
The catalog held one product per category, so 'Standard' the department and
'Standard Widget' the product were the same single thing and the category
tiles led to a shelf of one. Clicking Mega could not pull Mega widgets
because only one existed.

The demo catalog now seeds 25 widgets - five per department. Within a
department the five differ by form factor rather than by size: Block
(the classic housing), Rotary (dial and pointer), Valve (inline, handwheel,
ports), Hub (four ports) and Turbine (impeller in a housing). Kits, being
containers, vary by case instead: pro, starter, builder, travel and master.
Each carries its department in its name, so the existing keyword refinement
in lib/catalog.ts routes it without new endpoints - Mega now returns exactly
its five, Mini its five, Kits its five.

Twenty-five illustrations follow, one per SKU, drawn from the same parametric
machine in each department's finish so the shelf reads as one product line.
productImage() matches the WW-001..WW-025 range rather than a set literal,
so a new SKU outside it still falls back to the generic widget rather than
a missing file.

243 frontend tests pass; coverage 100% lines and functions, 98.4% branches.
Category routing verified against the running SPA: 25 across all
departments, 5 under each of mega, mini and kit.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EA4mmpcb1rcvNntHR1iG6j
Seeding_stocks_the_demo_catalog_and_repeats_safely pinned WW-001 to
"Standard Widget", which is now "Standard Widget Block", and counted rows
matching "Standard Widget" to prove a second seed adds no duplicates.

Both assertions move to the whole product name. The count one has to: the
repository filters on name ilike '%search%', so with five widgets per
department "Standard Widget" matches all five and the check would pass for
the wrong reason. "Standard Widget Block" is unique to WW-001, so the test
keeps meaning exactly what it meant - one row per SKU after a repeat run.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EA4mmpcb1rcvNntHR1iG6j
@bgard68
bgard68 merged commit bd30448 into main Aug 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants