fix: make help and empty states action oriented
All checks were successful
CD Pipeline / deploy (push) Successful in 1m6s
All checks were successful
CD Pipeline / deploy (push) Successful in 1m6s
This commit is contained in:
@@ -402,7 +402,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '')
|
||||
# ==========================================
|
||||
# 系統版本與路徑
|
||||
# ==========================================
|
||||
SYSTEM_VERSION = "V10.664"
|
||||
SYSTEM_VERSION = "V10.665"
|
||||
LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log')
|
||||
public_url = PUBLIC_URL # 用於模板顯示
|
||||
|
||||
|
||||
@@ -741,3 +741,4 @@ POSTGRES_HOST=momo-db
|
||||
| 2026-06-25 | UI/UX 不可只修首頁,導覽主入口必須同一套 PChome 業績提升語言 | V10.662 起作戰、分析、營運、AI 助手主入口與廠商缺貨子工具都使用短句對齊「評估、分析、建議、解法、治理」流程;首頁今日行動卡維持 980px 上限與高對比主按鈕,禁止回到全寬長文說明。 |
|
||||
| 2026-06-25 | 首頁今日行動 CTA 不可被全域 Bootstrap guard 蓋成透明或低對比 | V10.663 起 `#commandTaskButton.growth-command-alert-action` 使用精準 selector 與 `background-color` hard override,正式 smoke 必須量測按鈕背景與卡片寬度。 |
|
||||
| 2026-06-25 | 系統、舊入口與觀測台頁首不可用長篇工程說明取代決策用途 | V10.664 起舊入口、系統管理與 AI 觀測台頁首統一改為短句,聚焦資料新鮮度、成本、品質、RAG 與自癒如何支援 PChome 業績判斷。 |
|
||||
| 2026-06-25 | 說明、空狀態與登入頁不可停在教學口吻,必須提示下一個業績動作 | V10.665 起 AI 助手說明、業績空狀態、缺貨舊首頁、登入頁與 PPT 視覺 QA 空狀態改為行動導向短句,避免使用者在說明文字中迷路。 |
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<section class="ppt-diagnostic-strip" id="ppt-runtime-diagnostic">
|
||||
<div>
|
||||
<div class="ppt-label">視覺 QA 尚未就緒</div>
|
||||
<strong>目前不是模型能力問題,而是執行環境尚未完整開啟。</strong>
|
||||
<strong>先補齊視覺 QA runtime,再判斷簡報品質。</strong>
|
||||
<small class="text-muted">{{ vision_status.summary }}</small>
|
||||
</div>
|
||||
<div class="ppt-diagnostic-checks" aria-label="視覺 QA runtime checklist">
|
||||
@@ -132,7 +132,7 @@
|
||||
<div class="ppt-vision-job">
|
||||
<span>尚無紀錄</span>
|
||||
<strong>待命</strong>
|
||||
<small>按下「立即視覺 QA」後會在這裡顯示背景任務狀態。</small>
|
||||
<small>啟動視覺 QA 後會顯示背景任務狀態。</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -522,7 +522,7 @@
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="ppt-empty ppt-run-empty">
|
||||
目前查無本月 DB 產出紀錄;下一次自動排程或手動補齊後,會寫入 ppt_generation_runs 並顯示在這裡。
|
||||
本月尚無 DB 產出紀錄;先補排程或手動產出,再進行視覺 QA。
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -733,7 +733,7 @@
|
||||
<div class="ppt-panel-body">
|
||||
<div class="ppt-empty p-3">
|
||||
<p class="mb-1"><strong>尚未形成 daily 審核統計。</strong></p>
|
||||
<p class="mb-0">排程或立即視覺 QA 完成後,這裡會顯示本月通過率、失敗檔案與修復建議。</p>
|
||||
<p class="mb-0">先完成視覺 QA,再看本月通過率、失敗檔案與修復建議。</p>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
@@ -766,7 +766,7 @@
|
||||
{% endif %}
|
||||
{% if not vision_enabled %}
|
||||
<div class="alert alert-info mt-3">
|
||||
<strong>為什麼這頁空?</strong>
|
||||
<strong>先補視覺 QA 條件</strong>
|
||||
<ul class="mb-0 small mt-2">
|
||||
<li>PPT_VISION_ENABLED=false</li>
|
||||
<li>188 主機需安裝 LibreOffice</li>
|
||||
|
||||
@@ -2894,7 +2894,7 @@
|
||||
<div class="growth-decision-panel" id="growthDecisionSummary">
|
||||
<div>
|
||||
<h3 class="growth-decision-title">正在整理處理建議</h3>
|
||||
<p class="growth-decision-copy">讀取商品、業績與比價狀態後,這裡會顯示最適合的下一步。</p>
|
||||
<p class="growth-decision-copy">先整理業績、比價與資料狀態,再決定下一步。</p>
|
||||
</div>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary table-row-action" onclick="showGrowthDetail('all')">查看明細</button>
|
||||
</div>
|
||||
@@ -3192,7 +3192,7 @@
|
||||
<div class="offer-dryrun-result" id="offerDryRunResult">
|
||||
<div class="text-center py-4 text-muted">
|
||||
<i class="fas fa-circle-info d-block mb-2"></i>
|
||||
自動來源不足時,再用這裡檢查備援資料品質。
|
||||
自動來源不足時,先檢查備援資料品質。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<span id="geminiStatus" class="ar-status {{ 'ar-status--info' if gemini_status else 'ar-status--off' }}">
|
||||
<i class="fab fa-google"></i> Gemini 備援 {{ '檢查中' if gemini_status is none else ('✓' if gemini_status else '✗') }}
|
||||
</span>
|
||||
<button class="btn btn-outline-secondary btn-sm" data-bs-toggle="modal" data-bs-target="#helpModal" title="使用說明">
|
||||
<button class="btn btn-outline-secondary btn-sm" data-bs-toggle="modal" data-bs-target="#helpModal" title="銷售動作">
|
||||
<i class="fas fa-question-circle"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -409,26 +409,26 @@
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header py-2">
|
||||
<h6 class="modal-title"><i class="fas fa-question-circle me-2"></i>使用說明</h6>
|
||||
<h6 class="modal-title"><i class="fas fa-question-circle me-2"></i>銷售動作</h6>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body py-3">
|
||||
<div class="d-flex align-items-start mb-3">
|
||||
<span class="badge ar-step-badge me-2">1</span>
|
||||
<div><strong>輸入商品名稱</strong><p class="text-muted small mb-0">可直接輸入或從右側熱銷商品點選</p></div>
|
||||
<div><strong>選商品</strong><p class="text-muted small mb-0">優先挑高業績、下滑或有價差壓力的商品。</p></div>
|
||||
</div>
|
||||
<div class="d-flex align-items-start mb-3">
|
||||
<span class="badge ar-step-badge me-2">2</span>
|
||||
<div><strong>選擇文案風格</strong><p class="text-muted small mb-0">吸睛活潑、專業權威、溫馨感性、限時急迫</p></div>
|
||||
<div><strong>選策略語氣</strong><p class="text-muted small mb-0">依價格優勢、補貨或活動曝光選文案方向。</p></div>
|
||||
</div>
|
||||
<div class="d-flex align-items-start mb-3">
|
||||
<span class="badge ar-step-badge me-2">3</span>
|
||||
<div><strong>點擊生成文案</strong><p class="text-muted small mb-0">AI 會根據市場趨勢自動生成銷售文案</p></div>
|
||||
<div><strong>產生建議</strong><p class="text-muted small mb-0">把商品證據轉成可追蹤的銷售動作。</p></div>
|
||||
</div>
|
||||
<hr>
|
||||
<p class="small text-muted mb-0">
|
||||
<i class="fas fa-lightbulb me-1"></i>
|
||||
<strong>小技巧:</strong>使用「AI 智慧搜尋」可獲得更多市場洞察,點選「商品洞察」可分析競品與市場定位。
|
||||
<strong>下一步:</strong>文案產出後,回到業績成長指揮台追蹤是否帶動商品處理。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<div class="empty-state">
|
||||
<i class="fas fa-exclamation-triangle empty-state__icon" aria-hidden="true"></i>
|
||||
<h4 class="empty-state__title">{{ error }}</h4>
|
||||
<p class="empty-state__hint">請前往 <a href="/system_settings">系統設定頁面</a> 匯入當日業績 Excel 檔案。</p>
|
||||
<p class="empty-state__hint">先到 <a href="/system_settings">系統設定</a> 匯入當日業績,才能判斷下滑與價差壓力。</p>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<section class="ga-empty-state">
|
||||
<i class="fas fa-chart-line" aria-hidden="true"></i>
|
||||
<h2>尚未匯入可分析的業績資料</h2>
|
||||
<p>{{ empty_message|default('匯入月度業績資料後,這裡會顯示 YTD、AOV、訂單數與成長趨勢。') }}</p>
|
||||
<p>{{ empty_message|default('先匯入月度業績資料,再評估成長、AOV 與毛利缺口。') }}</p>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -86,34 +86,31 @@
|
||||
<header class="home-manual__head">
|
||||
<h2 class="home-manual__title">
|
||||
<i class="fas fa-info-circle" aria-hidden="true"></i>
|
||||
系統使用說明
|
||||
缺貨處理順序
|
||||
</h2>
|
||||
</header>
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<h3 class="home-manual__subhead">
|
||||
<i class="fas fa-arrow-right" aria-hidden="true"></i>基本流程
|
||||
<i class="fas fa-arrow-right" aria-hidden="true"></i>先補供貨風險
|
||||
</h3>
|
||||
<ol class="home-manual__list home-manual__list--ordered">
|
||||
<li>下載 Excel 範本,填入缺貨商品資料</li>
|
||||
<li>在「缺貨清單」使用 Excel 匯入功能上傳檔案</li>
|
||||
<li>在「缺貨清單」中檢視並編輯資料</li>
|
||||
<li>在「廠商管理」中設定廠商郵件</li>
|
||||
<li>在「缺貨清單」勾選商品後發送郵件通知廠商</li>
|
||||
<li>在「發送歷史」中查看執行結果</li>
|
||||
<li>匯入缺貨 Excel,先建立正式缺貨資料。</li>
|
||||
<li>在缺貨清單鎖定待發送與失敗項目。</li>
|
||||
<li>補齊廠商收件人,讓通知能送達。</li>
|
||||
<li>發送缺貨通知,避免主推商品斷貨。</li>
|
||||
<li>回看發送歷史,補救失敗通知。</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3 class="home-manual__subhead home-manual__subhead--alt">
|
||||
<i class="fas fa-arrow-right" aria-hidden="true"></i>功能特色
|
||||
<i class="fas fa-arrow-right" aria-hidden="true"></i>業績保護重點
|
||||
</h3>
|
||||
<ul class="home-manual__list">
|
||||
<li>自動偵測重複資料並標記</li>
|
||||
<li>支援一次匯入多筆缺貨記錄</li>
|
||||
<li>依廠商分組自動產生郵件附件</li>
|
||||
<li>郵件發送前可預覽內容</li>
|
||||
<li>完整的操作記錄與錯誤追蹤</li>
|
||||
<li>支援失敗郵件重新發送</li>
|
||||
<li>先處理高業績商品的缺貨風險。</li>
|
||||
<li>重複資料自動標記,避免通知混亂。</li>
|
||||
<li>依廠商分組通知,縮短補貨溝通時間。</li>
|
||||
<li>失敗通知可重送,避免補救斷線。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
<span>EwoooC</span>
|
||||
</a>
|
||||
<h1>營運數據工作台</h1>
|
||||
<p>商品、活動、廠商缺貨與 AI 觀測台都在同一個控制面。登入後會回到正式資料頁面。</p>
|
||||
<p>登入後先看 PChome 業績、價差、缺貨與 AI 建議。</p>
|
||||
<div class="login-meta">
|
||||
<span class="login-pill"><i class="fas fa-shield-halved"></i>CSRF 防護</span>
|
||||
<span class="login-pill"><i class="fas fa-clock"></i>Session 2h</span>
|
||||
|
||||
@@ -311,7 +311,7 @@ function uploadMonthlySummary() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!confirm(`確定要匯入「${file.name}」嗎?\n資料庫將根據檔案中的年月份自動覆蓋既有數據。\n處理大量資料可能需要較長時間,請勿關閉視窗。`)) {
|
||||
if (!confirm(`確定要匯入「${file.name}」嗎?\n系統會更新對應年月份的業績資料。\n匯入期間請勿關閉視窗。`)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -653,3 +653,46 @@ def test_secondary_and_governance_pages_keep_growth_decision_copy_concise():
|
||||
assert marker in text
|
||||
for bad in forbidden:
|
||||
assert bad not in text
|
||||
|
||||
|
||||
def test_help_empty_login_and_ppt_copy_are_action_oriented():
|
||||
from pathlib import Path
|
||||
|
||||
expected = {
|
||||
"templates/ai_recommend.html": [
|
||||
"銷售動作",
|
||||
"把商品證據轉成可追蹤的銷售動作",
|
||||
"回到業績成長指揮台追蹤是否帶動商品處理",
|
||||
],
|
||||
"templates/ai_intelligence.html": [
|
||||
"先整理業績、比價與資料狀態,再決定下一步",
|
||||
"先檢查備援資料品質",
|
||||
],
|
||||
"templates/daily_sales.html": ["才能判斷下滑與價差壓力"],
|
||||
"templates/growth_analysis.html": ["先匯入月度業績資料,再評估成長、AOV 與毛利缺口"],
|
||||
"templates/index.html": ["缺貨處理順序", "避免主推商品斷貨"],
|
||||
"templates/login.html": ["登入後先看 PChome 業績、價差、缺貨與 AI 建議"],
|
||||
"templates/system_settings.html": ["系統會更新對應年月份的業績資料"],
|
||||
"templates/admin/ppt_audit_history.html": [
|
||||
"先補齊視覺 QA runtime,再判斷簡報品質",
|
||||
"先補排程或手動產出,再進行視覺 QA",
|
||||
"先補視覺 QA 條件",
|
||||
],
|
||||
}
|
||||
forbidden = [
|
||||
"使用說明",
|
||||
"這裡會顯示最適合的下一步",
|
||||
"再用這裡檢查",
|
||||
"這裡會顯示背景任務狀態",
|
||||
"目前查無本月 DB 產出紀錄",
|
||||
"為什麼這頁空",
|
||||
"目前不是模型能力問題",
|
||||
"大量資料可能需要較長時間",
|
||||
]
|
||||
|
||||
for path, markers in expected.items():
|
||||
text = Path(path).read_text(encoding="utf-8")
|
||||
for marker in markers:
|
||||
assert marker in text
|
||||
for bad in forbidden:
|
||||
assert bad not in text
|
||||
|
||||
Reference in New Issue
Block a user