Skip to content

43 prep ahead#80

Open
m-lyon wants to merge 13 commits intomainfrom
43-prep-ahead
Open

43 prep ahead#80
m-lyon wants to merge 13 commits intomainfrom
43-prep-ahead

Conversation

@m-lyon
Copy link
Copy Markdown
Owner

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

No description provided.

m-lyon added 13 commits March 29, 2026 21:23
Add prepAhead (boolean) and prepAheadLabel (string) fields to Recipe
schema and interface. Update ReservedRecipeTags to include PrepAhead.
Update pre-save hook to add prep_ahead tag when recipe.prepAhead is
true or when any ingredient recipe has prepAhead set. Deduplicate
calculatedTags with Set.
Adds prepAhead: false to all existing recipe documents that lack the
field. Run with mongosh against the target database.
Add prepAhead, prepAheadLabel, togglePrepAhead, setPrepAheadLabel to
AsIngredientSlice. Reset prep ahead state when isIngredient is toggled
off, when prepAhead is toggled off, and in resetAsIngredient.
Add prepAhead and prepAheadLabel to RecipeIngrFields fragment and to
the inline ... on Recipe fragment in RecipeFieldsFull. This exposes
prep ahead data to ingredient dropdowns, recipe cards, and recipe
ingredient display components.
Replace Chakra UI with Mantine components. Add side-by-side layout with
vertical divider on desktop, horizontal on mobile. Add prep ahead
checkbox (disabled when isIngredient is off) and optional prep ahead
label input with Collapse animation. Guard label collapse on both
prepAhead and isIngredient state.
Add prepAhead and prepAheadLabel to the SubmitButton store selector
and mutation payload. Clear prepAheadLabel when prepAhead is false.
Add TbClock icon from react-icons/tb that displays next to recipe
ingredients where prepAhead is true. Icon is wrapped in a Mantine
Tooltip showing either the custom prepAheadLabel or 'ahead of time'
as default text. Icon placed after ingredient text, before the
existing chevron.
Show TbClock icon with Mantine Tooltip next to the heading for
recipes that are both ingredients and marked as prep ahead. Tooltip
displays the custom prepAheadLabel or defaults to 'ahead of time'.
Update TagLabel to render tag.replace(/_/g, ' ') so that
calculated tags like 'prep_ahead' display as 'prep ahead'.
Existing single-word tags (vegan, vegetarian, ingredient)
are unaffected.
Add prepAhead: false, prepAheadLabel: null to mockRecipeOne and
mockRecipeNew base objects. Create mockRecipePrepAhead variant with
prepAhead: true, prepAheadLabel: '1 day'. Add mockRecipeIdSix to ids.
Add mockUpdateRecipeAddPrepAhead and mockUpdateRecipeRemovePrepAhead
mutation mocks. Update getMockRecipeVariables to include prepAhead
and prepAheadLabel fields.
Create index.prepahead.test.tsx with 3 test cases:
- Enable prep ahead on a recipe (toggle isIngredient, toggle prepAhead, enter label, save)
- Disable prep ahead on an existing prep-ahead recipe
- Verify prepAhead resets when isIngredient is toggled off

Update mockGetRecipes to include mockRecipePrepAhead in recipe list.
Fix mockUpdateRecipeRemovePrepAhead to use recipePrepAheadVars
(based on mockRecipePrepAhead) instead of recipeOneVars.
Add 5 backend tests: prepAhead=true produces prep_ahead calculatedTag,
prepAhead=false does not, prep_ahead propagates from recipe ingredients,
does not propagate from non-prepAhead ingredients, and Tag model rejects
reserved 'prep_ahead' value. Also add prepAhead: false to existing test
records that were missing the now-required field.
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