Better UI feedback on search order changes.

This commit is contained in:
Leo Vasanko
2026-02-01 05:48:15 +00:00
parent b1fae56c86
commit e8517c75e2
2 changed files with 15 additions and 5 deletions
-3
View File
@@ -394,9 +394,6 @@ tbody tr.cursor {
.sortcolumn:hover { .sortcolumn:hover {
cursor: pointer; cursor: pointer;
} }
.sortcolumn:hover::after {
color: var(--accent-color);
}
.sortcolumn { .sortcolumn {
padding-right: 1.5rem; padding-right: 1.5rem;
} }
+15 -2
View File
@@ -229,12 +229,25 @@ export const useMainStore = defineStore('main', {
resumeWatching() resumeWatching()
}, },
toggleSort(name: SortOrder) { toggleSort(name: SortOrder) {
if (this.query) this.prefs.sortFiltered = this.prefs.sortFiltered === name ? '' : name const current = this.query ? this.prefs.sortFiltered : this.prefs.sortListing
else this.prefs.sortListing = this.prefs.sortListing === name ? '' : name const newOrder = current === name ? '' : name
if (this.query) this.prefs.sortFiltered = newOrder
else this.prefs.sortListing = newOrder
this.showSortToast(newOrder)
}, },
sort(name: SortOrder | '') { sort(name: SortOrder | '') {
if (this.query) this.prefs.sortFiltered = name if (this.query) this.prefs.sortFiltered = name
else this.prefs.sortListing = name else this.prefs.sortListing = name
this.showSortToast(name)
},
showSortToast(order: SortOrder | '') {
const labels: Record<string, string> = {
'': 'Folders first',
'name': 'Alphabetical order',
'modified': 'Newest first',
'size': 'Largest first',
}
this.showToast(labels[order] || order, 1200)
}, },
focusBreadcrumb() { focusBreadcrumb() {
(document.querySelector('.breadcrumb') as HTMLAnchorElement).focus() (document.querySelector('.breadcrumb') as HTMLAnchorElement).focus()