feat: add gamepad navigation and music library improvements
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped

- add TV/gamepad spatial navigation, focus ring and back/select controls
- cache artwork persistently and add music cover placeholders
- add compact songs list, shuffle-all queue and library error recovery
- polish remote control layout and optimistic seek timeline
This commit is contained in:
1xDed committed 2026-12-01 04:24:56 +03:00
1 parent 04ab9f767b
commit 5f5803c9f8
24 files changed
+1199 -245

No files matched your search

+21 -3
View File
@@ -9,6 +9,7 @@ import { useNavigate } from "@tanstack/react-router";
import React, { memo, type Ref, useCallback } from "react";
import { ErrorBoundary } from "react-error-boundary";
import { useInView } from "react-intersection-observer";
import CachedImage from "@/components/cachedImage";
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
import { resolveItemImage } from "@/utils/methods/itemImages";
import { useApiInContext } from "@/utils/store/api";
@@ -60,6 +61,14 @@ const CardContent = ({
const image = resolveItemImage(item, imageType, {
seriesId: seriesId ? (item.SeriesId ?? undefined) : undefined,
});
const isMusic =
item.Type === BaseItemKind.MusicAlbum ||
item.Type === BaseItemKind.Audio ||
item.Type === BaseItemKind.AudioBook ||
item.Type === BaseItemKind.Playlist;
// Jellyfin generates a generic placeholder when a music item has no cover;
// prefer our own themed fallback in that case.
const hasCover = !isMusic || Boolean(image?.tag);
const defaultOnClick = useCallback(() => {
if (item?.Id) {
@@ -72,6 +81,15 @@ const CardContent = ({
className="card"
ref={forwardedRef}
onClick={onClick || defaultOnClick}
onKeyDown={(event) => {
if (event.key === "Enter" || event.key === " ") {
event.preventDefault();
(onClick || defaultOnClick)();
}
}}
role="button"
tabIndex={0}
aria-label={cardTitle ?? item.Name ?? "Элемент"}
>
<div className={`card-image-container ${cardType}`}>
<ErrorBoundary fallback={<></>}>
@@ -107,8 +125,8 @@ const CardContent = ({
? getTypeIcon(overrideIcon)
: getTypeIcon(item.Type ?? "universal")}
</div>
{image && (
<img
{image && hasCover && (
<CachedImage
alt={item.Name ?? "blink"}
decoding="async"
src={
@@ -136,7 +154,7 @@ const CardContent = ({
/>
)}
{inView && !disableOverlay && (
<div className="card-overlay">
<div className="card-overlay" data-tv-ignore>
<PlayButton
item={item}
userId={userId}