feat(frontend): fix hooks crash, persist library filters, improve UI
- Fix "rendered more hooks" crash in CollectionDetailsPage by moving all hooks before conditionals - Persist library search/filters only on back navigation using useNavigationType - Add resetAll() to useLibraryFiltersStore - Move sort toolbar to hero bottom-right in CollectionDetailsPage - Fall back to entry backdrops when collection has none - Show full cast in TmdbPreviewPage matching EntryDetailsPage layout - Remove tagline/icons from TmdbPreviewPage to match in-library style - Lazy load people in local DB mode with infinite scroll - Move All/Favorite filter to right side in PeoplePage, always visible - Track dropdownOpen state in EntryCard to fix menu close flash Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
1 parent
ea143fb32a
commit
a42d4ee7d7
7 files changed
+325
-177
No files matched your search
@@ -4,9 +4,11 @@ import { useLibraryStore } from '@/stores/useLibraryStore';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { Star, Plus, Loader2, ExternalLink, Tv, Film } from 'lucide-react';
|
||||
import { Star, Plus, Loader2, ExternalLink } from 'lucide-react';
|
||||
import { EntryDetailsSkeleton } from '@/components/skeletons/PageSkeletons';
|
||||
import { CastList } from "@/components/entries/CastList";
|
||||
import { getYear, formatRuntime } from '@/lib/media-utils';
|
||||
import type { Credit } from '@/types';
|
||||
|
||||
const TMDB_IMG = 'https://image.tmdb.org/t/p';
|
||||
|
||||
@@ -127,25 +129,13 @@ export function TmdbPreviewPage() {
|
||||
{/* RIGHT: Info */}
|
||||
<div className="flex-1 min-w-0 space-y-4">
|
||||
{/* Title */}
|
||||
<div className="space-y-1">
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold leading-tight">{preview.title}</h1>
|
||||
{preview.tagline && (
|
||||
<p className="text-sm text-muted-foreground italic">{preview.tagline}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Meta */}
|
||||
<div className="flex flex-wrap items-center gap-2 text-sm text-muted-foreground">
|
||||
<span className="inline-flex items-center gap-1">
|
||||
{preview.is_tvseries ? <Tv className="h-3.5 w-3.5" /> : <Film className="h-3.5 w-3.5" />}
|
||||
{preview.is_tvseries ? 'TV Series' : 'Movie'}
|
||||
</span>
|
||||
{preview.release_date && (
|
||||
<>
|
||||
<span>•</span>
|
||||
<span>{getYear(preview.release_date)}</span>
|
||||
</>
|
||||
)}
|
||||
{preview.release_date && <span>{getYear(preview.release_date)}</span>}
|
||||
{preview.is_tvseries && preview.status && (
|
||||
<>
|
||||
<span>•</span>
|
||||
@@ -154,7 +144,7 @@ export function TmdbPreviewPage() {
|
||||
)}
|
||||
{preview.runtime && !preview.is_tvseries && (
|
||||
<>
|
||||
<span>•</span>
|
||||
{preview.release_date && <span>•</span>}
|
||||
<span>{formatRuntime(preview.runtime)}</span>
|
||||
</>
|
||||
)}
|
||||
@@ -207,6 +197,16 @@ export function TmdbPreviewPage() {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Sections */}
|
||||
<div className="mt-10 space-y-8">
|
||||
{preview.credits && preview.credits.length > 0 && (
|
||||
<>
|
||||
<Separator />
|
||||
<CastList credits={preview.credits as unknown as Credit[]} />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user