From f354fc5c71ddc8e74d1152112b99a297cba2a6ec Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Thu, 22 Jan 2026 00:32:18 +0000 Subject: [PATCH] Less aggressive automatic gallery mode switching, only when folder changes. Fixes issues with focus being lost from search. --- frontend/src/views/ExplorerView.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/ExplorerView.vue b/frontend/src/views/ExplorerView.vue index f455f26..73b99d0 100644 --- a/frontend/src/views/ExplorerView.vue +++ b/frontend/src/views/ExplorerView.vue @@ -73,7 +73,10 @@ watchEffect(() => { store.query = props.query }) -watch([() => props.path.join('/'), () => props.query], () => { +// Only auto-switch gallery mode when entering a new folder or on initial file list load +watch([() => props.path.join('/'), () => store.document.length], ([path, len], [oldPath, oldLen]) => { + // React to path change or initial document load (0 → non-zero) + if (path === oldPath && oldLen !== undefined && oldLen > 0) return store.prefs.gallery = documents.value.some(d => d.previewable) }, { immediate: true })