From 9f7ba8dc0859dd4ba784126b2c43f942e6f3c377 Mon Sep 17 00:00:00 2001 From: Zdenek Stursa <90236729+zdenek-stursa@users.noreply.github.com> Date: Fri, 17 Apr 2026 18:44:45 +0200 Subject: [PATCH] fix: preserve ingredient section titles when parsing recipe ingredients (#7483) Co-authored-by: Zdenek Co-authored-by: Claude Sonnet 4.6 --- .../RecipePageParts/RecipePageParseDialog.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/app/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageParseDialog.vue b/frontend/app/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageParseDialog.vue index 20d11c9c8..b5cf74dfa 100644 --- a/frontend/app/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageParseDialog.vue +++ b/frontend/app/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageParseDialog.vue @@ -371,14 +371,18 @@ async function parseIngredients() { } state.loading.parser = true; try { - const ingsAsString = props.ingredients - .filter(ing => !ing.referencedRecipe) - .map(ing => ingredientToParserString(ing)); + const filteredIngredients = props.ingredients.filter(ing => !ing.referencedRecipe); + const ingsAsString = filteredIngredients.map(ing => ingredientToParserString(ing)); const { data, error } = await api.recipes.parseIngredients(parser.value, ingsAsString); if (error || !data) { throw new Error("Failed to parse ingredients"); } - parsedIngs.value = data; + + // Restore section titles from original ingredients — the parser doesn't return them + data.forEach((parsed, index) => { + parsed.ingredient.title = filteredIngredients[index]?.title || ""; + }); + const parsed = data ?? []; const recipeRefs = props.ingredients.filter(ing => ing.referencedRecipe).map(ing => ({ input: ing.note || "",