navidrome/ui/src/common
Deluan Quintão f08b5297ee
feat(ui): add Refresh Metadata to the album and artist context menus (#6036)
* refactor(artwork): move artworkItemName into core/artwork as ItemName

* feat(external): add RefreshInfo to force an external info refresh

RefreshInfo re-fetches and re-saves external info for one artist or
album, bypassing the TTL check that UpdateArtistInfo/UpdateAlbumInfo
use. It is synchronous; callers that must not block detach it themselves.

Also makes MockArtistRepo/MockAlbumRepo.UpdateExternalInfo persist to
Data (previously a no-op) and adds the new method to the e2e noopProvider,
both required so the interface addition compiles and is observable in tests.

* feat(external): broadcast RefreshResource after external info is saved

populateArtistInfo and populateAlbumInfo now emit the same RefreshResource
event the artwork worker uses, so the UI learns about both foreground and
background metadata refreshes.

* feat(nativeapi): replace artwork refresh endpoint with metadata refresh

* feat(ui): add refreshMetadata to the data provider

* feat(ui): add a Refresh Metadata item to the album and artist context menus

* fix(ui): re-fetch artist info when the record is refreshed

* test: fix mislabeled spec, add kind-gate negative case, guard nil mock maps

- Rename the RefreshInfo spec that claimed to cover the save-failure/broadcast
  path: SetError(true) fails Get too, so it only proves RefreshInfo bails out
  early at getArtist.
- Add a spec proving playlist refreshes skip the external-info step, since
  that asymmetry (al/ar only) was documented but unasserted.
- Add lazy nil-map init to MockAlbumRepo/MockArtistRepo.UpdateExternalInfo so
  a composite-literal-constructed mock doesn't panic on first save.

* test: relocate discArtworkName specs from cmd to core/artwork

artworkItemName moved into core/artwork as ItemName in an earlier commit, but
its disc-name specs stayed behind in cmd/artwork_test.go, reaching across
packages. Move them to core/artwork/item_name_test.go where the code now lives.

* fix(ui): shape refreshMetadata like a react-admin response

react-admin validates custom dataProvider methods and rejects any response
without a `data` key, so the raw httpClient promise made every click surface
an error toast instead of the success message. The unit test mocked
useDataProvider, which skips that validation.

Also folds "which kinds have external info" into external.HasInfo so the
handler stops restating it, drops the nil-broker guard that only existed for
tests, and delegates the mocks' UpdateExternalInfo to Put.

* refactor(external): unexport infoKinds

Only HasInfo is used outside the package, so the slice itself does not need
to be exported.

* refactor(artwork): fold ItemName into housekeeping.go next to Refresh

ItemName exists to guard Refresh from ids that would orphan a queue row, and
both callers invoke them back to back. A separate file hid that pairing; it was
only split out to keep the move out of cmd/ legible in review.

* fix(nativeapi): return 500 when the refresh lookup fails for a non-ErrNotFound reason

A transient repository error told the admin the id did not exist, and the error
was dropped without a log line, so nothing pointed at the real cause.

Also drops the inherited claim that clearing artwork state shows a placeholder.
Reads fall back to local resolution, so that only holds when there is no local art.

* fix(ui): move Refresh Metadata above Get Info in the context menu

Menu order follows key insertion order in the options object, so the new spec
pins the position rather than leaving it to be shuffled by the next addition.
2026-08-25 23:59:40 -04:00
..
AddToPlaylistButton.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
artist.js feat(artist): add Share and Download actions to the Artist detail page (#5944) 2026-08-12 11:59:56 -04:00
artist.test.js feat(artist): add Share and Download actions to the Artist detail page (#5944) 2026-08-12 11:59:56 -04:00
ArtistLinkField.jsx fix(ui): restore each page's scroll position when navigating back (#5892) 2026-08-04 22:07:16 -04:00
ArtistLinkField.test.jsx feat(server): custom ArtistJoiner config (#3873) 2025-03-23 10:53:21 -04:00
Artwork.jsx feat(artwork): new artwork pipeline with background resolution and Low Quality Image Placeholders (#5847) 2026-08-09 15:03:27 -04:00
Artwork.test.jsx feat(artwork): new artwork pipeline with background resolution and Low Quality Image Placeholders (#5847) 2026-08-09 15:03:27 -04:00
ArtworkAvatar.jsx feat(artwork): new artwork pipeline with background resolution and Low Quality Image Placeholders (#5847) 2026-08-09 15:03:27 -04:00
BatchPlayButton.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
BatchShareButton.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
BitrateField.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
CollapsibleComment.jsx feat(ui) add Save Queue to Playlist (#4110) 2025-05-23 22:04:18 -04:00
ContextMenus.jsx feat(ui): add Refresh Metadata to the album and artist context menus (#6036) 2026-08-25 23:59:40 -04:00
ContextMenus.test.jsx feat(ui): add Refresh Metadata to the album and artist context menus (#6036) 2026-08-25 23:59:40 -04:00
DateField.jsx feat: add Rated At field - #4653 (#4660) 2025-11-24 23:18:05 -05:00
DocLink.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
DurationField.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
formatRange.js build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
ImageUploadOverlay.jsx refactor: rename EnableCoverArtUpload to EnableArtworkUpload 2026-03-27 19:33:46 -04:00
index.js feat(artist): add Share and Download actions to the Artist detail page (#5944) 2026-08-12 11:59:56 -04:00
LibrarySelector.jsx feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
LibrarySelector.test.jsx feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
Linkify.jsx Merge commit from fork 2026-02-03 12:22:57 -05:00
Linkify.test.jsx chore(deps): update all dependencies (#4618) 2025-10-25 17:05:16 -04:00
List.jsx feat(ui): remember 'items per page' selection across sessions (#5819) 2026-07-19 18:59:37 -04:00
List.test.jsx feat(ui): remember 'items per page' selection across sessions (#5819) 2026-07-19 18:59:37 -04:00
LoveButton.jsx fix(ui): UI issues & styling coherence (#4910) 2026-01-20 12:45:33 -05:00
MultiLineTextField.jsx chore: format JSX components 2026-02-03 12:46:39 -05:00
OverflowTooltip.jsx feat(ui): add tooltips for long playlist and album names - 5068 (#5070) 2026-03-15 14:55:55 -04:00
Pagination.jsx feat(ui): remember 'items per page' selection across sessions (#5819) 2026-07-19 18:59:37 -04:00
Pagination.test.jsx feat(ui): remember 'items per page' selection across sessions (#5819) 2026-07-19 18:59:37 -04:00
ParticipantsInfo.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
PathField.jsx feat(ui): hide absolute paths from regular users 2025-03-25 20:05:24 -04:00
PathField.test.jsx feat(ui): hide absolute paths from regular users 2025-03-25 20:05:24 -04:00
perPageStore.js feat(ui): remember 'items per page' selection across sessions (#5819) 2026-07-19 18:59:37 -04:00
perPageStore.test.js feat(ui): remember 'items per page' selection across sessions (#5819) 2026-07-19 18:59:37 -04:00
playbackActions.js feat: add similar songs functionality in agents, and Instant Mix (song-based) to UI (#4919) 2026-01-25 16:16:43 -05:00
PlayButton.jsx fix(ui): always order album tracks by disc and track number (fixes #3720) (#3975) 2025-04-17 19:23:53 -04:00
playlistUtils.js fix(playlist): block track edits on synced playlists across all APIs (#5984) 2026-08-19 08:47:53 -04:00
playlistUtils.test.js fix(playlist): block track edits on synced playlists across all APIs (#5984) 2026-08-19 08:47:53 -04:00
QualityInfo.jsx feat(ui): integrate transcode decision into web player (#5155) 2026-03-09 11:06:31 -04:00
QualityInfo.test.jsx feat(ui): integrate transcode decision into web player (#5155) 2026-03-09 11:06:31 -04:00
QuickFilter.jsx fix(ui): fix make dev (#3795) 2025-03-10 14:50:16 -04:00
QuickFilter.test.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
RangeField.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
RatingField.jsx feat: add Rated At field - #4653 (#4660) 2025-11-24 23:18:05 -05:00
SafeHTML.jsx fix(ui): use div for fragment, check lastfm url for artist page (#4980) 2026-02-04 17:34:26 -05:00
sanitizeFieldRestProps.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
SelectLibraryInput.jsx feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
SelectLibraryInput.test.jsx feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
ShuffleAllButton.jsx fix(ui): skip missing files in bulk operations (#3807) 2025-03-11 20:19:46 -04:00
SimpleList.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
SizeField.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
SongBulkActions.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
SongContextMenu.jsx fix(ui): disable shuffle for instant mix playback 2026-01-29 17:04:10 -05:00
SongContextMenu.test.jsx feat: add similar songs functionality in agents, and Instant Mix (song-based) to UI (#4919) 2026-01-25 16:16:43 -05:00
SongDatagrid.jsx fix(ui): don't start playback when closing the disc cover lightbox (#5901) 2026-08-07 09:36:52 -04:00
SongDatagrid.test.jsx fix(ui): don't start playback when closing the disc cover lightbox (#5901) 2026-08-07 09:36:52 -04:00
SongInfo.jsx feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
SongSimpleList.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
SongTitleField.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
ThumbHashCanvas.jsx feat(artwork): new artwork pipeline with background resolution and Low Quality Image Placeholders (#5847) 2026-08-09 15:03:27 -04:00
ThumbHashCanvas.test.jsx feat(artwork): new artwork pipeline with background resolution and Low Quality Image Placeholders (#5847) 2026-08-09 15:03:27 -04:00
Title.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
ToggleFieldsMenu.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
useAlbumsPerPage.jsx feat(ui): remember 'items per page' selection across sessions (#5819) 2026-07-19 18:59:37 -04:00
useAlbumsPerPage.test.jsx feat(ui): remember 'items per page' selection across sessions (#5819) 2026-07-19 18:59:37 -04:00
useGetHandleArtistClick.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
useImageLoadingState.js feat(ui): add cover art support for internet radio stations (#5229) 2026-03-18 18:57:33 -04:00
useImageUrl.js feat(artwork): new artwork pipeline with background resolution and Low Quality Image Placeholders (#5847) 2026-08-09 15:03:27 -04:00
useImageUrl.test.js feat(artwork): new artwork pipeline with background resolution and Low Quality Image Placeholders (#5847) 2026-08-09 15:03:27 -04:00
useInterval.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
useLibrarySelection.js feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
useLibrarySelection.test.js feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
useRating.jsx feat(ui): add song Love and Rating functionality to playlist view (#4134) 2025-06-04 20:38:28 -04:00
useRating.test.js feat(ui): add song Love and Rating functionality to playlist view (#4134) 2025-06-04 20:38:28 -04:00
useRefreshOnEvents.jsx feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
useRefreshOnEvents.test.js feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
useResourceRefresh.jsx feat(artwork): new artwork pipeline with background resolution and Low Quality Image Placeholders (#5847) 2026-08-09 15:03:27 -04:00
useResourceRefresh.test.js feat(artwork): new artwork pipeline with background resolution and Low Quality Image Placeholders (#5847) 2026-08-09 15:03:27 -04:00
useScrollRestoration.jsx fix(ui): restore each page's scroll position when navigating back (#5892) 2026-08-04 22:07:16 -04:00
useScrollRestoration.test.jsx fix(ui): restore each page's scroll position when navigating back (#5892) 2026-08-04 22:07:16 -04:00
useSearchRefocus.js fix(ui): Search focus after clear (#4932) 2026-02-21 14:39:38 -05:00
useSearchRefocus.test.js fix(ui): Search focus after clear (#4932) 2026-02-21 14:39:38 -05:00
useSelectedFields.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
useToggleLove.jsx feat(ui): add song Love and Rating functionality to playlist view (#4134) 2025-06-04 20:38:28 -04:00
useToggleLove.test.js feat(ui): add song Love and Rating functionality to playlist view (#4134) 2025-06-04 20:38:28 -04:00
useTraceUpdate.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00
Writable.jsx build(ui): migrate from CRA/Jest to Vite/Vitest (#3311) 2024-09-28 11:54:36 -04:00