feat(frontend): Entry details redesign, people filmography, calendar improvements
- EntryDetailsPage: sticky poster layout, centered max-w-4xl, director by-line with link, rating pills (IMDb/TMDB/You), quick actions under poster, RatingDialog with star UI, In Collections section using backdrops, EntrySettingsDialog with show_in_calendar / auto_sync / rating options - RatingDialog: new component with 10-star interactive rating - AddEntryToCollectionDialog: optimistic cache updates so checkbox state reflects immediately and In Collections section on entry details page refreshes - PersonDetailsPage: filmography section showing library vs. non-library entries via person.roles, TMDB combined credits for non-library titles - PersonTmdbRedirectPage: new redirect page for TMDB person IDs to local person ID - PeoplePage: fix person card links to use /people/tmdb/:tmdbId - CalendarPage: full-height layout, larger episode thumbnails, episode items clickable, improved tooltip, show_in_calendar backend filter - Fix useUpdateEntry to also invalidate entryKeys.all (favorite button reactivity) - Fix updateRatings API body wrapping - Add useUpdateEntryRatings, usePersonCredits, useFetchPersonByTmdbId hooks - Add getCollectionBackdropUrl to media-utils - Types: show_in_calendar, auto_sync on Entry; id on EntryRatings; roles on People - Backend: fix fetchPersonData alias in peopleService; remove duplicate getPersonCredits; add show_in_calendar filter to episodeService
This commit is contained in:
1 parent
11eab03987
commit
3ca24434d7
16 files changed
+857
-322
No files matched your search
@@ -6,7 +6,11 @@ import {
|
||||
} from '@/components/ui/dialog';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Switch } from '@/components/ui/switch';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { useUpdateEntry } from '@/hooks/useEntries';
|
||||
import { RatingDialog } from '@/components/dialogs/RatingDialog';
|
||||
import { useState } from 'react';
|
||||
import { Star } from 'lucide-react';
|
||||
import type { Entry } from '@/types';
|
||||
|
||||
interface EntrySettingsDialogProps {
|
||||
@@ -21,36 +25,76 @@ export function EntrySettingsDialog({
|
||||
entry,
|
||||
}: EntrySettingsDialogProps) {
|
||||
const updateEntry = useUpdateEntry();
|
||||
const [showRating, setShowRating] = useState(false);
|
||||
|
||||
const handleToggle = (field: keyof Entry, value: boolean) => {
|
||||
updateEntry.mutate({ id: entry.id, data: { [field]: value } });
|
||||
};
|
||||
|
||||
const settings = [
|
||||
const boolSettings = [
|
||||
{ field: 'favorit' as const, label: 'Favorite' },
|
||||
{ field: 'hidden' as const, label: 'Hidden' },
|
||||
{ field: 'watchlist' as const, label: 'Watchlist' },
|
||||
{ field: 'show_in_calendar' as const, label: 'Show in Calendar' },
|
||||
{ field: 'auto_sync' as const, label: 'Auto Sync' },
|
||||
];
|
||||
|
||||
const userRating = entry.entryRatings?.user_rating;
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Entry Settings</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="space-y-4 py-4">
|
||||
{settings.map(({ field, label }) => (
|
||||
<div key={field} className="flex items-center justify-between">
|
||||
<Label htmlFor={field}>{label}</Label>
|
||||
<Switch
|
||||
id={field}
|
||||
checked={!!entry[field]}
|
||||
onCheckedChange={(checked) => handleToggle(field, checked)}
|
||||
/>
|
||||
<>
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Entry Settings</DialogTitle>
|
||||
<p className="text-sm text-muted-foreground line-clamp-1">{entry.title}</p>
|
||||
</DialogHeader>
|
||||
<div className="space-y-1 py-2">
|
||||
{boolSettings.map(({ field, label }) => (
|
||||
<div key={field} className="flex items-center justify-between rounded-lg px-1 py-2.5">
|
||||
<Label htmlFor={field} className="cursor-pointer">
|
||||
{label}
|
||||
</Label>
|
||||
<Switch
|
||||
id={field}
|
||||
checked={!!entry[field]}
|
||||
onCheckedChange={(checked) => handleToggle(field, checked)}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
<Separator className="my-2" />
|
||||
<div className="flex items-center justify-between rounded-lg px-1 py-2.5">
|
||||
<Label className="cursor-pointer">Your Rating</Label>
|
||||
<button
|
||||
className="flex items-center gap-1.5 text-sm font-medium hover:text-primary transition-colors"
|
||||
onClick={() => setShowRating(true)}
|
||||
>
|
||||
{userRating && userRating > 0 ? (
|
||||
<>
|
||||
<div className="flex">
|
||||
{Array.from({ length: 10 }).map((_, i) => (
|
||||
<Star
|
||||
key={i}
|
||||
className={`h-3 w-3 ${i < userRating ? 'fill-yellow-400 text-yellow-400' : 'text-muted-foreground/30'}`}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<span className="tabular-nums">{userRating}/10</span>
|
||||
</>
|
||||
) : (
|
||||
<span className="text-muted-foreground">Not rated — click to rate</span>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<RatingDialog
|
||||
open={showRating}
|
||||
onOpenChange={setShowRating}
|
||||
entry={entry}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user