Cleaner folder headers in gallery mode search results. Multi folder results are always grouped by folder (FileExplorer and Gallery), but still otherwise respecting the chosen sort order. Overall this produces a much cleaner layout.

This commit is contained in:
2026-01-22 00:23:23 +00:00
parent 2cc92cd786
commit 5bda809921
3 changed files with 73 additions and 18 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ import { watchEffect, ref, computed, watch } from 'vue'
import { useMainStore } from '@/stores/main'
import Router from '@/router/index'
import { needleFormat, localeIncludes, collator } from '@/utils'
import { sorted } from '@/utils/docsort'
import { sorted, sortedGrouped } from '@/utils/docsort'
import FileExplorer from '@/components/FileExplorer.vue'
const store = useMainStore()
@@ -49,9 +49,9 @@ const documents = computed(() => {
}
}
const locsub = loc + '/'
// Custom sort override in effect?
// Custom sort override in effect? Use grouped sorting to keep folders together
const order = store.prefs.sortFiltered
if (order) return sorted(docs, order)
if (order) return sortedGrouped(docs, order)
// Sort by relevance - current folder, then subfolders, then others
docs.sort((a, b) => (
// @ts-ignore