From 134d306511e5d2a2f36f0ca641f0638d07428d1e Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Sun, 31 May 2026 20:24:37 -0700 Subject: [PATCH] Track-detail modal: click any download row for a rich, status-aware view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clicking a track row in the download modal now opens a polished detail modal (its own template, webui/track-detail-modal.html, included into index.html; behavior in static/track-detail.js): cover, title/artist/album, status badge, in-app play, source, quality, AcoustID verdict, file location, and the expected-vs-downloaded provenance — backed by /api/downloads/task//detail. It adapts by status: - completed -> play (library stream) + full provenance - quarantined-> reason + Listen (quarantine stream) + Accept & Import + Search - failed/not_found -> reason + Search This absorbs the standalone quarantine chooser, which is removed (its Listen/Accept/Search live here now, with the same Windows file-handle release before Accept and the thin-sidecar -> Recover-to-Staging fallback). Plain failed/not-found rows still go straight to the search modal; sync-import modal unaffected. Status cells clear their clickable/detail state each render so a row that flips to completed isn't left with a stale handler. --- webui/index.html | 3 + webui/static/downloads.js | 176 ++++--------------------- webui/static/style.css | 94 ++++++++++++++ webui/static/track-detail.js | 233 ++++++++++++++++++++++++++++++++++ webui/track-detail-modal.html | 44 +++++++ 5 files changed, 401 insertions(+), 149 deletions(-) create mode 100644 webui/static/track-detail.js create mode 100644 webui/track-detail-modal.html diff --git a/webui/index.html b/webui/index.html index 92a982bd..d56533e0 100644 --- a/webui/index.html +++ b/webui/index.html @@ -8012,6 +8012,7 @@ + @@ -8045,6 +8046,8 @@
+ {% include 'track-detail-modal.html' %} +
diff --git a/webui/static/downloads.js b/webui/static/downloads.js index 98ac7bbd..70091e06 100644 --- a/webui/static/downloads.js +++ b/webui/static/downloads.js @@ -2982,21 +2982,17 @@ function _ensureCandidatesClickListener(statusEl) { statusEl.addEventListener('click', function (e) { e.stopPropagation(); _hideErrorTooltip(); - // Single click handler routes by dataset set at render time. A - // quarantined task opens the chooser; everything else opens the search - // modal. Deciding at click-time (not bind-time) means a task that fails - // first and only quarantines on a later retry can't end up double-bound. - if (this.dataset.quarantineEntryId) { - showQuarantineChooser({ - entryId: this.dataset.quarantineEntryId, - taskId: this.dataset.taskId, - reason: this.dataset.quarantineReason || '', - trackName: this.dataset.quarantineTrack || 'this track', - }); - return; - } const taskId = this.dataset.taskId; - if (taskId) showCandidatesModal(taskId); + if (!taskId) return; + // Decide at click-time from dataset set each render: completed and + // quarantined rows open the rich track-detail modal (it carries the + // play/listen + Accept/Search actions); plain failed/not-found go + // straight to the search modal. + if (this.dataset.detailOpen && typeof openTrackDetail === 'function') { + openTrackDetail(taskId); + } else { + showCandidatesModal(taskId); + } }); } @@ -3395,125 +3391,9 @@ async function approveQuarantineFromDownloadRow(button) { } } -// ── Quarantine chooser (download-modal status click) ────────────────────── -// Clicking a 🛡️ Quarantined status opens this instead of the search modal: -// listen to the file, accept & import it (bypassing the failed check), or fall -// back to searching for a different result. (Routing is handled inside -// _ensureCandidatesClickListener so a single listener covers both cases.) - -// Stop and unload the chooser's