From b78350a3e2e263aac8d8fdd46050e47885b1d334 Mon Sep 17 00:00:00 2001 From: Antti Kettunen Date: Sat, 16 May 2026 21:13:40 +0300 Subject: [PATCH] fix(webui): preserve import tab refresh URLs - stop the legacy shell bootstrap from collapsing /import/auto and /import/singles back to the import root on reload\n- update the shell route smoke test to expect the canonical /import/album redirect for the bare import page --- webui/static/search.js | 4 +--- webui/tests/shell-routes.smoke.spec.ts | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/webui/static/search.js b/webui/static/search.js index 7a2214fc..cd27d34e 100644 --- a/webui/static/search.js +++ b/webui/static/search.js @@ -1190,9 +1190,7 @@ async function loadInitialData() { if (route?.kind === 'react') { showReactHost(targetPage); setActivePageChrome(targetPage); - if (window.location.pathname !== route.path) { - history.replaceState({ page: targetPage }, '', route.path); - } + // Keep nested react-tab URLs like /import/auto or /import/singles intact. return; } diff --git a/webui/tests/shell-routes.smoke.spec.ts b/webui/tests/shell-routes.smoke.spec.ts index f2854c0c..818dd925 100644 --- a/webui/tests/shell-routes.smoke.spec.ts +++ b/webui/tests/shell-routes.smoke.spec.ts @@ -60,6 +60,10 @@ function expectedUrlPattern(path: string, pageId: ShellPageId): RegExp { return /\/stats(?:\?range=7d)?$/; } + if (pageId === 'import') { + return /\/import\/album$/; + } + return new RegExp(`${path.replace('/', '\\/')}$`); }