@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.
@@ -784,7 +784,7 @@ function GenreSearch({
784
784
  onPick: handlePick,
785
785
  status,
786
786
  loading: loading ? "Searching\u2026" : void 0,
787
- 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`,
787
+ 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`,
788
788
  className: "genre-search-results z-40 rounded-xl shadow-md",
789
789
  listClassName: "max-h-[min(20rem,50dvh)]",
790
790
  optionClassName: "[@media(pointer:coarse)]:min-h-[var(--layout-touch-target)]"
@@ -1285,8 +1285,9 @@ function GenrePlaylistTracks({
1285
1285
  const trackNoun = (0, import_track_noun.useTrackNoun)();
1286
1286
  const { uuid } = genrePlaylist;
1287
1287
  const { fetch } = (0, import_transport3.useFetchWrapper)(getBackendBaseUrl);
1288
+ const playback = (0, import_transport3.usePlaybackContext)();
1288
1289
  const { data, isPending, isError, refetch, hasNextPage, isFetchingNextPage, fetchNextPage } = (0, import_react_query.useInfiniteQuery)({
1289
- 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),
1290
+ 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] : []],
1290
1291
  queryFn: async ({ pageParam }) => {
1291
1292
  if (scope === "me") return fetchGenrePlaylistTracksPage(uuid, scope, Number(pageParam));
1292
1293
  const response = await fetch(
@@ -1301,7 +1302,7 @@ function GenrePlaylistTracks({
1301
1302
  },
1302
1303
  initialPageParam: scope === "me" ? 1 : "",
1303
1304
  getNextPageParam: (lastPage) => lastPage.nextPage ?? void 0,
1304
- enabled: scope !== "me" || sessionRestored && !!session?.accessToken
1305
+ enabled: playback.ready && (scope !== "me" || sessionRestored && !!session?.accessToken)
1305
1306
  });
1306
1307
  const [sentinel, setSentinel] = (0, import_react11.useState)(null);
1307
1308
  (0, import_react11.useEffect)(() => {
@@ -3370,7 +3371,7 @@ function PlayerPanel({
3370
3371
  renderArtistLink,
3371
3372
  renderSongLink
3372
3373
  }) {
3373
- const { playerTrackObject } = (0, import_player13.usePlayer)();
3374
+ const { playerTrackObject, retryPlayback } = (0, import_player13.usePlayer)();
3374
3375
  const { toggleTrackListSidebar, isTrackListSidebarVisible } = (0, import_genre_tree24.useTrackListSidebarVisibility)();
3375
3376
  const [lastLoadedTrackTitle, setLastLoadedTrackTitle] = (0, import_react19.useState)("");
3376
3377
  const loadedTrackTitle = playerTrackObject?.track.title;
@@ -3433,7 +3434,12 @@ function PlayerPanel({
3433
3434
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex shrink-0 items-center justify-between gap-2 border-b border-zinc-800 p-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "min-w-0 truncate text-sm font-semibold", children: loadedTrackTitle || lastLoadedTrackTitle }) }),
3434
3435
  /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative w-full shrink-0", children: [
3435
3436
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_player13.PlayerVideoSurface, { className: "aspect-video w-full bg-black" }),
3436
- playerTrackObject?.loadError && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "absolute bottom-2 left-2 right-2 text-xs text-red-400", children: playerTrackObject.loadError })
3437
+ playerTrackObject?.loadError && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "absolute bottom-2 left-2 right-2 text-xs text-red-400", children: [
3438
+ playerTrackObject.loadError,
3439
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", className: "ml-2 underline", onClick: () => {
3440
+ void retryPlayback();
3441
+ }, children: "Retry" })
3442
+ ] })
3437
3443
  ] }),
3438
3444
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PlayerControls, {})
3439
3445
  ] }),