Phase 3 - Bidirectional Sync: - Add loadFromIntent and loadFromConfig to canvas store - Create useIntentParser hook for parsing Claude messages - Create ConfigImporter component (file upload, paste JSON, load study) - Add import/clear buttons to CanvasView header Phase 4 - Templates & Polish: - Create template library with 5 presets: - Mass Minimization (single-objective) - Multi-Objective Pareto (NSGA-II) - Turbo Mode (with MLP surrogate) - Mirror Zernike (optical optimization) - Frequency Optimization (modal) - Create TemplateSelector component with category filters - Enhanced BaseNode with animations, glow effects, status indicators - Add colorBg to all node types for visual distinction - Add notification toast system - Update all exports Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
20 lines
675 B
TypeScript
20 lines
675 B
TypeScript
import { memo } from 'react';
|
|
import { NodeProps } from 'reactflow';
|
|
import { BaseNode } from './BaseNode';
|
|
import { ConstraintNodeData } from '../../../lib/canvas/schema';
|
|
|
|
function ConstraintNodeComponent(props: NodeProps<ConstraintNodeData>) {
|
|
const { data } = props;
|
|
return (
|
|
<BaseNode {...props} icon={<span>🚧</span>} color="text-orange-600" colorBg="bg-orange-50">
|
|
{data.name && <div>{data.name}</div>}
|
|
{data.operator && data.value !== undefined && (
|
|
<div className="text-xs text-gray-400">
|
|
{data.operator} {data.value}
|
|
</div>
|
|
)}
|
|
</BaseNode>
|
|
);
|
|
}
|
|
export const ConstraintNode = memo(ConstraintNodeComponent);
|