From 4ae74343d79908ca1c7e4c47fb1f15c1f665f655 Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Sat, 4 Oct 2025 01:45:29 -0600 Subject: [PATCH 1/2] Sort assembly trees alphabetically --- Data/Server/WebUI/src/Assemblies/Assembly_List.jsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx b/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx index d180de0..bd91fa5 100644 --- a/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx +++ b/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx @@ -60,6 +60,16 @@ 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) => + 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 +117,7 @@ function buildWorkflowTree(workflows, folders) { } }); }); + sortTree(rootNode); return { root: [rootNode], map }; } @@ -439,6 +450,7 @@ function buildFileTree(rootLabel, items, folders) { } }); }); + sortTree(rootNode); return { root: [rootNode], map }; } From 87dee574e16045c39413c99964efdcab48ac0243 Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Sat, 4 Oct 2025 01:49:31 -0600 Subject: [PATCH 2/2] Keep folders at top when sorting assemblies --- Data/Server/WebUI/src/Assemblies/Assembly_List.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx b/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx index bd91fa5..5f5fc1d 100644 --- a/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx +++ b/Data/Server/WebUI/src/Assemblies/Assembly_List.jsx @@ -62,11 +62,14 @@ 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) => - String(a.label || "").localeCompare(String(b.label || ""), undefined, { + 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); };