feat: five distinct widgets per category - #83
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.tsroutes 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 theWW-001…WW-025range 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 --noEmitclean?cat=mega→ 5 (Block, Rotary, Valve, Hub, Turbine)?cat=mini→ 5?cat=kit→ 5Generated by Claude Code