Skip to content

feat: recipe scaling, cook from pantry, store-section shopping list - #16

Open
phil08533 wants to merge 2 commits into
mainfrom
feat/custom-recipes-save-load
Open

feat: recipe scaling, cook from pantry, store-section shopping list#16
phil08533 wants to merge 2 commits into
mainfrom
feat/custom-recipes-save-load

Conversation

@phil08533

Copy link
Copy Markdown
Owner

Summary

  • Recipe scaling — ingredient amounts now scale correctly to your household size. Each recipe stores defaultServings: 4 (TheMealDB) or recipe.serves (custom). The weekly shopping summary and the detail view preview both apply people / defaultServings per recipe instead of a fixed ÷2 guess.

  • Cook from Pantry — new "From Pantry" chip (chef hat icon) in the recipe search modal. Tapping it fetches recipes that feature your kitchen ingredients, pulls full details for the top 15 matches, and sorts them by pantry coverage. Each card shows a match badge (e.g. "9/12") — green ≥80%, amber ≥50%, gray below. The detail view also shows a "X/Y in pantry" pill.

  • Shopping list by store section — items are now grouped by logical grocery aisle (Produce → Meat & Seafood → Dairy & Eggs → Bakery → Frozen → Canned & Dry Goods → Oils/Sauces/Spices → Beverages → Other) instead of alphabetical category sort. Categorization is automatic based on ingredient name.

Test plan

  • Plan a meal for 2 people — weekly shopping summary shows half the amounts vs. a 4-person recipe
  • Open recipe detail — ingredients header shows "2 people, serves 4" and amounts are halved
  • Create a custom recipe with Serves = 2 — adding it for 4 people doubles the amounts
  • Open recipe search → tap "From Pantry" → see loading spinner then recipe cards with match badges
  • Cards sorted best-match first; green badge for pantry-heavy recipes
  • Tap a pantry-match card → detail shows "X/Y in pantry" pill
  • Add items to shopping list from meal planner — list groups by store section in aisle order
  • Manually add "Milk" → appears under Dairy & Eggs; "Chicken breast" → Meat & Seafood

https://claude.ai/code/session_015pnZpcPJegpdvYPTtz4ook


Generated by Claude Code

claude added 2 commits May 18, 2026 12:25
- Add useCustomRecipes hook with localStorage persistence (CRUD)
- Add CreateRecipeModal for creating and editing custom recipes
- Rewrite RecipeSearchModal with My Recipes tab (BookOpen), Saved tab,
  and Create button in header; detail view handles custom vs API recipes
- Wire useFavorites and useCustomRecipes into App for snapshot access
- Full-snapshot save/load (version 2 format: pantry + meals + favorites +
  customRecipes) replacing the old partial export
- File System Access API auto-save on Chrome/Edge; blob download fallback
  on Safari/other; auto-save toggle opens file picker and debounces writes

https://claude.ai/code/session_015pnZpcPJegpdvYPTtz4ook
Recipe scaling
- Store defaultServings (4 for TheMealDB, recipe.serves for custom)
  on each meal entry when added to the plan
- WeekIngredientsSummary scales per-recipe: people / meal.defaultServings
- Detail view preview also uses per-recipe defaultServings
- CreateRecipeModal adds a Serves field (default 4)

Cook from pantry
- New utils/pantryMatch.js: calcPantryMatch + getTopKitchenIngredients
- getMealsByIngredient added to mealdb.js
- "From Pantry" chip (ChefHat icon) in RecipeSearchModal fetches meals
  by kitchen ingredients, calculates match %, sorts best-match first
- Match badge (X/Y) on each card: green ≥80%, amber ≥50%, gray <50%
- pantry match pill shown in detail view header
- kitchen prop threaded RecipesPage → RecipeSearchModal

Shopping list by store section
- New utils/storeCategories.js with keyword lookup for 8 sections
- ShoppingPage groups by getStoreSection(item.name) in logical
  aisle order instead of alphabetical category sort

https://claude.ai/code/session_015pnZpcPJegpdvYPTtz4ook
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