fix windows numpy import and add node timestamps

This commit is contained in:
matei jordache
2026-03-25 13:20:41 -07:00
parent e749d24cfe
commit 006fbc1dde
11 changed files with 263 additions and 8 deletions

View File

@@ -492,6 +492,10 @@ function Flow() {
console.log('[argonode] WS:', msg.type, msg.data?.node_id || msg.data?.node || '');
switch (msg.type) {
case 'execution_start':
setNodes((ns) => ns.map((n) => ({
...n,
data: { ...n.data, processingTimeMs: null },
})));
setStatus({ text: 'Running workflow…', level: 'info' });
break;
case 'executing':
@@ -518,6 +522,9 @@ function Flow() {
},
});
break;
case 'node_timing':
updateNodeData(msg.data.node_id, { processingTimeMs: msg.data.elapsed_ms });
break;
case 'mesh3d':
updateNodeData(msg.data.node_id, { meshData: msg.data.mesh });
break;
@@ -696,6 +703,7 @@ function Flow() {
meshData: null,
overlay: null,
scalarValue: null,
processingTimeMs: null,
},
};

View File

@@ -326,6 +326,16 @@ function formatScalarDisplay(scalarValue) {
};
}
function formatProcessingTime(value) {
const ms = Number(value);
if (!Number.isFinite(ms) || ms < 0) return null;
if (ms < 1) return `${ms.toFixed(2)} ms`;
if (ms < 10) return `${ms.toFixed(1)} ms`;
if (ms < 1000) return `${Math.round(ms)} ms`;
if (ms < 10000) return `${(ms / 1000).toFixed(2)} s`;
return `${(ms / 1000).toFixed(1)} s`;
}
function getSourceTypeForInput(store, nodeId, inputName) {
const targetHandle = `input::${inputName}::`;
const edge = store.edges?.find((e) => e.target === nodeId && e.targetHandle?.startsWith(targetHandle));
@@ -428,6 +438,7 @@ function CustomNode({ id, data }) {
const ctx = useContext(NodeContext);
const def = data.definition;
const scalarDisplay = formatScalarDisplay(data.scalarValue);
const processingTimeText = formatProcessingTime(data.processingTimeMs);
// Parse inputs into data handles and widgets
const required = def.input.required || {};
@@ -699,6 +710,11 @@ function CustomNode({ id, data }) {
<NodeTable rows={data.tableRows} />
</CollapsibleSection>
)}
{processingTimeText && (
<div className="node-benchmark" title={`Processed in ${processingTimeText}`}>
{processingTimeText}
</div>
)}
</div>
</div>
);

View File

@@ -150,6 +150,8 @@ html, body, #root {
.node-body {
padding: 4px 0;
display: flex;
flex-direction: column;
}
.node-warning {
@@ -628,6 +630,20 @@ html, body, #root {
text-align: right !important;
}
.node-benchmark {
align-self: flex-end;
margin: 8px 10px 4px;
padding: 3px 7px;
border: 1px solid rgba(148, 163, 184, 0.28);
border-radius: 999px;
background: rgba(15, 23, 42, 0.92);
color: #94a3b8;
font-family: "SF Mono", "Fira Code", monospace;
font-size: 10px;
line-height: 1;
font-variant-numeric: tabular-nums lining-nums;
}
/* ── Node resize handles ───────────────────────────────────────────── */
.node-resize-line {
border-color: #90caf9 !important;