From a95cf7be94d657593b5c0001c4a0c14584383834 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sun, 1 Feb 2026 05:48:15 +0000 Subject: [PATCH] Better UI feedback on search order changes. --- frontend/src/components/FileExplorer.vue | 3 --- frontend/src/stores/main.ts | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/FileExplorer.vue b/frontend/src/components/FileExplorer.vue index 45b8263..3cf0142 100644 --- a/frontend/src/components/FileExplorer.vue +++ b/frontend/src/components/FileExplorer.vue @@ -394,9 +394,6 @@ tbody tr.cursor { .sortcolumn:hover { cursor: pointer; } -.sortcolumn:hover::after { - color: var(--accent-color); -} .sortcolumn { padding-right: 1.5rem; } diff --git a/frontend/src/stores/main.ts b/frontend/src/stores/main.ts index a2ba42d..7b08145 100644 --- a/frontend/src/stores/main.ts +++ b/frontend/src/stores/main.ts @@ -229,12 +229,25 @@ export const useMainStore = defineStore('main', { resumeWatching() }, toggleSort(name: SortOrder) { - if (this.query) this.prefs.sortFiltered = this.prefs.sortFiltered === name ? '' : name - else this.prefs.sortListing = this.prefs.sortListing === name ? '' : name + const current = this.query ? this.prefs.sortFiltered : this.prefs.sortListing + const newOrder = current === name ? '' : name + if (this.query) this.prefs.sortFiltered = newOrder + else this.prefs.sortListing = newOrder + this.showSortToast(newOrder) }, sort(name: SortOrder | '') { if (this.query) this.prefs.sortFiltered = name else this.prefs.sortListing = name + this.showSortToast(name) + }, + showSortToast(order: SortOrder | '') { + const labels: Record = { + '': 'Folders first', + 'name': 'Alphabetical order', + 'modified': 'Newest first', + 'size': 'Largest first', + } + this.showToast(labels[order] || order, 1200) }, focusBreadcrumb() { (document.querySelector('.breadcrumb') as HTMLAnchorElement).focus()