diff --git a/web/src/LogicEditor.tsx b/web/src/LogicEditor.tsx index 25478d2..36b8c42 100644 --- a/web/src/LogicEditor.tsx +++ b/web/src/LogicEditor.tsx @@ -577,9 +577,13 @@ export default function LogicEditor({ graph, onChange, widgets = [], statevars, // Array names already referenced by accumulate/export/clear nodes, offered as // autocomplete suggestions so the same array is reused across nodes. - const arrayNames = Array.from(new Set( - nodes.map(n => n.params.array).filter((a): a is string => !!a) - )); + // Suggestions for the array-name autocomplete (export columns, accumulate, + // clear): declared array locals first, then any names already referenced by + // nodes (covers legacy/in-flight names not yet declared). + const arrayNames = Array.from(new Set([ + ...(statevars ?? []).filter(v => v.type === 'array').map(v => v.name), + ...nodes.map(n => n.params.array).filter((a): a is string => !!a), + ])); // Append a {ds:name} reference into a node's expression field. function insertRef(id: string, field: string, ds: string, sig: string) {