"Paste feedback" on each board card takes a client's message as it arrived
and splits it into rounds ("FEEDBACK 113 DUE Oct 7 12:00 PM") and per-shot
notes, tolerating WhatsApp copy prefixes, bold markers, wrapped lines,
several codes per note and codes without the show prefix.
A review step shows each note's shot, the version the client was sent,
the player frame and a "move task to Changes" tick (on by default).
Saving creates a FeedbackRound, a player comment per note tagged
source=WHATSAPP (shown as "Client feedback") and a board line under the
round's due time; ticking the line off resolves the comment.
Quoted frames are read as comp frames: shot frameStart or the house 1001,
plus the slate (recorded, else 1 for pipeline previews). Version.duration
is never stored on live, so the length-based slate inference can't be used.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
Clock,
|
||||
Flag,
|
||||
Link2,
|
||||
MessageSquareText,
|
||||
Pencil,
|
||||
Plus,
|
||||
Trash2,
|
||||
@@ -31,6 +32,7 @@ import {
|
||||
setProjectBoardStatus,
|
||||
updateBoardItem,
|
||||
} from "@/actions/board";
|
||||
import { FeedbackPasteDialog } from "./FeedbackPasteDialog";
|
||||
|
||||
type User = { id: string; name: string | null; email: string; image: string | null };
|
||||
|
||||
@@ -40,6 +42,9 @@ type BoardItem = {
|
||||
code: string | null;
|
||||
group: string;
|
||||
waitingOn: string | null;
|
||||
round: { id: string; title: string; dueAt: string | null } | null;
|
||||
/** The player comment a pasted-feedback line was saved as */
|
||||
comment: { versionId: string; frame: number } | null;
|
||||
doneAt: string | null;
|
||||
assignee: { id: string; name: string | null; image: string | null } | null;
|
||||
shot: {
|
||||
@@ -138,15 +143,26 @@ export function BoardClient({
|
||||
|
||||
function ProjectSection({ project, users, who }: { project: BoardProject; users: User[]; who: string | null }) {
|
||||
const [showDone, setShowDone] = useState(false);
|
||||
const [pasting, setPasting] = useState(false);
|
||||
|
||||
const visible = project.items.filter((i) =>
|
||||
who === null ? true : who === "none" ? !i.assignee : i.assignee?.id === who,
|
||||
);
|
||||
const open = visible.filter((i) => !i.doneAt);
|
||||
const done = visible.filter((i) => i.doneAt);
|
||||
const flagged = open.filter((i) => i.code && !i.shot);
|
||||
const waiting = open.filter((i) => i.waitingOn && !(i.code && !i.shot));
|
||||
const rest = open.filter((i) => !flagged.includes(i) && !waiting.includes(i));
|
||||
// Pasted feedback stays together under its round, flags and all
|
||||
const rounds: { round: NonNullable<BoardItem["round"]>; items: BoardItem[] }[] = [];
|
||||
for (const item of open) {
|
||||
if (!item.round) continue;
|
||||
let r = rounds.find((x) => x.round.id === item.round!.id);
|
||||
if (!r) rounds.push((r = { round: item.round, items: [] }));
|
||||
r.items.push(item);
|
||||
}
|
||||
rounds.sort((a, b) => (a.round.dueAt ?? "9").localeCompare(b.round.dueAt ?? "9"));
|
||||
const loose = open.filter((i) => !i.round);
|
||||
const flagged = loose.filter((i) => i.code && !i.shot);
|
||||
const waiting = loose.filter((i) => i.waitingOn && !(i.code && !i.shot));
|
||||
const rest = loose.filter((i) => !flagged.includes(i) && !waiting.includes(i));
|
||||
|
||||
// Groups keep the order they were first typed in
|
||||
const groups: { name: string; items: BoardItem[] }[] = [];
|
||||
@@ -171,8 +187,17 @@ function ProjectSection({ project, users, who }: { project: BoardProject; users:
|
||||
On hold
|
||||
</span>
|
||||
)}
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="ml-auto h-7"
|
||||
onClick={() => setPasting(true)}
|
||||
title="Paste a client's feedback message"
|
||||
>
|
||||
<MessageSquareText /> Paste feedback
|
||||
</Button>
|
||||
{project.shotTotal > 0 && (
|
||||
<div className="ml-auto flex items-center gap-2 text-xs text-zinc-400">
|
||||
<div className="flex items-center gap-2 text-xs text-zinc-400">
|
||||
<div className="h-1.5 w-24 overflow-hidden rounded-full bg-zinc-800">
|
||||
<div className="h-full bg-green-500/70" style={{ width: `${pct}%` }} />
|
||||
</div>
|
||||
@@ -185,6 +210,11 @@ function ProjectSection({ project, users, who }: { project: BoardProject; users:
|
||||
<StatusLine project={project} />
|
||||
<Milestones project={project} />
|
||||
|
||||
{rounds.map(({ round, items }) => (
|
||||
<RoundBlock key={round.id} round={round} count={items.length}>
|
||||
{items.map((i) => <ItemRow key={i.id} item={i} users={users} projectId={project.id} />)}
|
||||
</RoundBlock>
|
||||
))}
|
||||
{flagged.length > 0 && (
|
||||
<ItemBlock title="Flags" icon={<Flag className="h-3.5 w-3.5 text-red-400" />}>
|
||||
{flagged.map((i) => <ItemRow key={i.id} item={i} users={users} projectId={project.id} />)}
|
||||
@@ -221,10 +251,54 @@ function ProjectSection({ project, users, who }: { project: BoardProject; users:
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<FeedbackPasteDialog
|
||||
projectId={project.id}
|
||||
projectName={project.name}
|
||||
open={pasting}
|
||||
onOpenChange={setPasting}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
function RoundBlock({
|
||||
round,
|
||||
count,
|
||||
children,
|
||||
}: {
|
||||
round: NonNullable<BoardItem["round"]>;
|
||||
count: number;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const due = round.dueAt ? new Date(round.dueAt) : null;
|
||||
const late = due && due.getTime() < Date.now();
|
||||
const days = due ? differenceInCalendarDays(due, new Date()) : null;
|
||||
const when = due
|
||||
? days === 0 ? `today ${format(due, "HH:mm")}` : days === 1 ? `tomorrow ${format(due, "HH:mm")}` : format(due, "d MMM HH:mm")
|
||||
: null;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="mb-1 flex flex-wrap items-center gap-1.5 text-xs uppercase tracking-wider text-zinc-500">
|
||||
<MessageSquareText className="h-3.5 w-3.5 text-indigo-400" />
|
||||
{round.title}
|
||||
{when && (
|
||||
<span
|
||||
className={cn(
|
||||
"rounded px-1.5 py-px normal-case tracking-normal",
|
||||
late ? "bg-red-500/10 text-red-300" : days !== null && days <= 1 ? "bg-amber-500/10 text-amber-300" : "text-zinc-400",
|
||||
)}
|
||||
>
|
||||
{late ? "overdue · " : "due "}{when}
|
||||
</span>
|
||||
)}
|
||||
<span className="normal-case tracking-normal text-zinc-600">{count} open</span>
|
||||
</div>
|
||||
<div className="divide-y divide-zinc-800/60">{children}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ItemBlock({ title, icon, children }: { title: string; icon?: React.ReactNode; children: React.ReactNode }) {
|
||||
return (
|
||||
<div>
|
||||
@@ -466,7 +540,15 @@ function ItemRow({ item, users, projectId }: { item: BoardItem; users: User[]; p
|
||||
</Link>
|
||||
)}
|
||||
<span className={cn("text-zinc-200", done && "text-zinc-600 line-through")}>{item.text}</span>
|
||||
|
||||
{item.comment && (
|
||||
<Link
|
||||
href={`/review/${item.comment.versionId}`}
|
||||
className="text-[11px] text-indigo-400/80 hover:text-indigo-300"
|
||||
title="Open the note in the player"
|
||||
>
|
||||
note @ F{item.comment.frame}
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{(item.waitingOn || (flagged && !done)) && (
|
||||
|
||||
Reference in New Issue
Block a user