un2266 commited on
Commit
686c7cd
·
1 Parent(s): 5ece6e2

分析運算面板加上「請保持前景、電腦勿休眠」提醒文字

Browse files

低風險緩解措施,對應開發優化建議.md第一節提到的連線中斷問題:系統
目前沒有連線中斷後恢復進度的機制,先用文案提醒使用者在看到「分析
完成」前不要把分頁切到背景或讓電腦休眠。只在任一子階段status為
running時顯示,全部done/failed後自動隱藏,不干擾完成後的畫面。

Playwright 驗證:情境1(略過Metadata路徑)跑一次完整分析,提醒文字
在運算期間正確顯示、分析完成後正確消失,無 console/server error。

Files changed (2) hide show
  1. app_agent.py +15 -1
  2. assets/app.css +13 -0
app_agent.py CHANGED
@@ -3479,10 +3479,24 @@ def create_app():
3479
  f'<div class="analysis-row-body">{line}{entry}</div>'
3480
  '</div>'
3481
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3482
  return (
3483
  '<div class="analysis-panel">'
3484
  '<h2 class="analysis-panel-title">分析運算</h2>'
3485
- + "".join(rows) +
3486
  '</div>'
3487
  )
3488
 
 
3479
  f'<div class="analysis-row-body">{line}{entry}</div>'
3480
  '</div>'
3481
  )
3482
+ # 2026-08-05:連線一斷、後端還是會照跑完,但前端畫面收不到任何
3483
+ # 更新(見「開發優化建議.md」第一節選項C討論)。系統目前沒有
3484
+ # 連線中斷後恢復進度的機制,只能先用文案提醒使用者在還沒看到
3485
+ # 「分析完成」前,不要把分頁切到背景或讓電腦休眠。只在還有子
3486
+ # 階段「進行中」時顯示,全部 done/failed 定案後就不需要了。
3487
+ any_running = any(
3488
+ A.get(k, {}).get("status") == "running" for k, _, _ in _ANALYSIS_STAGES
3489
+ )
3490
+ hint = (
3491
+ '<p class="analysis-panel-hint">'
3492
+ '⚠️ 分析運算期間請保持此分頁在前景、電腦勿休眠,直到看到「分析完成」為止,'
3493
+ '避免連線中斷導致畫面卡住。</p>'
3494
+ if any_running else ""
3495
+ )
3496
  return (
3497
  '<div class="analysis-panel">'
3498
  '<h2 class="analysis-panel-title">分析運算</h2>'
3499
+ + hint + "".join(rows) +
3500
  '</div>'
3501
  )
3502
 
assets/app.css CHANGED
@@ -1719,6 +1719,19 @@ img.button-icon { opacity: .82; }
1719
  font-weight: 700 !important;
1720
  color: var(--c-text) !important;
1721
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1722
  .analysis-row {
1723
  display: flex;
1724
  flex-direction: column;
 
1719
  font-weight: 700 !important;
1720
  color: var(--c-text) !important;
1721
  }
1722
+ /* 2026-08-05:分析運算進行中的連線提醒,低視覺重量(跟標題/狀態列比起來
1723
+ 是次要資訊),用 warn 色系底+左邊框做出「提示」語彙,不搶過主要內容。 */
1724
+ .analysis-panel-hint {
1725
+ margin: 0 0 1rem 0 !important;
1726
+ padding: .6rem .8rem !important;
1727
+ border-left: 3px solid var(--c-warn) !important;
1728
+ border-radius: 4px !important;
1729
+ background: rgba(180,83,9,.08) !important;
1730
+ font-size: .82rem !important;
1731
+ line-height: 1.5 !important;
1732
+ color: var(--c-text-muted) !important;
1733
+ }
1734
+ .dark .analysis-panel-hint { background: rgba(251,191,36,.10) !important; }
1735
  .analysis-row {
1736
  display: flex;
1737
  flex-direction: column;