From 426ad3d5dd3ff5e04fc7532aa7aca9e65d9aaa69 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 25 Jun 2026 21:57:13 +0800 Subject: [PATCH] fix(web): show Runs incident status-chain focus --- apps/web/src/app/[locale]/awooop/runs/page.tsx | 11 +++++++---- docs/LOGBOOK.md | 18 ++++++++++++++++++ ...2026-06-25-awoooi-product-uiux-inventory.md | 15 +++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/[locale]/awooop/runs/page.tsx b/apps/web/src/app/[locale]/awooop/runs/page.tsx index c8e955a3..1965ce4e 100644 --- a/apps/web/src/app/[locale]/awooop/runs/page.tsx +++ b/apps/web/src/app/[locale]/awooop/runs/page.tsx @@ -4539,10 +4539,13 @@ export default function RunsPage() { }; }, [runs]); const runIncidentIds = useMemo(() => { - return Array.from(new Set( - runs.flatMap((run) => linkedIncidentIds(run.remediation_summary)) - )); - }, [runs]); + const normalizedIncidentFilter = incidentFilter.trim().toUpperCase(); + const ids = runs.flatMap((run) => linkedIncidentIds(run.remediation_summary)); + if (INCIDENT_ID_FILTER_RE.test(normalizedIncidentFilter)) { + ids.unshift(normalizedIncidentFilter); + } + return Array.from(new Set(ids)); + }, [runs, incidentFilter]); const { statusChains: runStatusChains, isLoading: runStatusChainsLoading, diff --git a/docs/LOGBOOK.md b/docs/LOGBOOK.md index 8e3693ca..c7090574 100644 --- a/docs/LOGBOOK.md +++ b/docs/LOGBOOK.md @@ -17,6 +17,24 @@ **邊界**:本段只修查詢預篩選;不寫 DB、不改 run 狀態、不執行修復、不發 Telegram、不開 runtime gate。 +## 2026-06-25|Runs incident filter 直接接入 status-chain 焦點 + +**背景**:`e5a0aa13` 部署後,正式 `/api/v1/platform/runs/list?incident_id=INC-20260625-977E5F` 已從 `502` 修成 `200`,但 run list 摘要本身不一定帶 `remediation_summary.incident_ids`。Runs 頁原本只從 run summary 推導要查哪些 status-chain,導致 URL 已經帶 `incident_id` 時仍可能看不到該事故的 `automation_handoff`。 + +**完成**: +- Runs 頁在 `incidentFilter` 符合 `INC-*` 格式時,直接把 URL 上的 incident id 納入 `useIncidentStatusChains` 查詢。 +- 保留原本從 run summary 收斂多事故關聯的邏輯;URL 焦點只是補上單一事故 drilldown 的主資料源。 + +**驗證待辦**: +- `pnpm --filter @awoooi/web typecheck`。 +- 下一個 deploy marker 後重跑 `/zh-TW/awooop/runs?project_id=awoooi&incident_id=INC-20260625-977E5F` desktop / mobile smoke。 + +**完成度同步**: +- Runs incident drilldown 穩定性:`72% -> 82%`。 +- AwoooP Runs apply-gate 正式頁驗證:等待前端修正 deploy 後重跑。 + +**邊界**:本段只補 UI 查詢來源;不寫 DB、不改 run 狀態、不執行修復、不發 Telegram、不開 runtime gate。 + ## 2026-06-25|Status-chain 新增乾跑後套用閘門 handoff **背景**:`INC-20260625-977E5F` 類告警目前已能辨識 Ansible `check_mode` 乾跑成功、`apply_total=0`、`verifier=missing`,但 operator 在 Runs / Telegram 看見的下一步仍容易停在「需人工」或長文字。這會讓 AI 自動化看起來像只是把問題丟回人工,而不是清楚交付下一個可審核 gate。 diff --git a/docs/workplans/2026-06-25-awoooi-product-uiux-inventory.md b/docs/workplans/2026-06-25-awoooi-product-uiux-inventory.md index ecd5e7fc..7f1d72d3 100644 --- a/docs/workplans/2026-06-25-awoooi-product-uiux-inventory.md +++ b/docs/workplans/2026-06-25-awoooi-product-uiux-inventory.md @@ -264,6 +264,21 @@ Tenants 目前已讀到: 完成度同步:Runs incident drilldown 穩定性 `60% -> 72%`;Runs apply-gate 正式頁驗證需下一個 deploy marker 後重跑。 +### 2.5.10 Runs incident filter 接入 status-chain 焦點 + +2026-06-25 `e5a0aa13` 部署後,正式 API 已證明 incident drilldown 不再 502: + +| 項目 | 結果 | +|---|---| +| Health | `/api/v1/health`:`healthy / prod / mock_mode=false` | +| Status-chain | `INC-20260625-977E5F` 回 `ansible_check_mode_only`、`automation_handoff.kind=ansible_check_mode_apply_gate`、`runtime_execution_authorized=false` | +| Runs list | `/api/v1/platform/runs/list?incident_id=INC-20260625-977E5F` 回 `200`、`total=3` | +| 新缺口 | run list 摘要不一定帶 `remediation_summary.incident_ids`,前端只靠 run summary 推導 status-chain 時,URL 已帶 incident id 仍可能看不到焦點 handoff | + +修正:Runs 頁若 URL `incident_id` 符合 `INC-*` 格式,直接把該 id 納入 `useIncidentStatusChains`,保留原本從 run summary 收斂多事故關聯的邏輯。 + +完成度同步:Runs incident drilldown 穩定性 `72% -> 82%`;AwoooP Runs apply-gate 正式頁驗證需前端修正 deploy 後重跑。 + ## 3. 頁面 UI/UX 現況盤點 2026-06-25 對正式站桌機 / mobile 抽查: