@behindthemusictree/app-kit-ui 33.0.0 → 33.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ import {
15
15
  TrackListSidebar,
16
16
  TrackPositionPlayPause,
17
17
  useGenrePlaylistPlayback
18
- } from "../chunk-GHFKICEB.js";
18
+ } from "../chunk-2M4Q2IJU.js";
19
19
  import "../chunk-DKQQLLMY.js";
20
20
  export {
21
21
  GenreDetailPanel,
package/dist/index.cjs CHANGED
@@ -1109,7 +1109,7 @@ function GenreSearch({
1109
1109
  onPick: handlePick,
1110
1110
  status,
1111
1111
  loading: loading ? "Searching\u2026" : void 0,
1112
- inputClassName: `h-[var(--layout-search-h,3rem)] ${onPrevious ? "pl-11" : "pl-6"} pr-20 text-base transition-[padding] duration-200 ease-out motion-reduce:transition-none bg-[var(--color-surface)] border-[var(--color-border)] rounded-full shadow-md`,
1112
+ inputClassName: `h-[var(--layout-search-h,3rem)] ${onPrevious ? "pl-11" : "pl-6"} pr-20 text-base transition-[padding] duration-200 ease-out motion-reduce:transition-none bg-[var(--color-surface)] border-[var(--color-border)] rounded-full shadow-md focus-visible:ring-0`,
1113
1113
  className: "genre-search-results z-40 rounded-xl shadow-md",
1114
1114
  listClassName: "max-h-[min(20rem,50dvh)]",
1115
1115
  optionClassName: "[@media(pointer:coarse)]:min-h-[var(--layout-touch-target)]"
@@ -1583,8 +1583,9 @@ function GenrePlaylistTracks({
1583
1583
  const trackNoun = (0, import_track_noun2.useTrackNoun)();
1584
1584
  const { uuid } = genrePlaylist;
1585
1585
  const { fetch } = (0, import_transport5.useFetchWrapper)(getBackendBaseUrl);
1586
+ const playback = (0, import_transport5.usePlaybackContext)();
1586
1587
  const { data, isPending, isError, refetch, hasNextPage, isFetchingNextPage, fetchNextPage } = (0, import_react_query.useInfiniteQuery)({
1587
- queryKey: scope === "me" ? import_genre_tree4.genrePlaylistQueryKeys.me.tracks(uuid) : artist ? [...import_genre_tree5.libraryQueryKeys.reference.songs.byGenre(getBackendBaseUrl(), genreUuid), "artist", artist.uuid] : import_genre_tree5.libraryQueryKeys.reference.songs.byGenre(getBackendBaseUrl(), genreUuid),
1588
+ queryKey: [...scope === "me" ? import_genre_tree4.genrePlaylistQueryKeys.me.tracks(uuid) : artist ? [...import_genre_tree5.libraryQueryKeys.reference.songs.byGenre(getBackendBaseUrl(), genreUuid), "artist", artist.uuid] : import_genre_tree5.libraryQueryKeys.reference.songs.byGenre(getBackendBaseUrl(), genreUuid), ...playback.key ? [playback.key] : []],
1588
1589
  queryFn: async ({ pageParam }) => {
1589
1590
  if (scope === "me") return fetchGenrePlaylistTracksPage(uuid, scope, Number(pageParam));
1590
1591
  const response = await fetch(
@@ -1599,7 +1600,7 @@ function GenrePlaylistTracks({
1599
1600
  },
1600
1601
  initialPageParam: scope === "me" ? 1 : "",
1601
1602
  getNextPageParam: (lastPage) => lastPage.nextPage ?? void 0,
1602
- enabled: scope !== "me" || sessionRestored && !!session?.accessToken
1603
+ enabled: playback.ready && (scope !== "me" || sessionRestored && !!session?.accessToken)
1603
1604
  });
1604
1605
  const [sentinel, setSentinel] = (0, import_react11.useState)(null);
1605
1606
  (0, import_react11.useEffect)(() => {
@@ -3668,7 +3669,7 @@ function PlayerPanel({
3668
3669
  renderArtistLink,
3669
3670
  renderSongLink
3670
3671
  }) {
3671
- const { playerTrackObject } = (0, import_player13.usePlayer)();
3672
+ const { playerTrackObject, retryPlayback } = (0, import_player13.usePlayer)();
3672
3673
  const { toggleTrackListSidebar, isTrackListSidebarVisible } = (0, import_genre_tree24.useTrackListSidebarVisibility)();
3673
3674
  const [lastLoadedTrackTitle, setLastLoadedTrackTitle] = (0, import_react19.useState)("");
3674
3675
  const loadedTrackTitle = playerTrackObject?.track.title;
@@ -3731,7 +3732,12 @@ function PlayerPanel({
3731
3732
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex shrink-0 items-center justify-between gap-2 border-b border-zinc-800 p-2", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "min-w-0 truncate text-sm font-semibold", children: loadedTrackTitle || lastLoadedTrackTitle }) }),
3732
3733
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "relative w-full shrink-0", children: [
3733
3734
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_player13.PlayerVideoSurface, { className: "aspect-video w-full bg-black" }),
3734
- playerTrackObject?.loadError && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "absolute bottom-2 left-2 right-2 text-xs text-red-400", children: playerTrackObject.loadError })
3735
+ playerTrackObject?.loadError && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "absolute bottom-2 left-2 right-2 text-xs text-red-400", children: [
3736
+ playerTrackObject.loadError,
3737
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", className: "ml-2 underline", onClick: () => {
3738
+ void retryPlayback();
3739
+ }, children: "Retry" })
3740
+ ] })
3735
3741
  ] }),
3736
3742
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(PlayerControls, {})
3737
3743
  ] }),