diff --git a/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx b/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx index d180de0..5f5fc1d 100644 --- a/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx +++ b/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx @@ -60,6 +60,19 @@ const Island = ({ title, description, icon, actions, children, sx }) => ( ); // ---------------- Workflows Island ----------------- +const sortTree = (node) => { + if (!node || !Array.isArray(node.children)) return; + node.children.sort((a, b) => { + const aFolder = Boolean(a.isFolder); + const bFolder = Boolean(b.isFolder); + if (aFolder !== bFolder) return aFolder ? -1 : 1; + return String(a.label || "").localeCompare(String(b.label || ""), undefined, { + sensitivity: "base" + }); + }); + node.children.forEach(sortTree); +}; + function buildWorkflowTree(workflows, folders) { const map = {}; const rootNode = { id: "root", label: "Workflows", path: "", isFolder: true, children: [] }; @@ -107,6 +120,7 @@ function buildWorkflowTree(workflows, folders) { } }); }); + sortTree(rootNode); return { root: [rootNode], map }; } @@ -439,6 +453,7 @@ function buildFileTree(rootLabel, items, folders) { } }); }); + sortTree(rootNode); return { root: [rootNode], map }; }