diff --git a/desktop/src/components/WorkflowBuilder/PropertyPanel.tsx b/desktop/src/components/WorkflowBuilder/PropertyPanel.tsx index f60095e..9057ed1 100644 --- a/desktop/src/components/WorkflowBuilder/PropertyPanel.tsx +++ b/desktop/src/components/WorkflowBuilder/PropertyPanel.tsx @@ -87,8 +87,13 @@ function renderTypeSpecificFields( data: Partial, onChange: (field: string, value: unknown) => void ) { - // Type-safe property accessor for union-typed node data + // Type-safe property accessors for union-typed node data const d = data as Record; + const str = (key: string): string => (d[key] as string) || ''; + const num = (key: string): number | string => (d[key] as number) ?? ''; + const bool = (key: string): boolean => (d[key] as boolean) || false; + const arr = (key: string): string[] => (d[key] as string[]) || []; + const obj = (key: string): Record => (d[key] as Record) || {}; switch (type) { case 'input': return ( @@ -99,7 +104,7 @@ function renderTypeSpecificFields( onChange('variableName', e.target.value)} className="w-full px-3 py-2 border border-gray-300 rounded-lg font-mono" /> @@ -109,7 +114,7 @@ function renderTypeSpecificFields( Default Value