fix: make growth command center primary nav
All checks were successful
CD Pipeline / deploy (push) Successful in 1m8s
All checks were successful
CD Pipeline / deploy (push) Successful in 1m8s
This commit is contained in:
@@ -402,7 +402,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '')
|
||||
# ==========================================
|
||||
# 系統版本與路徑
|
||||
# ==========================================
|
||||
SYSTEM_VERSION = "V10.653"
|
||||
SYSTEM_VERSION = "V10.654"
|
||||
LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log')
|
||||
public_url = PUBLIC_URL # 用於模板顯示
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
- V10.650 起 `/ai_intelligence` 必須提供「今日策略動作」清單,從作戰商品中挑出前 5 件具體行動;每列需顯示處理順序、動作、商品、近 7 天業績、原因與可點擊的詳情/處理入口,避免使用者只看到分類與策略後仍不知道下一步要做哪一件商品。
|
||||
- V10.651 起從「今日策略動作」或其他非明細列入口打開單品作戰詳情時,商品明細列表中的對應商品仍必須標示為目前選取;使用者需能看出詳情與明細列的關聯。
|
||||
- V10.652 起正式首頁 `/` 必須導向「PChome 業績成長自動化作戰系統」,舊商品看板僅保留在 `/dashboard` 或 `/product-dashboard`;「今日策略動作」必須放在首屏任務摘要後方,不能只藏在商品明細區;每列必須直接顯示價格證據,至少包含 PChome、MOMO、差距與可信度四格。候選待確認或缺資料時需以待確認/待補呈現,不得要求使用者先打開詳情才知道判斷依據。
|
||||
- V10.654 起全站側邊欄第一個主入口必須命名為「業績成長指揮台」並直連 `/ai_intelligence`;舊商品看板只能以「舊商品看板」保留在 `/dashboard`,比價工作台必須直連 `/dashboard?filter=pchome_review...`,不得再使用 `/` query 轉址,避免正式首頁與舊頁混淆。
|
||||
|
||||
## 零之一、12 Agent 決策信封(2026-05-24)
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#}
|
||||
|
||||
{% set _active_page = active_page|default('') %}
|
||||
{% set _is_growth_command = _active_page == 'ai_intelligence' %}
|
||||
{% set _is_price_workbench = _active_page == 'dashboard' and request is defined and request.args.get('filter') == 'pchome_review' %}
|
||||
{% set _next_run = next_run|default(None) %}
|
||||
{% set _session_username = session.get('username') if session is defined else None %}
|
||||
@@ -45,19 +46,24 @@
|
||||
</a>
|
||||
|
||||
<nav class="momo-nav momo-scroll">
|
||||
{# 群組 1: 監控(caramel) #}
|
||||
{# 群組 1: 作戰(caramel) #}
|
||||
<div class="momo-nav-group">
|
||||
<div class="momo-nav-group-title">監控</div>
|
||||
<a class="momo-nav-link {% if _active_page == 'dashboard' and not _is_price_workbench %}is-active{% endif %}" href="/">
|
||||
<span class="momo-nav-icon"><i class="fas fa-border-all"></i></span>
|
||||
<span class="momo-nav-label">商品看板</span>
|
||||
<div class="momo-nav-group-title">作戰</div>
|
||||
<a class="momo-nav-link {% if _is_growth_command %}is-active{% endif %}" href="/ai_intelligence">
|
||||
<span class="momo-nav-icon"><i class="fas fa-chart-line"></i></span>
|
||||
<span class="momo-nav-label">業績成長指揮台</span>
|
||||
<span class="momo-nav-code">01</span>
|
||||
</a>
|
||||
<a class="momo-nav-link {% if _is_price_workbench %}is-active{% endif %}" href="/?filter=pchome_review&review_status=all&sort_by=pchome_review&order=desc">
|
||||
<a class="momo-nav-link {% if _is_price_workbench %}is-active{% endif %}" href="/dashboard?filter=pchome_review&review_status=all&sort_by=pchome_review&order=desc">
|
||||
<span class="momo-nav-icon"><i class="fas fa-scale-balanced"></i></span>
|
||||
<span class="momo-nav-label">比價工作台</span>
|
||||
<span class="momo-nav-code">02</span>
|
||||
</a>
|
||||
<a class="momo-nav-link {% if _active_page == 'dashboard' and not _is_price_workbench %}is-active{% endif %}" href="/dashboard">
|
||||
<span class="momo-nav-icon"><i class="fas fa-border-all"></i></span>
|
||||
<span class="momo-nav-label">舊商品看板</span>
|
||||
<span class="momo-nav-code">舊</span>
|
||||
</a>
|
||||
<a class="momo-nav-link {% if _active_page in ['edm', 'campaigns'] %}is-active{% endif %}" href="/edm">
|
||||
<span class="momo-nav-icon"><i class="fas fa-bullhorn"></i></span>
|
||||
<span class="momo-nav-label">活動看板</span>
|
||||
@@ -119,7 +125,7 @@
|
||||
{# 群組 4: AI 中樞(saffron) #}
|
||||
<div class="momo-nav-group">
|
||||
<div class="momo-nav-group-title">AI 中樞</div>
|
||||
<a class="momo-nav-link {% if _active_page in ['ai_recommend', 'ai_history', 'ai_intelligence', 'pchome_crawler', 'price_comparison', 'trends'] %}is-active{% endif %}" href="/ai_recommend">
|
||||
<a class="momo-nav-link {% if _active_page in ['ai_recommend', 'ai_history', 'pchome_crawler', 'price_comparison', 'trends'] %}is-active{% endif %}" href="/ai_recommend">
|
||||
<span class="momo-nav-icon"><i class="fas fa-wand-magic-sparkles"></i></span>
|
||||
<span class="momo-nav-label">AI 助手</span>
|
||||
<span class="momo-nav-code">05</span>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
{% set legacy_bridge_title = '商品看板已升級' %}
|
||||
{% set legacy_bridge_kicker = 'MIGRATED DASHBOARD' %}
|
||||
{% set legacy_bridge_icon = 'fas fa-border-all' %}
|
||||
{% set legacy_bridge_heading = '請使用新版商品看板' %}
|
||||
{% set legacy_bridge_body = '舊版 dashboard.html 已停用,正式入口現在由 dashboard_v2.html 與 EwoooC V3 shell 負責。' %}
|
||||
{% set legacy_bridge_target = '/' %}
|
||||
{% set legacy_bridge_cta = '開啟商品看板' %}
|
||||
{% set legacy_bridge_heading = '請使用業績成長指揮台' %}
|
||||
{% set legacy_bridge_body = '舊版 dashboard.html 已停用;正式入口現在是 PChome 業績成長指揮台,商品看板僅保留為舊資料檢視入口。' %}
|
||||
{% set legacy_bridge_target = '/ai_intelligence' %}
|
||||
{% set legacy_bridge_cta = '開啟業績成長指揮台' %}
|
||||
{% set legacy_bridge_secondary_target = '/observability/overview' %}
|
||||
{% set legacy_bridge_secondary_cta = 'AI 觀測台' %}
|
||||
{% set legacy_bridge_meta = 'Legacy guard / dashboard.html' %}
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
|
||||
{# 群組映射 — Jinja 計算 [data-page-group] #}
|
||||
{% set _page = active_page|default('') %}
|
||||
{% set _group_monitor = ['dashboard', 'edm', 'campaigns'] %}
|
||||
{% set _group_monitor = ['ai_intelligence', 'dashboard', 'edm', 'campaigns'] %}
|
||||
{% set _group_analytics = ['sales', 'daily_sales', 'monthly', 'growth', 'metabase', 'grist'] %}
|
||||
{% set _group_ops = ['vendor_stockout', 'auto_import', 'market_intel'] %}
|
||||
{% set _group_ai = ['ai_recommend', 'ai_history', 'ai_intelligence',
|
||||
{% set _group_ai = ['ai_recommend', 'ai_history',
|
||||
'pchome_crawler', 'price_comparison', 'trends',
|
||||
'obs_overview', 'obs_agent_orchestration', 'obs_business_intel',
|
||||
'obs_host_health', 'obs_ai_calls', 'obs_budget',
|
||||
|
||||
@@ -510,3 +510,19 @@ def test_formal_homepage_routes_to_growth_command_center():
|
||||
assert "url_for('ai.ai_intelligence')" in route_source
|
||||
assert "@dashboard_bp.route('/dashboard')" in route_source
|
||||
assert "@dashboard_bp.route('/product-dashboard')" in route_source
|
||||
|
||||
|
||||
def test_sidebar_uses_growth_command_center_as_primary_entry():
|
||||
from pathlib import Path
|
||||
|
||||
shell = Path("templates/components/_ewoooc_shell.html").read_text(encoding="utf-8")
|
||||
base = Path("templates/ewoooc_base.html").read_text(encoding="utf-8")
|
||||
|
||||
assert 'href="/ai_intelligence"' in shell
|
||||
assert "業績成長指揮台" in shell
|
||||
assert "舊商品看板" in shell
|
||||
assert 'href="/dashboard?filter=pchome_review' in shell
|
||||
assert 'href="/?filter=pchome_review' not in shell
|
||||
assert "{% set _group_monitor = ['ai_intelligence', 'dashboard', 'edm', 'campaigns'] %}" in base
|
||||
ai_helper_line = next(line for line in shell.splitlines() if 'href="/ai_recommend"' in line)
|
||||
assert "ai_intelligence" not in ai_helper_line
|
||||
|
||||
Reference in New Issue
Block a user