Compare commits

..

2 Commits

Author SHA1 Message Date
librelad
cf80d48126 Merge claude/2 2026-06-22 14:57:06 +01:00
librelad
85e5920afe fix(webui/apps): app-detail tab clicks no longer snap back to config
showAppDetail() derived the target tab from the legacy ?tab= query
(searchParams.get('tab')), but the app is path-based now
(/app/<name>/<tab>), so that read was always null and defaulted to
'config'. Since loadTabContent() calls showAppDetail() on every switch,
clicking any non-config tab (services/backups/updater/tasks) immediately
rewrote the URL back to /app/<name> and rendered config.

Read the current main tab off the path via appPartsFromPath, honouring
it only when already on this app; cross-app/cold nav still starts at
config. The legacy ?tab= shape is already normalised to the path by the
SPA's handleAppDetail before this runs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-06-22 14:57:06 +01:00

View File

@ -369,9 +369,17 @@ class AppsManager {
// Force config tab for install/manage buttons
targetTab = 'config';
} else {
// Preserve existing tab or default to config for direct navigation
const currentUrl = new URL(window.location.href);
targetTab = currentUrl.searchParams.get('tab') || 'config';
// Preserve the existing main tab, defaulting to config for direct
// navigation. The app is path-based now (/app/<name>/<tab>), so the tab
// lives in the PATH — the old searchParams.get('tab') read the dead ?tab=
// query, was always null, and snapped every non-config tab back to config
// (loadTabContent calls showAppDetail on every switch). Read it off the
// path, and only honour it when we're already on THIS app — a cross-app
// switch or cold nav starts at config.
const parts = window.appPartsFromPath
? window.appPartsFromPath(window.location.pathname)
: { app: '', tab: 'config' };
targetTab = (parts.app === appName && parts.tab) ? parts.tab : 'config';
}
// Preserve the config sub-category (/app/<name>/config/<sub>) when the URL