feat: Enhance multi-cli-plan support with new synthesis types and update related components

This commit is contained in:
catlog22
2026-02-14 23:21:07 +08:00
parent 3a9a66aa3b
commit 0cfee90182
7 changed files with 132 additions and 43 deletions

View File

@@ -82,15 +82,16 @@ export function TaskDrawer({ task, isOpen, onClose }: TaskDrawerProps) {
return () => window.removeEventListener('keydown', handleEsc);
}, [isOpen, onClose]);
if (!task || !isOpen) {
return null;
}
// Normalize task to unified flat format (handles old nested, new flat, and raw LiteTask/TaskData)
// MUST be called before early return to satisfy React hooks rules
const nt = React.useMemo(
() => normalizeTask(task as unknown as Record<string, unknown>),
() => task ? normalizeTask(task as unknown as Record<string, unknown>) : null,
[task],
);
if (!task || !isOpen || !nt) {
return null;
}
const taskId = nt.task_id || 'N/A';
const taskTitle = nt.title || 'Untitled Task';
const taskDescription = nt.description;