From d6669f1d04a0878b9640e18d7633a9edfaf3d05c Mon Sep 17 00:00:00 2001 From: Will Miao Date: Fri, 12 Jun 2026 08:47:11 +0800 Subject: [PATCH] fix(ui): stabilize node selector ordering by type then ID --- static/js/utils/uiHelpers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/utils/uiHelpers.js b/static/js/utils/uiHelpers.js index 321a1650..6c76a5e1 100644 --- a/static/js/utils/uiHelpers.js +++ b/static/js/utils/uiHelpers.js @@ -998,7 +998,9 @@ function showNodeSelector(nodes, options = {}) { nodeSelectorState.enableSendAll = options.enableSendAll !== false; // Generate node list HTML with icons and proper colors - const nodeItems = Object.entries(safeNodes).map(([nodeKey, node]) => { + const nodeItems = Object.entries(safeNodes) + .sort(([, a], [, b]) => a.type - b.type || a.id - b.id) + .map(([nodeKey, node]) => { const iconClass = NODE_TYPE_ICONS[node.type] || 'fas fa-question-circle'; const bgColor = node.bgcolor || DEFAULT_NODE_COLOR; const graphLabel = node.graph_name ? ` (${node.graph_name})` : '';