From b0302329f4eee5f69bd0ef1dde54469e50c41609 Mon Sep 17 00:00:00 2001 From: OG T Date: Mon, 23 Mar 2026 13:54:42 +0800 Subject: [PATCH] fix(web): Pass decision prop to DualStateIncidentCard Root cause: mapToDualState() was missing decision field, causing Y/n buttons to be permanently disabled. Now correctly passes incident.decision to the card component. Co-Authored-By: Claude Opus 4.5 --- apps/web/src/app/[locale]/page.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/web/src/app/[locale]/page.tsx b/apps/web/src/app/[locale]/page.tsx index 3f0e6f72..9c7ee0fb 100644 --- a/apps/web/src/app/[locale]/page.tsx +++ b/apps/web/src/app/[locale]/page.tsx @@ -25,6 +25,7 @@ import { OpenClawStateMachine } from '@/components/ai/openclaw-state-machine' import { GlobalPulseChart } from '@/components/charts/global-pulse-chart' import { useGlobalPulseMetrics } from '@/hooks/useGlobalPulseMetrics' import { useIncidents } from '@/hooks/useIncidents' +import { DecisionInfo } from '@/lib/api-client' import { IncidentCard, IncidentCardGrid, @@ -47,6 +48,7 @@ function mapToDualState(incident: IncidentResponse | null | undefined): { tier?: 1 | 2 | 3 message: string timestamp: string + decision?: DecisionInfo | null // Phase 6.5: 決策令牌 } { // 防禦性檢查: 若 incident 無效則返回預設值 if (!incident) { @@ -57,6 +59,7 @@ function mapToDualState(incident: IncidentResponse | null | undefined): { tier: undefined, message: '資料載入中...', timestamp: '-', + decision: null, } } @@ -108,6 +111,7 @@ function mapToDualState(incident: IncidentResponse | null | undefined): { tier, message, timestamp, + decision: incident.decision, // Phase 6.5: 傳遞決策令牌 } }