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
pull/388/head
Antti Kettunen 2 weeks ago
parent f176ba1eb0
commit 538bb9344b
No known key found for this signature in database
GPG Key ID: C6B2A3D250359BD7

@ -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();

Loading…
Cancel
Save