mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-10-26 17:41:58 -06:00
Keep folders at top when sorting assemblies
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user