From 14359a1f98b92f54664c2805a4f4504f2bcd9645 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Mon, 20 Apr 2026 23:51:17 -0700 Subject: [PATCH] Add confirmation dialog to Reorganize All and fix button style Shows standard SoulSync confirm dialog before bulk reorganize with album count and template preview. Button now uses enhanced-sync-btn class to match other artist header buttons. --- webui/static/script.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/webui/static/script.js b/webui/static/script.js index b69ab87d..4fe98c47 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -46453,7 +46453,7 @@ function renderArtistMetaPanel(artist) { headerRight.appendChild(syncBtn); const reorgAllBtn = document.createElement('button'); - reorgAllBtn.className = 'enhanced-action-btn'; + reorgAllBtn.className = 'enhanced-sync-btn'; reorgAllBtn.innerHTML = '📁 Reorganize All'; reorgAllBtn.title = 'Reorganize all albums for this artist using path template'; reorgAllBtn.onclick = () => _showReorganizeAllModal(); @@ -50087,18 +50087,27 @@ async function _showReorganizeAllModal() { async function _executeReorganizeAll() { if (_reorganizeAllRunning) return; - _reorganizeAllRunning = true; const templateInput = document.getElementById('reorganize-template-input'); const template = templateInput ? templateInput.value.trim() : ''; if (!template) { showToast('Template cannot be empty', 'error'); - _reorganizeAllRunning = false; return; } const albums = artistDetailPageState.enhancedData.albums || []; const total = albums.length; + const artistName = artistDetailPageState.enhancedData.artist?.name || 'this artist'; + + const confirmed = await showConfirmDialog({ + title: 'Reorganize All Albums', + message: `This will reorganize ${total} album${total !== 1 ? 's' : ''} for ${artistName} using the template:\n\n${template}\n\nFiles will be moved and renamed. This cannot be undone.`, + confirmText: 'Reorganize All', + destructive: false, + }); + if (!confirmed) return; + + _reorganizeAllRunning = true; const applyBtn = document.getElementById('reorganize-apply-btn'); if (applyBtn) { applyBtn.disabled = true; applyBtn.textContent = 'Working...'; }