navidrome/ui/src/dialogs
Deluan Quintão 752b38609c
feat(artist): add Share and Download actions to the Artist detail page (#5944)
* feat(ui): add Share button to artist detail page

* feat(ui): add Download button to artist detail page

* fix(ui): scope artist share/download to album-artist content

Gate the artist Share/Download actions on album-artist stats and show the
album-artist size, since ZipArtist and the share query only cover
album_artist_id songs. Previously the total (role-inclusive) size was shown
and guest-only artists could produce an empty archive. Applies to the artist
toolbar, the shared context menu, and the download dialog title.

* fix: match artist download/share to album-artist participation

ZipArtist and the artist share query filtered the deprecated album_artist_id
column, which only stores the first album artist of a track. Secondary
album-artists (co-credited but not first) got an empty download/share even
though the UI offered it. Filter by the album-artist role participation
instead, matching the artist's album-artist stats used to gate the actions.
Also cover the artist-specific size branch of the download dialog.

* fix(share): scope artist shares to the owner's libraries

The artist share query broadened to album-artist participation, which could
pull a secondary album artist's tracks from libraries the (non-admin) share
owner cannot access into the public share. Load the artist share as the owner
so their library access is applied, mirroring how playlist shares already work.
Adds a repository test covering co-album-artist inclusion and library scoping.

* test(share): assert album participation branch of artist shares

Link the co-album-artist fixtures to albums and assert share.Albums (used by
Subsonic getShares) includes the accessible album and excludes the one in a
library the owner cannot access, so the album participation + scoping branch
is covered too.

* fix: exclude missing files from artist download/share actions

An artist's stats still count files that went missing, so the toolbar/context
menu could offer Download/Share for an artist whose files are all gone, while
the share query (missing=false) returns nothing and downloads open dead paths.
Hide the actions when the artist is missing and exclude missing files from
ZipArtist, matching the share semantics.

* refactor: dedupe artist download-size and share-owner lookups

Extract the 'album-artist download size (or none when missing)' rule into a
single artistDownloadSize() helper shared by the toolbar, context menu, and
download dialog, and factor the duplicated share-owner context lookup into a
shareRepository.ownerContext() method used by both the artist and playlist
share cases.

* refactor(ui): move artistDownloadSize helper to common

utils is for domain-agnostic, potentially portable code; this helper is
Navidrome-specific (artist stats shape), so it belongs in common. Consumers
import it directly from common/artist to avoid pulling in the common barrel.
2026-08-12 11:59:56 -04:00
..
AboutDialog.jsx feat(ui): add download config toml link, disable copy when clipboard not available (#5035) 2026-02-12 10:54:04 -05:00
AboutDialog.test.jsx feat(ui): make need for refresh more visible when upgrading server 2025-02-21 18:15:25 -05:00
aboutUtils.js refactor: simplify configuration endpoint with JSON serialization (#4159) 2025-05-31 19:37:23 -04:00
aboutUtils.test.js refactor: simplify configuration endpoint with JSON serialization (#4159) 2025-05-31 19:37:23 -04:00
AddToPlaylistDialog.jsx fix(ui): make the height of the AddToPlaylistDialog static. 2025-06-01 12:00:23 -04:00
AddToPlaylistDialog.test.jsx fix(ui): add button is covered when adding to a playlist (#4156) 2025-05-30 23:15:02 -04:00
DialogContent.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
Dialogs.jsx feat(ui) add Save Queue to Playlist (#4110) 2025-05-23 22:04:18 -04:00
DialogTitle.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
DownloadMenuDialog.jsx feat(artist): add Share and Download actions to the Artist detail page (#5944) 2026-08-12 11:59:56 -04:00
DownloadMenuDialog.test.jsx feat(artist): add Share and Download actions to the Artist detail page (#5944) 2026-08-12 11:59:56 -04:00
DuplicateSongDialog.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
ExpandInfoDialog.jsx feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
HelpDialog.jsx fix(ui): fix make dev (#3795) 2025-03-10 14:50:16 -04:00
index.js feat(ui) add Save Queue to Playlist (#4110) 2025-05-23 22:04:18 -04:00
ListenBrainzTokenDialog.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
SaveQueueDialog.jsx test(ui): fix warnings (#4187) 2025-06-07 23:11:13 -04:00
SaveQueueDialog.test.jsx feat(ui) add Save Queue to Playlist (#4110) 2025-05-23 22:04:18 -04:00
SelectPlaylistInput.jsx feat(plugins): add JSONForms-based plugin configuration UI (#4911) 2026-01-19 20:51:00 -05:00
SelectPlaylistInput.test.jsx refactor(ui): replace translation key with direct character for remove action 2025-07-12 16:55:21 -04:00
ShareDialog.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
useDialog.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
useTranscodingOptions.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00