From 902eb38fb8f9500ad70715e84e02e16c76744c65 Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Sun, 7 Jun 2026 23:53:18 -0700 Subject: [PATCH] Downloads: fix collapsed-batch overflow (#814) + Retry Failed result feedback (#815) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #814 — the collapsed Batches rail (44px) hid .adl-batch-active and .adl-batch-history-section but NOT the JS-rendered .adl-batch-summary line ("N batches · M downloading · …"), so it overflowed as clipped text. Added it to the collapsed hide rule. #815 — "Retry Failed" only toasted "Retrying N…" at the start and a generic "Discovery complete!" at the end, with no sense of how many of the retried tracks actually progressed. retryFailedMirroredDiscovery now stamps a baseline (matches-before + retry count) on the state, and a shared completion toast reports "Retry complete: X of N newly found[, Y still not found]" instead of the generic message. Normal (non-retry) discovery still shows "Discovery complete!". JS syntax clean, 70 script-split/style tests pass. --- webui/static/stats-automations.js | 6 ++++++ webui/static/style.css | 6 +++++- webui/static/sync-services.js | 22 ++++++++++++++++++++-- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/webui/static/stats-automations.js b/webui/static/stats-automations.js index 01aab02a..68e1adea 100644 --- a/webui/static/stats-automations.js +++ b/webui/static/stats-automations.js @@ -1678,6 +1678,12 @@ async function retryFailedMirroredDiscovery(urlHash) { state.phase = 'discovering'; state.status = 'discovering'; state.discovery_progress = 0; + // #815: stamp a baseline so the completion toast can report how many + // of these retried tracks were newly found (not just overall matched). + state._retryDiscovery = { + matchesBefore: state.spotify_matches || 0, + retryCount: data.retry_count, + }; } // Update modal buttons to show discovering state diff --git a/webui/static/style.css b/webui/static/style.css index f6a2452e..b78855dc 100644 --- a/webui/static/style.css +++ b/webui/static/style.css @@ -59389,7 +59389,11 @@ body.reduce-effects #page-particles-canvas { } .adl-batch-panel.collapsed .adl-batch-active, -.adl-batch-panel.collapsed .adl-batch-history-section { +.adl-batch-panel.collapsed .adl-batch-history-section, +/* The active-batches summary line ("N batches · M downloading · …") is shown + via JS and was NOT hidden on collapse, so it overflowed the 44px rail as + clipped text (#814). Hide it with the rest of the panel body. */ +.adl-batch-panel.collapsed .adl-batch-summary { display: none; } diff --git a/webui/static/sync-services.js b/webui/static/sync-services.js index 69dd0cef..f375bdd3 100644 --- a/webui/static/sync-services.js +++ b/webui/static/sync-services.js @@ -9248,6 +9248,24 @@ async function startYouTubeDiscovery(urlHash) { } } +// Discovery-complete toast. For a "Retry Failed" run (#815) it reports how many +// of the retried tracks were newly found this attempt, instead of the generic +// message — the baseline is stamped on the state by retryFailedMirroredDiscovery. +function _discoveryCompleteToast(urlHash) { + const st = youtubePlaylistStates[urlHash]; + const retry = st && st._retryDiscovery; + if (retry) { + const found = Math.max(0, (st.spotify_matches || 0) - (retry.matchesBefore || 0)); + const stillFailed = Math.max(0, (retry.retryCount || 0) - found); + delete st._retryDiscovery; + let msg = `Retry complete: ${found} of ${retry.retryCount} newly found`; + if (stillFailed > 0) msg += `, ${stillFailed} still not found`; + showToast(msg, found > 0 ? 'success' : 'info'); + return; + } + showToast('Discovery complete!', 'success'); +} + function startYouTubeDiscoveryPolling(urlHash) { // Stop any existing polling if (activeYouTubePollers[urlHash]) { @@ -9274,7 +9292,7 @@ function startYouTubeDiscoveryPolling(urlHash) { if (st) st.phase = 'discovered'; updateYouTubeCardPhase(urlHash, 'discovered'); updateYouTubeModalButtons(urlHash, 'discovered'); - showToast('Discovery complete!', 'success'); + _discoveryCompleteToast(urlHash); } }; } @@ -9322,7 +9340,7 @@ function startYouTubeDiscoveryPolling(urlHash) { updateYouTubeModalButtons(urlHash, 'discovered'); console.log('✅ Discovery complete:', urlHash); - showToast('Discovery complete!', 'success'); + _discoveryCompleteToast(urlHash); } } catch (error) {