From dbfb5591c58f576b5128cf1ec113e1d135142fb1 Mon Sep 17 00:00:00 2001 From: Adriano Date: Fri, 20 Feb 2026 18:29:27 +0100 Subject: [PATCH] fix: separate recipe preview image from task images Recipe image_path is now used as preview thumbnail only. Removed auto-creation of "Technical Drawing" task from recipe upload, and removed recipe image strip from task_execute view. Each task displays its own file_path independently. Co-Authored-By: Claude Opus 4.6 --- client/blueprints/measure.py | 6 ------ client/templates/maker/recipe_editor.html | 8 ++++---- client/templates/maker/recipe_list.html | 4 ++-- client/templates/measure/task_execute.html | 10 ---------- server/services/recipe_service.py | 16 ---------------- 5 files changed, 6 insertions(+), 38 deletions(-) diff --git a/client/blueprints/measure.py b/client/blueprints/measure.py index 5d7bb45..b0eae1d 100644 --- a/client/blueprints/measure.py +++ b/client/blueprints/measure.py @@ -124,21 +124,15 @@ def task_execute(task_id: int): # Load all task IDs for this recipe (ordered) for auto-advance recipe_id = task_resp.get("recipe_id") all_task_ids = [] - recipe_resp = {} if recipe_id: tasks_resp = api_client.get(f"/api/recipes/{recipe_id}/tasks") if isinstance(tasks_resp, list): sorted_tasks = sorted(tasks_resp, key=lambda t: t.get("order_index", 0)) all_task_ids = [t["id"] for t in sorted_tasks] - # Fetch recipe for image_path - resp = api_client.get(f"/api/recipes/{recipe_id}") - if not (isinstance(resp, dict) and resp.get("error")): - recipe_resp = resp return render_template( "measure/task_execute.html", task=task_resp, - recipe=recipe_resp, lot_number=lot_number, serial_number=serial_number, all_task_ids=all_task_ids, diff --git a/client/templates/maker/recipe_editor.html b/client/templates/maker/recipe_editor.html index d8b05d7..ac0fc8a 100644 --- a/client/templates/maker/recipe_editor.html +++ b/client/templates/maker/recipe_editor.html @@ -438,8 +438,8 @@ function recipeEditor() { versions: {{ (recipe.versions if recipe and recipe.versions else [])|tojson }}, currentVersion: {{ (recipe.current_version.version_number if recipe and recipe.current_version else 0)|tojson }}, - // ---- File upload (thumbnail) ---- - currentFilePath: {{ (recipe.current_version.tasks[0].file_path if recipe and recipe.current_version and recipe.current_version.tasks and recipe.current_version.tasks|length > 0 and recipe.current_version.tasks[0].file_path else '')|tojson }}, + // ---- File upload (preview image) ---- + currentFilePath: {{ (recipe.image_path if recipe and recipe.image_path else '')|tojson }}, uploadingFile: false, dragOver: false, @@ -459,9 +459,9 @@ function recipeEditor() { description: this.description.trim(), }; - // Include file_path for thumbnail + // Include image_path for preview thumbnail if (this.currentFilePath) { - payload.file_path = this.currentFilePath; + payload.image_path = this.currentFilePath; } // Include change notes if editing diff --git a/client/templates/maker/recipe_list.html b/client/templates/maker/recipe_list.html index 36c8027..1b0e9ea 100644 --- a/client/templates/maker/recipe_list.html +++ b/client/templates/maker/recipe_list.html @@ -153,9 +153,9 @@
-