From 69a37e96b76731647b5257b8e684bb529540cc1b Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 5 Jun 2026 22:59:30 +0200 Subject: [PATCH] WebUI: restore Soulseek-only gating for the Quality Profile tile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reinstate the Soulseek dependency (quality profile only affects Soulseek downloads) that was dropped while fixing the empty-tile bug. Gate the whole collapsible tile (#quality-profile-tile) as a unit instead of the inner group, so it fully shows (Soulseek active + downloads tab) or fully hides — no empty expandable shell. switchSettingsTab runs updateDownloadSourceUI after the data-stg tab filter, so this gate is authoritative on tab switches. Co-Authored-By: Claude Opus 4.8 --- webui/static/settings.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/webui/static/settings.js b/webui/static/settings.js index de1bc575..09e72c3c 100644 --- a/webui/static/settings.js +++ b/webui/static/settings.js @@ -1713,13 +1713,17 @@ function updateDownloadSourceUI() { prowlarrRedirect.style.display = showProwlarr ? 'block' : 'none'; } - // Quality Profile tile visibility is handled entirely by the settings tab - // filter (data-stg="downloads" on #quality-profile-tile) — the same mechanism - // the Retry Logic tile uses. The old Soulseek-only JS gate fought the tab - // filter for control of `display` and, depending on activeSources/tab timing, - // left the tile either empty (when it gated the inner group) or fully hidden - // (when it gated the wrapper). Letting the tab filter own visibility makes it - // behave exactly like the working Retry Logic tile. + // Quality profile is Soulseek-only (it only affects Soulseek downloads) and + // downloads-tab-only. Gate the WHOLE collapsible tile (#quality-profile-tile + // = header + body) as a unit, so it either fully shows (Soulseek active) or + // fully hides — never an empty expandable shell (the earlier bug came from + // gating only the inner #quality-profile-section). + const qualityProfileTile = document.getElementById('quality-profile-tile'); + if (qualityProfileTile) { + const activeTab = document.querySelector('.stg-tab.active'); + const onDownloadsTab = activeTab && activeTab.dataset.tab === 'downloads'; + qualityProfileTile.style.display = (activeSources.has('soulseek') && onDownloadsTab) ? '' : 'none'; + } if (activeSources.has('tidal')) { checkTidalDownloadAuthStatus();