feat(dashboard): QC queue, deliveries and whose-court panels
Deploy / deploy (push) Successful in 6m51s

Completes the operations dashboard.

QC queue: what is waiting on a person to watch the frames, oldest first.
Every stage before QC is worked by the farm, so this is the only one that
cannot drain itself - depth here is the best early warning that a delivery
date is going to move, and it had no home outside a filter on the queue page.

Deliveries: the last few packages, flagging FAILED and builds stuck in
BUILDING. A failed build is otherwise silent - the exports stay
READY_FOR_DELIVERY, nothing reaches the delivery volume, and nobody finds out
until the client asks where the shots are.

Whose court: versions sent to the client and unanswered, against shots with
unresolved notes. Two numbers rather than one because they call for opposite
responses - a fortnight-old review is a phone call, unactioned notes are a
scheduling problem.

The artist view now scopes to the artist throughout: the blocked list, and
the counters above it, which otherwise quoted a studio-wide figure next to a
personal list.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
twotalesanimation
2026-09-10 05:58:08 +02:00
parent 6bfc013e35
commit 6afbe82a29
5 changed files with 532 additions and 13 deletions
+96
View File
@@ -0,0 +1,96 @@
import Link from "next/link";
import { formatDistanceToNowStrict } from "date-fns";
import { cn } from "@/lib/utils";
import type { QcQueueEntry } from "@/lib/dashboard/ops";
/**
* What is waiting on someone to watch the frames, oldest first.
*
* Everything upstream of QC is worked by the farm; this is the one stage that
* only drains when a person sits down to it, which is why depth here is worth
* a panel of its own rather than a filter on the queue page.
*/
export function QcQueue({ entries, staleHours }: { entries: QcQueueEntry[]; staleHours: number }) {
const oldest = entries[0];
return (
<div className="rounded-lg border border-zinc-800 bg-card overflow-hidden">
<div className="flex items-center justify-between gap-3 border-b border-zinc-800/60 px-4 py-3">
<h3 className="text-sm font-semibold text-white">
{entries.length === 0
? "QC queue empty"
: `${entries.length} waiting on QC`}
{oldest && (
<span className="ml-2 text-xs font-normal text-zinc-500">
oldest {formatDistanceToNowStrict(oldest.since)}
</span>
)}
</h3>
<Link
href="/pipeline?status=READY_FOR_QC"
className="text-xs text-zinc-400 hover:text-amber-400"
>
Open QC →
</Link>
</div>
{entries.length === 0 ? (
<p className="px-4 py-10 text-center text-sm text-zinc-500">
Nothing is waiting on a QC pass.
</p>
) : (
<div className="overflow-x-auto">
<table className="w-full text-sm">
<thead>
<tr className="border-b border-zinc-800 bg-zinc-900/60 text-left text-xs text-zinc-400">
<th className="px-4 py-2.5 font-medium">Shot</th>
<th className="px-4 py-2.5 font-medium">Version</th>
<th className="px-4 py-2.5 font-medium">Waiting</th>
<th className="px-4 py-2.5 font-medium">Frames</th>
<th className="px-4 py-2.5 font-medium">Submitted by</th>
</tr>
</thead>
<tbody>
{entries.map((e) => {
const stale = Date.now() - e.since.getTime() > staleHours * 3600_000;
return (
<tr key={e.exportId} className="border-b border-zinc-800/60 hover:bg-zinc-900/40">
<td className="px-4 py-2.5">
<Link
href={`/pipeline/exports/${e.exportId}`}
className="font-mono text-[13px] font-medium text-white hover:text-amber-400"
>
{e.shotCode}
</Link>
<div className="text-xs text-zinc-500">
{e.projectCode}
{e.episode ? ` · ep ${e.episode}` : ""}
</div>
</td>
<td className="px-4 py-2.5 font-mono text-[13px] text-zinc-300">
{e.versionString}
</td>
<td
className={cn(
"px-4 py-2.5 tabular-nums whitespace-nowrap",
stale ? "text-amber-400" : "text-zinc-300"
)}
>
{formatDistanceToNowStrict(e.since)}
</td>
<td className="px-4 py-2.5 font-mono text-[13px] tabular-nums text-zinc-400 whitespace-nowrap">
{e.frameStart}–{e.frameEnd}
</td>
<td className="px-4 py-2.5 text-zinc-300 whitespace-nowrap">
{e.submittedBy ?? "—"}
</td>
</tr>
);
})}
</tbody>
</table>
</div>
)}
</div>
);
}
+74
View File
@@ -0,0 +1,74 @@
import Link from "next/link";
import { formatDistanceToNowStrict } from "date-fns";
import { cn } from "@/lib/utils";
import { DELIVERY_STATUS_STYLES } from "@/app/(dashboard)/pipeline/status-colors";
import type { DeliverySummary } from "@/lib/dashboard/ops";
/**
* The last few packages, and whether any of them went wrong.
*
* A failed build is otherwise silent — the exports stay READY_FOR_DELIVERY and
* nothing reaches the delivery volume, but no one finds out until the client
* asks where the shots are.
*/
export function RecentDeliveries({ deliveries }: { deliveries: DeliverySummary[] }) {
const problems = deliveries.filter((d) => d.status === "FAILED" || d.stuck).length;
return (
<div className="rounded-lg border border-zinc-800 bg-card overflow-hidden">
<div className="flex items-center justify-between gap-3 border-b border-zinc-800/60 px-4 py-3">
<h3 className="text-sm font-semibold text-white">
Recent packages
{problems > 0 && (
<span className="ml-2 text-xs font-normal text-red-400">
{problems} need{problems === 1 ? "s" : ""} attention
</span>
)}
</h3>
<Link href="/pipeline/deliveries" className="text-xs text-zinc-400 hover:text-amber-400">
All deliveries →
</Link>
</div>
{deliveries.length === 0 ? (
<p className="px-4 py-8 text-center text-sm text-zinc-500">No packages built yet.</p>
) : (
deliveries.map((d) => (
<Link
key={d.id}
href="/pipeline/deliveries"
className="flex items-center gap-3 border-b border-zinc-800/60 px-4 py-2.5 last:border-b-0 hover:bg-zinc-900/40"
>
<div className="min-w-0 flex-1">
<div className="truncate text-[13px] text-white">
<span className="font-mono font-medium">#{d.packageNumber}</span>{" "}
<span className="text-zinc-500">
{d.projectCode}
{d.episode ? ` · ${d.episode}` : ""}
{d.kind === "MOV_REVIEW" ? " · review" : ""}
</span>
</div>
<div className="truncate text-xs text-zinc-500" title={d.errorMessage ?? undefined}>
{d.status === "FAILED" && d.errorMessage
? d.errorMessage
: `${d.itemCount} shot${d.itemCount === 1 ? "" : "s"} · ${d.atLabel} ${formatDistanceToNowStrict(d.at)} ago`}
</div>
</div>
<span
className={cn(
"shrink-0 rounded-full border px-2 py-0.5 text-xs whitespace-nowrap",
// A build that never finished reads as a problem, not as work
// still in progress.
d.stuck
? "bg-red-500/15 text-red-400 border-red-500/30"
: DELIVERY_STATUS_STYLES[d.status] ?? "bg-zinc-500/15 text-zinc-300 border-zinc-500/30"
)}
>
{d.stuck ? "STUCK" : d.status}
</span>
</Link>
))
)}
</div>
);
}
+70
View File
@@ -0,0 +1,70 @@
import Link from "next/link";
import type { WhoseCourt as WhoseCourtData } from "@/lib/dashboard/ops";
/**
* Which waits are the client's and which are ours.
*
* Two numbers rather than one, because they call for opposite responses: a
* version unanswered for a fortnight is a phone call, while notes nobody has
* picked up is a scheduling problem.
*/
export function WhoseCourt({ court }: { court: WhoseCourtData }) {
return (
<div className="grid grid-cols-1 sm:grid-cols-2 rounded-lg border border-zinc-800 bg-card overflow-hidden">
<Side
title="Waiting on the client"
subtitle="Sent for review, no verdict yet"
side={court.client}
empty="Nothing is with the client."
className="border-b border-zinc-800/60 sm:border-b-0 sm:border-r"
/>
<Side
title="Waiting on us"
subtitle="Notes in, still unresolved"
side={court.us}
empty="No open notes."
/>
</div>
);
}
function Side({
title,
subtitle,
side,
empty,
className,
}: {
title: string;
subtitle: string;
side: WhoseCourtData["client"];
empty: string;
className?: string;
}) {
return (
<div className={`px-4 py-3 ${className ?? ""}`}>
<h4 className="text-xs font-semibold text-white">{title}</h4>
<p className="text-[11px] text-zinc-500">{subtitle}</p>
<b className="mt-2 mb-2 block font-mono text-2xl font-bold leading-none tabular-nums text-white">
{side.count}
</b>
{side.items.length === 0 ? (
<p className="text-xs text-zinc-500">{empty}</p>
) : (
<ul className="flex flex-col gap-1.5">
{side.items.map((item) => (
<li key={item.id} className="flex items-baseline justify-between gap-3 text-xs">
<Link
href={item.href}
className="truncate font-mono text-[11.5px] text-zinc-200 hover:text-amber-400"
>
{item.shotCode}
</Link>
<span className="shrink-0 tabular-nums text-zinc-500">{item.label}</span>
</li>
))}
</ul>
)}
</div>
);
}