feat: entry details overhaul, navigation, rating half-stars, library growth "all", accuracy field
- SeasonPage: add back navigation link to entry details page - EpisodePage: add breadcrumb navigation back to entry and season pages - EntryCard: non-library entries now open a details dialog on click with overview, rating, and add-to-library button - EntryDetailsPage: move favorite and mark-watched buttons into grouped dropdown menu with separators - EntryDetailsPage: add favorite badge (heart icon) on top-left of poster - EntryDetailsPage: add "mark as watched" clickable text next to runtime for unwatched movies - EntryDetailsPage: genre pills are now clickable links that navigate to library page with genre filter - EntryDetailsPage: hide status pill for movies; show status as text next to release date for TV series - EntryDetailsPage: add delete entry option in dropdown menu with confirmation dialog and redirect to library - EntryDetailsPage: add TMDB and IMDb external links under poster using entry.entryIds - EntryDetailsPage: group all dropdown actions by relevance (Watch/Rate, Organize, Manage, Danger) with separators - RatingDialog: support half-star ratings (0.5 increments) with left/right click zones per star - RatingDialog: fix clear rating button by syncing state on dialog open and using dedicated handleClear function - LibraryGrowthChart: add "All" option to year selector (default) showing cumulative growth across all years - Frontend: add SeenAccuracy type to types/index.ts, update API layers and hooks to support accuracy - EntrySeenDialog: add Date Accuracy selector (Exact/Estimated/Unknown) with EXACT default - EpisodeSeenEditDialog: add Date Accuracy selector, updated overrideSubmit signature - SeasonPage: pass accuracy through bulk mark-all-watched flow
This commit is contained in:
1 parent
ebdef6ba6c
commit
63fdc00ac2
15 files changed
+396
-109
No files matched your search
@@ -1,9 +1,15 @@
|
||||
import { useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Plus, Trash2, Star, Loader2 } from 'lucide-react';
|
||||
import { Plus, Trash2, Star, Loader2, Calendar, Clock } from 'lucide-react';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog';
|
||||
import { getPosterUrl, getYear, formatRuntime } from '@/lib/media-utils';
|
||||
import { useCreateEntry, useDeleteEntry } from '@/hooks/useEntries';
|
||||
import { useLibraryStore } from '@/stores/useLibraryStore';
|
||||
@@ -18,6 +24,7 @@ interface EntryCardProps {
|
||||
|
||||
export function EntryCard({ entry, tmdbEntry, showTypeBadge }: EntryCardProps) {
|
||||
const [showConfirm, setShowConfirm] = useState(false);
|
||||
const [showDetailDialog, setShowDetailDialog] = useState(false);
|
||||
const createEntry = useCreateEntry();
|
||||
const deleteEntry = useDeleteEntry();
|
||||
const libraryEntry = useLibraryStore((s) => {
|
||||
@@ -174,7 +181,13 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge }: EntryCardProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
{entryLink ? <Link to={entryLink}>{card}</Link> : card}
|
||||
{entryLink ? (
|
||||
<Link to={entryLink}>{card}</Link>
|
||||
) : (
|
||||
<div className="cursor-pointer" onClick={() => setShowDetailDialog(true)}>
|
||||
{card}
|
||||
</div>
|
||||
)}
|
||||
<ConfirmDialog
|
||||
open={showConfirm}
|
||||
onOpenChange={setShowConfirm}
|
||||
@@ -184,6 +197,66 @@ export function EntryCard({ entry, tmdbEntry, showTypeBadge }: EntryCardProps) {
|
||||
onConfirm={confirmRemove}
|
||||
variant="destructive"
|
||||
/>
|
||||
{/* Details dialog for non-library entries */}
|
||||
{!entryLink && tmdbEntry && (
|
||||
<Dialog open={showDetailDialog} onOpenChange={setShowDetailDialog}>
|
||||
<DialogContent className="sm:max-w-lg">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{title}</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="flex gap-4">
|
||||
<img
|
||||
src={posterUrl}
|
||||
alt={title}
|
||||
className="h-48 w-32 shrink-0 rounded-lg object-cover"
|
||||
/>
|
||||
<div className="flex-1 space-y-2 min-w-0">
|
||||
<div className="flex flex-wrap items-center gap-2 text-sm text-muted-foreground">
|
||||
{year && (
|
||||
<span className="flex items-center gap-1">
|
||||
<Calendar className="h-3 w-3" />
|
||||
{year}
|
||||
</span>
|
||||
)}
|
||||
{isTv ? (
|
||||
<Badge variant="secondary" className="text-[10px]">TV Series</Badge>
|
||||
) : (
|
||||
<Badge variant="secondary" className="text-[10px]">Movie</Badge>
|
||||
)}
|
||||
</div>
|
||||
{tmdbEntry.vote_average > 0 && (
|
||||
<div className="flex items-center gap-1 text-sm">
|
||||
<Star className="h-3.5 w-3.5 fill-yellow-400 text-yellow-400" />
|
||||
<span>{tmdbEntry.vote_average.toFixed(1)}/10</span>
|
||||
</div>
|
||||
)}
|
||||
{tmdbEntry.overview && (
|
||||
<p className="text-sm text-muted-foreground line-clamp-6">
|
||||
{tmdbEntry.overview}
|
||||
</p>
|
||||
)}
|
||||
<Button
|
||||
size="sm"
|
||||
className="mt-2"
|
||||
onClick={(ev) => {
|
||||
ev.stopPropagation();
|
||||
handleAdd(ev);
|
||||
setShowDetailDialog(false);
|
||||
}}
|
||||
disabled={createEntry.isPending}
|
||||
>
|
||||
{createEntry.isPending ? (
|
||||
<Loader2 className="mr-1.5 h-3.5 w-3.5 animate-spin" />
|
||||
) : (
|
||||
<Plus className="mr-1.5 h-3.5 w-3.5" />
|
||||
)}
|
||||
{createEntry.isPending ? 'Adding...' : 'Add to Library'}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user