From 538bb9344b34911496fcf681cd719f6684f4e1a5 Mon Sep 17 00:00:00 2001 From: Antti Kettunen Date: Sat, 2 May 2026 17:08:00 +0300 Subject: [PATCH] Add workflow actions bridge to shell - Expose SoulSyncWorkflowActions from the shell bridge - Route album download and wishlist actions to the legacy modal helpers - Fall back to showToast for workflow notifications - Unblock the issue modal download button by wiring the real host contract --- webui/static/shell-bridge.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/webui/static/shell-bridge.js b/webui/static/shell-bridge.js index cc92dcd7..db4368de 100644 --- a/webui/static/shell-bridge.js +++ b/webui/static/shell-bridge.js @@ -66,6 +66,39 @@ function activateLegacyPath(pathname) { const SHELL_BRIDGE_READY_EVENT = 'ss:webui-shell-bridge-ready'; +function openDownloadMissingAlbumWorkflow(input) { + if (typeof openDownloadMissingModalForArtistAlbum !== 'function') { + throw new Error('Download workflow host is not ready yet'); + } + + return openDownloadMissingModalForArtistAlbum( + input.virtualPlaylistId, + input.playlistName, + input.tracks, + input.album, + input.artist, + false, + ); +} + +function openAddToWishlistAlbumWorkflow(input) { + if (typeof openAddToWishlistModal !== 'function') { + throw new Error('Wishlist workflow host is not ready yet'); + } + + return openAddToWishlistModal(input.album, input.artist, input.tracks, input.albumType); +} + +window.SoulSyncWorkflowActions = { + openDownloadMissingAlbum: openDownloadMissingAlbumWorkflow, + openAddToWishlistAlbum: openAddToWishlistAlbumWorkflow, + notify(message, type) { + if (typeof showToast === 'function') { + showToast(message, type); + } + }, +}; + window.SoulSyncWebShellBridge = { getCurrentPageId() { return currentPage || getWebRouter()?.resolvePageId?.(window.location.pathname) || _getPageFromPath();