From 0723bea4ee67c4883d91f5cc95d90e211badc3d9 Mon Sep 17 00:00:00 2001 From: twotalesanimation <80506065+twotalesanimation@users.noreply.github.com> Date: Sun, 24 May 2026 18:36:22 +0200 Subject: [PATCH] kanban thumbnails --- app/(dashboard)/projects/[id]/kanban/page.tsx | 4 ++- app/(dashboard)/projects/[id]/page.tsx | 4 +-- components/tasks/KanbanBoard.tsx | 4 ++- components/tasks/KanbanCard.tsx | 28 ++++++++++++++++++- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/app/(dashboard)/projects/[id]/kanban/page.tsx b/app/(dashboard)/projects/[id]/kanban/page.tsx index 8f2e28b..8959bc0 100644 --- a/app/(dashboard)/projects/[id]/kanban/page.tsx +++ b/app/(dashboard)/projects/[id]/kanban/page.tsx @@ -41,7 +41,7 @@ export default async function KanbanPage({ where: { projectId: id }, orderBy: [{ status: "asc" }, { sortOrder: "asc" }], include: { - shot: { select: { id: true, shotCode: true } }, + shot: { select: { id: true, shotCode: true, thumbnailUrl: true } }, asset: { select: { id: true, assetCode: true, name: true } }, assignedArtist: { select: { id: true, name: true, email: true, image: true }, @@ -55,6 +55,8 @@ export default async function KanbanPage({ versionNumber: true, approvalStatus: true, createdAt: true, + thumbnailUrl: true, + posterUrl: true, }, }, }, diff --git a/app/(dashboard)/projects/[id]/page.tsx b/app/(dashboard)/projects/[id]/page.tsx index 87e35a2..ac9c5ed 100644 --- a/app/(dashboard)/projects/[id]/page.tsx +++ b/app/(dashboard)/projects/[id]/page.tsx @@ -60,14 +60,14 @@ async function getProject(id: string) { tasks: { orderBy: [{ status: "asc" }, { sortOrder: "asc" }], include: { - shot: { select: { id: true, shotCode: true } }, + shot: { select: { id: true, shotCode: true, thumbnailUrl: true } }, asset: { select: { id: true, assetCode: true, name: true } }, assignedArtist: { select: { id: true, name: true, email: true, image: true } }, _count: { select: { versions: true } }, versions: { take: 1, orderBy: { versionNumber: "desc" }, - select: { id: true, versionNumber: true, approvalStatus: true, createdAt: true }, + select: { id: true, versionNumber: true, approvalStatus: true, createdAt: true, thumbnailUrl: true, posterUrl: true }, }, }, }, diff --git a/components/tasks/KanbanBoard.tsx b/components/tasks/KanbanBoard.tsx index 272f11d..922cdcd 100644 --- a/components/tasks/KanbanBoard.tsx +++ b/components/tasks/KanbanBoard.tsx @@ -42,7 +42,7 @@ interface KanbanTask { status: TaskStatus; priority: string; dueDate: Date | null; - shot?: { shotCode: string } | null; + shot?: { shotCode: string; thumbnailUrl?: string | null } | null; asset?: { assetCode: string; name: string } | null; assignedArtist?: { id: string; @@ -56,6 +56,8 @@ interface KanbanTask { versionNumber: number; approvalStatus: string; createdAt: Date; + thumbnailUrl?: string | null; + posterUrl?: string | null; }[]; } diff --git a/components/tasks/KanbanCard.tsx b/components/tasks/KanbanCard.tsx index cab4ff2..fc2ff09 100644 --- a/components/tasks/KanbanCard.tsx +++ b/components/tasks/KanbanCard.tsx @@ -14,6 +14,7 @@ import { XCircle, Clock, GripVertical, + Film, } from "lucide-react"; import { TaskStatus, TaskType } from "@prisma/client"; import { TASK_STATUS_CONFIG, TASK_TYPE_LABELS } from "./TaskCard"; @@ -33,7 +34,7 @@ interface KanbanTask { status: TaskStatus; priority: string; dueDate: Date | null; - shot?: { shotCode: string } | null; + shot?: { shotCode: string; thumbnailUrl?: string | null } | null; asset?: { assetCode: string; name: string } | null; assignedArtist?: { id: string; name: string | null; email: string; image: string | null } | null; _count?: { versions: number }; @@ -42,6 +43,8 @@ interface KanbanTask { versionNumber: number; approvalStatus: string; createdAt: Date; + thumbnailUrl?: string | null; + posterUrl?: string | null; }[]; } @@ -68,6 +71,13 @@ export function KanbanCard({ task, isDragOverlay = false }: KanbanCardProps) { const contextCode = task.shot?.shotCode ?? task.asset?.assetCode; + // Resolve thumbnail: prefer latest version thumbnail, then shot thumbnail + const thumbnail = + latestVersion?.thumbnailUrl ?? + latestVersion?.posterUrl ?? + task.shot?.thumbnailUrl ?? + null; + return (