From d810e99a5b8c14dbfd81d2aaa110257796cf6990 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sun, 14 Jun 2026 09:08:20 +0200 Subject: [PATCH] fix: improve search clearing and bump version to 0.3.53 Make `handleClearSearch` async and reset navigation to the root container. Explicitly clear the search input across menu clear, server switch, and disconnect transitions to ensure consistent UI synchronization and prevent stale queries. Also bump the project version from 0.3.52 to 0.3.53 in Cargo.toml and version.txt. --- Cargo.lock | 2 +- PMOMusic/Cargo.toml | 2 +- .../src/components/unified/ServerDrawer.vue | 17 ++++++++++++++++- version.txt | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c5bde027..07045773 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "PMOMusic" -version = "0.3.52" +version = "0.3.53" dependencies = [ "axum 0.8.7", "console-subscriber", diff --git a/PMOMusic/Cargo.toml b/PMOMusic/Cargo.toml index efbbf138..66ceb604 100644 --- a/PMOMusic/Cargo.toml +++ b/PMOMusic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "PMOMusic" -version = "0.3.52" +version = "0.3.53" edition = "2024" [dependencies] diff --git a/pmoapp/webapp/src/components/unified/ServerDrawer.vue b/pmoapp/webapp/src/components/unified/ServerDrawer.vue index 6b06ce13..587b76c1 100644 --- a/pmoapp/webapp/src/components/unified/ServerDrawer.vue +++ b/pmoapp/webapp/src/components/unified/ServerDrawer.vue @@ -66,8 +66,20 @@ async function handleSearch() { } } -function handleClearSearch() { +async function handleClearSearch() { searchInput.value = ''; + if (!currentServer.value) return; + + isLoading.value = true; + try { + await browseContainer(currentServer.value.id, "0"); + currentContainerId.value = "0"; + setPath([{ id: "0", title: currentServer.value.friendly_name }]); + } catch (error) { + console.error("[ServerDrawer] Erreur navigation racine après clear search:", error); + } finally { + isLoading.value = false; + } } const { playContent, addToQueue, addAfterCurrent, attachAndPlayPlaylist } = @@ -175,6 +187,7 @@ watch( clearPath(); closeMenu(); imageStates.clear(); + searchInput.value = ''; } }, ); @@ -225,6 +238,7 @@ async function handleServerClick(server: MediaServerSummary) { // Commencer la navigation dans ce serveur currentServer.value = server; + searchInput.value = ''; isLoading.value = true; try { @@ -244,6 +258,7 @@ function goBack() { currentServer.value = null; currentContainerId.value = null; clearPath(); + searchInput.value = ''; } async function handleContainerClick(item: ContainerEntry) { diff --git a/version.txt b/version.txt index d57e08b5..db7aded3 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.3.52 +0.3.53