From b344303f75f2cd6f0453a8a09e11005f1632288d Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Tue, 16 Jun 2026 09:29:31 -0700 Subject: [PATCH] Watchlist eye: confirm before removing (the standard yes/no dialog) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The eye is small/easy to mis-click and the card vanishes on the watchlist page, so removal now goes through the shared showConfirmDialog (core.js) — 'Remove "" from your watchlist?' — before un-following. Adding stays one-click instant. Cancelling re-enables the button with no change. --- webui/static/video/video-watchlist-btn.js | 29 ++++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/webui/static/video/video-watchlist-btn.js b/webui/static/video/video-watchlist-btn.js index 2ff07aba..a6c9a4de 100644 --- a/webui/static/video/video-watchlist-btn.js +++ b/webui/static/video/video-watchlist-btn.js @@ -73,12 +73,29 @@ b.disabled = true; var done = function () { b.disabled = false; }; if (on) { - fetch('/api/video/watchlist/remove', { - method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ kind: kind, tmdb_id: Number(id) }) - }).then(function (r) { return r.json(); }).then(function (d) { - if (d && d.success) { syncAll(kind, id, false); toast('Removed from watchlist', 'info'); } - }).catch(function () { toast('Watchlist update failed', 'error'); }).then(done); + // Removal is confirmed (the standard music yes/no dialog) — the eye is + // small + easy to mis-click and the card vanishes on the watchlist + // page. Adding stays instant. + var name = b.getAttribute('data-vwl-title') || ''; + var label = name ? '“' + name + '”' : (kind === 'person' ? 'this person' : 'this show'); + var doRemove = function () { + fetch('/api/video/watchlist/remove', { + method: 'POST', headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ kind: kind, tmdb_id: Number(id) }) + }).then(function (r) { return r.json(); }).then(function (d) { + if (d && d.success) { syncAll(kind, id, false); toast('Removed from watchlist', 'info'); } + }).catch(function () { toast('Watchlist update failed', 'error'); }).then(done); + }; + var confirm = (typeof showConfirmDialog === 'function') + ? showConfirmDialog({ + title: 'Remove from Watchlist', + message: 'Remove ' + label + ' from your watchlist?', + confirmText: 'Remove', cancelText: 'Cancel', destructive: true }) + : Promise.resolve(true); + Promise.resolve(confirm).then(function (ok) { + if (ok) doRemove(); + else done(); // cancelled — re-enable, no change + }); } else { var body = { kind: kind, tmdb_id: Number(id),