From 9264008766e571ee918788a522c81146a56acccb Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Sun, 5 Jan 2025 20:27:20 +0100 Subject: [PATCH] Folders should not be sorted in the char list - Folders respect the chosen sorting of the "Tag Management" - They will still always be displayed on top - They will now not follow any chosen list sorting, so do not get changed based on alphabetical sorting of the char list --- public/scripts/power-user.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index bfc6f4741..1e69d3608 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -2094,12 +2094,10 @@ export function sortEntitiesList(entities, forceSearch, filterHelper = null) { } entities.sort((a, b) => { - // Sort tags/folders will always be at the top - if (a.type === 'tag' && b.type !== 'tag') { - return -1; - } - if (a.type !== 'tag' && b.type === 'tag') { - return 1; + // Sort tags/folders will always be at the top. Their original sorting will be kept, to respect manual tag sorting. + if (a.type === 'tag' || b.type === 'tag') { + // The one that is a tag will be at the top + return (a.type === 'tag' ? -1 : 1) - (b.type === 'tag' ? -1 : 1); } // If we have search sorting, we take scores and use those