## Cleanup (v0.5.0) - Delete 102+ orphaned MCP session temp files - Remove build artifacts (htmlcov, dist, __pycache__) - Archive superseded plan docs (RALPH_LOOP V2/V3, CANVAS V3, etc.) - Move debug/analysis scripts from tests/ to tools/analysis/ - Archive redundant NX journals to archive/nx_journals/ - Archive monolithic PROTOCOL.md to docs/archive/ - Update .gitignore with missing patterns - Clean old study files (optimization_log_old.txt, run_optimization_old.py) ## Canvas UX (Phases 7-9) - Phase 7: Resizable panels with localStorage persistence - Left sidebar: 200-400px, Right panel: 280-600px - New useResizablePanel hook and ResizeHandle component - Phase 8: Enable all palette items - All 8 node types now draggable - Singleton logic for model/solver/algorithm/surrogate - Phase 9: Solver configuration - Add SolverEngine type (nxnastran, mscnastran, python, etc.) - Add NastranSolutionType (SOL101-SOL200) - Engine/solution dropdowns in config panel - Python script path support ## Documentation - Update CHANGELOG.md with recent versions - Update docs/00_INDEX.md - Create examples/README.md - Add docs/plans/CANVAS_UX_IMPROVEMENTS.md
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import { memo } from 'react';
|
|
import { NodeProps } from 'reactflow';
|
|
import { Cpu, Terminal } from 'lucide-react';
|
|
import { BaseNode } from './BaseNode';
|
|
import { SolverNodeData, SolverEngine } from '../../../lib/canvas/schema';
|
|
|
|
// Human-readable engine names
|
|
const ENGINE_LABELS: Record<SolverEngine, string> = {
|
|
nxnastran: 'NX Nastran',
|
|
mscnastran: 'MSC Nastran',
|
|
python: 'Python Script',
|
|
abaqus: 'Abaqus',
|
|
ansys: 'ANSYS',
|
|
};
|
|
|
|
function SolverNodeComponent(props: NodeProps<SolverNodeData>) {
|
|
const { data } = props;
|
|
|
|
// Build display string: "Engine - SolutionType" or just one
|
|
const engineLabel = data.engine ? ENGINE_LABELS[data.engine] : null;
|
|
const solverTypeLabel = data.solverType || null;
|
|
|
|
let displayText: string;
|
|
if (engineLabel && solverTypeLabel) {
|
|
displayText = `${engineLabel} (${solverTypeLabel})`;
|
|
} else if (engineLabel) {
|
|
displayText = engineLabel;
|
|
} else if (solverTypeLabel) {
|
|
displayText = solverTypeLabel;
|
|
} else {
|
|
displayText = 'Configure solver';
|
|
}
|
|
|
|
// Use Terminal icon for Python, Cpu for others
|
|
const icon = data.engine === 'python'
|
|
? <Terminal size={16} />
|
|
: <Cpu size={16} />;
|
|
|
|
return (
|
|
<BaseNode {...props} icon={icon} iconColor="text-violet-400">
|
|
{displayText}
|
|
</BaseNode>
|
|
);
|
|
}
|
|
export const SolverNode = memo(SolverNodeComponent);
|