diff --git a/server/src/wled_controller/static/js/features/graph-editor.js b/server/src/wled_controller/static/js/features/graph-editor.js index da2791c..7ea72a0 100644 --- a/server/src/wled_controller/static/js/features/graph-editor.js +++ b/server/src/wled_controller/static/js/features/graph-editor.js @@ -280,10 +280,16 @@ function _watchForNewEntity() { if (!Array.isArray(data)) return; for (const item of data) { if (item.id && !knownIds.has(item.id)) { - // Found a new entity — reload graph and navigate to it + // Found a new entity — reload graph and zoom to it const newId = item.id; cleanup(); - loadGraphEditor().then(() => _navigateToNode(newId)); + loadGraphEditor().then(() => { + const node = _nodeMap?.get(newId); + if (node && _canvas) { + _canvas.zoomToPoint(1.5, node.x + node.width / 2, node.y + node.height / 2); + } + _navigateToNode(newId); + }); return; } }