Skip to content

Conversation

@marcuscastelo
Copy link
Owner

Remove UI restrictions preventing the editing of complex recipes and ensure that editing functions work correctly for these cases. Update error handling for recipe fetching and add tests to verify functionality.

Closes #616

Copilot AI review requested due to automatic review settings June 9, 2025 06:20
@marcuscastelo marcuscastelo self-assigned this Jun 9, 2025
@vercel
Copy link

vercel bot commented Jun 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marucs-diet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 9, 2025 6:24am

This comment was marked as outdated.

refactor(GroupHeaderActions-ui): make PasteButton disabled prop optional
@marcuscastelo marcuscastelo requested a review from Copilot June 9, 2025 06:24
@marcuscastelo marcuscastelo merged commit 7af5208 into rc/v0.11.0 Jun 9, 2025
5 checks passed
@marcuscastelo marcuscastelo deleted the marcuscastelo/issue616 branch June 9, 2025 06:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Enable editing of complex recipes by removing UI restrictions, updating error handling for recipe fetching, and adding domain tests.

  • Remove conditional blocks that prevented editing or pasting into complex recipes
  • Update PasteButton signature to accept an optional disabled prop
  • Add tests for addItemToRecipe and addItemsToRecipe on recipes with prepared_multiplier !== 1
  • Enhance useRecipeResource to call handleApiError on fetch failures

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/sections/item-group/components/ItemGroupEditModalBody.tsx Removed UI guard blocking edits on complex recipes
src/sections/item-group/components/GroupHeaderActions.tsx Dropped complexity checks and updated PasteButton props
src/modules/diet/recipe/domain/recipeOperations.test.ts Added tests for adding items to complex recipes
src/modules/diet/item-group/application/useRecipeResource.ts Added handleApiError in catch block when fetching recipes
Comments suppressed due to low confidence (1)

src/modules/diet/item-group/application/useRecipeResource.ts:17

  • Add a unit test to cover the error path in useRecipeResource, asserting that when fetchRecipeById rejects, handleApiError is called and the resource resolves to null.
    } catch (error) {

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.

Support editing complex recipes

2 participants