Open
Conversation
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.
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.
No description provided.