A new Recipes page at /recipes lets a cook paste a recipe, enter the… #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "osf/71-172-comparison-arm-parallel-scale"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What was done
/recipeslets a cook paste a recipe, enter the servings and choose Metric or US, and see it back scaled and converted, with each line that did not read shown beside its line number.Serves Nand then one ingredient a line, each a quantity (a whole number, a decimal, a fraction or a mixed number), an optional unit and a name — with a line that does not read reported by its line number while the ones that do are still read./recipesempties it.How to review
npm test; ifDATABASE_URLis unset the repository starts its own embedded Postgres, and every suite should pass.npx playwright install chromium, then run the browser tests withnpm run test:e2e; the three/recipesscenarios — opening the page, a doubled US recipe with one unread line, and a two-recipe list — should pass.npm startand open http://localhost:3000/recipes; you should see one form with Metric chosen and "The shopping list is empty."Serves 2,200 g flour,a pinch of salt,2 eggs, set Servings to 4, choose US and press Show recipe; expect14 oz flourand4 eggswith a redLine 3: a pinch of salt (no quantity), and the form keeping what you entered.Serves 1,2 eggs, Servings 1); the shopping list should then read6 eggsand14 oz flour.src/server.ts(the/recipesroutes) andsrc/pages.ts(the page and its styles).Code review
Reviewed scale-recipes-and-shopping-list against its proposal, specs, design and tasks: the four modules (src/recipe.ts, scale.ts, convert.ts, shopping.ts), the /recipes page and routes, the seven new test files, and the README/CHANGELOG entries. I hand-traced the quantity forms, the quarter/third and weight display rules including the pinned boundaries, the conversion ladder with the spec's exact factors, the list's name normalisation and unit ordering, the hidden-field round trip, and the escape handling; everything matches the specs, the commit carries no generated, cached or scratch files, and no code change was needed. All checks pass: tsc clean, 78 unit tests (including the pre-existing server tests) green, openspec --strict valid, Playwright lists the three new browser tests, and the release-notes CI script exits 0.
It found nothing to fix.
Tests
All 47 scenarios of
scale-recipes-and-shopping-listhave a tagged test.The test lint found, in the run's tests on the last check:
Recorded, not decided
e2e/recipes.spec.ts:1B7: no relative import: this file asserts on things it constructed itself, which is the measured 'asserted on my own mock' failuretest/recipes-page.test.ts:1B7: nothing imported here looks like the module under test ('recipes-page')test/recipes-server.test.ts:1B7: nothing imported here looks like the module under test ('recipes-server')Braid run
scale-recipes-and-shopping-list(26 steps)ea3ec53184Opened by Braid.
ce08d5043cea3ec53184Scale a recipe, convert its units, and build a shopping listto A new Recipes page at/recipeslets a cook paste a recipe, enter the…ea3ec53184ccfc5b7a93