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 <noreply@anthropic.com>
This commit is contained in:
@@ -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: 傳遞決策令牌
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user