Skip to content

feat: add 'Make it Vegan' button (#77)#85

Open
m-lyon wants to merge 3 commits intomainfrom
feature/77-make-it-vegan
Open

feat: add 'Make it Vegan' button (#77)#85
m-lyon wants to merge 3 commits intomainfrom
feature/77-make-it-vegan

Conversation

@m-lyon
Copy link
Copy Markdown
Owner

@m-lyon m-lyon commented Mar 31, 2026

Summary

  • Add veganVersion and originalRecipe fields to Recipe model with bidirectional linking and a recipeMakeVegan mutation that clones a recipe into an editable vegan copy (including image duplication)
  • Auto-tag original recipes with "vegan option available" via pre-save hook; add owner auth check and cleanup on delete
  • Add client-side UI: CreateVeganVersionCheckbox in the editing flow, vegan/original navigation links on ViewRecipe, leaf icon on recipe cards, and a Zustand store slice for managing the checkbox state

Test Plan

  • All 141 API tests pass
  • All 340 client tests pass
  • Client lints clean (npm run lint)
  • Client type-checks clean (npm run check-types)
  • API type-checks clean (tsc --noEmit)
  • API commits reviewed via roborev (jobs 65, 66)

m-lyon added 3 commits March 30, 2026 22:27
Add veganVersion and originalRecipe bidirectional fields to Recipe model,
VeganOptionAvailable calculated tag, recipeMakeVegan mutation that clones
a recipe with its images, and cascading cleanup in recipeRemoveById.

Closes #77
Add owner authorization check in recipeMakeVegan validation wrapper,
replace synchronous fs.copyFileSync with async fs.promises.copyFile,
and consolidate Recipe model imports.
…integration

- Add MAKE_VEGAN_RECIPE mutation and veganVersion/originalRecipe to query fragment
- Create createVeganVersionSlice for managing vegan version checkbox state
- Add CreateVeganVersionCheckbox component (Mantine) in editing flow
- Update EditableRecipe/EditableTitle with isVeganCopy read-only support
- Add make-vegan flow to EditRecipe page (fires after image upload)
- Show vegan/original navigation links on ViewRecipe page
- Add vegan version leaf icon button on recipe cards (ModifyButtons)
- Update mock recipe data with veganVersion/originalRecipe null fields
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.

1 participant