From cccf0091baa318b3a05f5587ad55cce1deee41b3 Mon Sep 17 00:00:00 2001 From: Hera Zhao Date: Tue, 14 Apr 2026 16:10:43 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8D=E5=9C=A8=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=97=B6=E8=87=AA=E5=8A=A8=E8=B7=91html2canv?= =?UTF-8?q?as=EF=BC=8C=E6=94=B9=E4=B8=BA=E4=BF=9D=E5=AD=98=E6=97=B6?= =?UTF-8?q?=E6=8C=89=E9=9C=80=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根本原因: html2canvas在CI headless Electron环境会无限挂起, 导致recipe-detail测试卡死。改为只在用户点"保存图片"时才生成。 Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/components/RecipeDetailOverlay.vue | 2 +- frontend/src/views/OilReference.vue | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/RecipeDetailOverlay.vue b/frontend/src/components/RecipeDetailOverlay.vue index 2532a54..50bba81 100644 --- a/frontend/src/components/RecipeDetailOverlay.vue +++ b/frontend/src/components/RecipeDetailOverlay.vue @@ -829,7 +829,7 @@ onMounted(() => { else { selectedVolume.value = 'custom'; customVolumeValue.value = Math.round(ml) } loadBrand() - nextTick(() => generateCardImage()) + // Don't auto-generate card image on mount — generate on demand when saving }) function addIngredient() { diff --git a/frontend/src/views/OilReference.vue b/frontend/src/views/OilReference.vue index 587511a..239f38a 100644 --- a/frontend/src/views/OilReference.vue +++ b/frontend/src/views/OilReference.vue @@ -656,12 +656,8 @@ async function openOilDetail(name) { activeCard.value = card selectedOilName.value = null loadBrand() - // Pre-generate card image for instant save + // Generate image on demand when saving, not on open oilCardImageUrl.value = null - await nextTick() - await new Promise(r => setTimeout(r, 300)) - const el = document.querySelector('.oil-card-modal') - if (el) await generateImageFromRef({ value: el }, oilCardImageUrl) } else { activeCard.value = null activeCardName.value = null