From 65aa23800c7d0398f869225315bf96cb3d783c08 Mon Sep 17 00:00:00 2001 From: ogt Date: Wed, 24 Jun 2026 21:02:19 +0800 Subject: [PATCH] fix: keep growth detail row highlighted from action plan --- config.py | 2 +- docs/AI_INTELLIGENCE_MODULE_SOT.md | 1 + templates/ai_intelligence.html | 6 +++--- tests/test_pchome_revenue_growth_service.py | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config.py b/config.py index 5658cbe..585e74a 100644 --- a/config.py +++ b/config.py @@ -402,7 +402,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.650" +SYSTEM_VERSION = "V10.651" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/docs/AI_INTELLIGENCE_MODULE_SOT.md b/docs/AI_INTELLIGENCE_MODULE_SOT.md index c98ca14..6d2bc2e 100644 --- a/docs/AI_INTELLIGENCE_MODULE_SOT.md +++ b/docs/AI_INTELLIGENCE_MODULE_SOT.md @@ -86,6 +86,7 @@ - V10.648 起 `/ai_intelligence` 的商品明細上方必須提供分類策略看板,把商品依分類彙總成可點擊的數據條列;每列至少顯示分類、近 7 天業績、商品數、價格壓力、價格優勢、缺比價、待確認與建議下一步。點擊分類後必須切到該分類商品明細。 - V10.649 起 `/ai_intelligence` 必須提供銷售策略建議看板,把商品分成價格防守、主推曝光、組合/單位價、資料補齊等營運路徑;每張策略卡需顯示件數、近 7 天業績、代表商品與可點擊下一步,點擊後必須切到對應商品明細。 - V10.650 起 `/ai_intelligence` 必須提供「今日策略動作」清單,從作戰商品中挑出前 5 件具體行動;每列需顯示處理順序、動作、商品、近 7 天業績、原因與可點擊的詳情/處理入口,避免使用者只看到分類與策略後仍不知道下一步要做哪一件商品。 +- V10.651 起從「今日策略動作」或其他非明細列入口打開單品作戰詳情時,商品明細列表中的對應商品仍必須標示為目前選取;使用者需能看出詳情與明細列的關聯。 ## 零之一、12 Agent 決策信封(2026-05-24) diff --git a/templates/ai_intelligence.html b/templates/ai_intelligence.html index a1abb85..dcfd3b1 100644 --- a/templates/ai_intelligence.html +++ b/templates/ai_intelligence.html @@ -3355,9 +3355,9 @@ function showGrowthProductDetail(productKey) { panel.classList.remove('is-hidden'); document.querySelectorAll('.growth-detail-row.is-active') .forEach((item) => item.classList.remove('is-active')); - Array.from(document.querySelectorAll('[data-growth-action="show-product-detail"]')) - .find((item) => item.dataset.productKey === activeGrowthProductKey) - ?.closest('.growth-detail-row') + Array.from(document.querySelectorAll('.growth-detail-row')) + .find((rowElement) => Array.from(rowElement.querySelectorAll('[data-growth-action="show-product-detail"]')) + .some((item) => item.dataset.productKey === activeGrowthProductKey)) ?.classList.add('is-active'); panel.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } diff --git a/tests/test_pchome_revenue_growth_service.py b/tests/test_pchome_revenue_growth_service.py index dab4b55..d64ffdb 100644 --- a/tests/test_pchome_revenue_growth_service.py +++ b/tests/test_pchome_revenue_growth_service.py @@ -487,6 +487,7 @@ def test_ai_intelligence_template_uses_pchome_growth_name_and_endpoint(): assert "今日策略動作" in template assert "renderGrowthActionBoard" in template assert "growthActionPlanForRow" in template + assert "document.querySelectorAll('.growth-detail-row')" in template assert "scrollToPanel('externalPricePanel')" in template assert "備援資料檢查" in template assert "外部報價預檢" not in template