Skip to content

feat(web): 移除資料已自動更新的區塊重整按鈕 - #249

Merged
Ponpon55837 merged 1 commit into
mainfrom
feat/trim-refresh-buttons
Oct 19, 2026
Merged

Ponpon55837 merged 1 commit into
mainfrom
feat/trim-refresh-buttons

Conversation

@Ponpon55837

Copy link
Copy Markdown
Owner

為什麼

各頁有很多「重新整理」按鈕,但有些按了沒反應。原因是伺服器每 2 秒輪詢 SQLite(PRAGMA data_version + total_changes),一有變更就推 SSE,讓所有啟用中的 Pinia Colada query 失效重抓;Agent 請求在 pending 時另外每 5 秒輪詢。所以這些區塊的資料本來就是最新的,按鈕只是重抓同一份資料,看起來像「沒效果」。

變更

移除(資料已自動更新)

  • 系統狀態 → Agent 讀取紀錄「重新整理」
  • 未結項整理面板「重新整理」
  • Metadata 回補請求狀態的重整圖示
  • AI 報告整理卡片標題的重整圖示
  • 報告呈現「重新整理呈現」
  • 工作報告頁標題列的重整圖示(匯出進度改顯示在匯出選單上,UiActionMenu 新增 loading prop)

保留:頁首全域重整、錯誤訊息裡的重試、系統狀態「重新整理狀態」、備份清單重整(服務狀態與備份檔不在 SQLite,SSE 不會通知)。

修正誤導文案/圖示

  • AI 整理的重跑按鈕原本寫「重新整理」,實際是建立新的 Agent 請求 → 改成「重新產生」/「重新產生這份報告的整理」
  • Knowledge「要求 Agent 更新/建立」改用 sparkles 圖示,不再用重整圖示

E2E 原本點區塊重整按鈕觸發背景重抓,改成 dispatch visibilitychange(work-intelligence.spec.ts 已有前例)。UI skill 文件同步更新。

驗證

  • pnpm --filter @work-intelligence/web typecheck、pnpm lint、pnpm format:check、web 單元測試 178 筆全部通過
  • 本機 Chromium 完整 E2E:119 passed,4 failed。這 4 筆單獨重跑都通過(ECONNRESET/route timing 類 flaky)。Firefox/WebKit 本機沒安裝,跨瀏覽器交給 CI
  • dev server 實測:報告頁、系統狀態頁只剩預期的按鈕,console 沒有新錯誤

🤖 Generated with Claude Code

…freshes

The server polls SQLite (PRAGMA data_version + total_changes) every 2 s and
pushes an SSE event that invalidates every active Pinia Colada query, and
Agent requests are additionally polled while pending. Section refresh
buttons on Agent reads, open-item cleanup, metadata backfill status, AI
synthesis status, report presentation and the work report page therefore
refetched data that was already current, so clicking them looked like it
did nothing.

- Remove those buttons; keep the header refresh, error retries, System
  status refresh and the backup list refresh (state outside SQLite).
- Synthesis re-run buttons no longer say 重新整理 (重新產生/重新產生這份
  報告的整理); Knowledge Agent requests use the sparkles icon.
- Export progress moves from the removed report refresh button onto the
  export menu via a new UiActionMenu `loading` prop.
- E2E: trigger background refreshes with visibilitychange instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Ponpon55837
Ponpon55837 enabled auto-merge October 19, 2026 01:50
@Ponpon55837
Ponpon55837 merged commit 256b14e into main Oct 19, 2026
4 checks passed
@Ponpon55837
Ponpon55837 deleted the feat/trim-refresh-buttons branch October 19, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant