Review queue

Pro

Grade real agent answers one at a time, from the keyboard: P pass, F fail, J/K next and previous. The judge's verdict is shown beside the item but never pre-fills the grade, so people grade the answer, not the judge.

Markdown

Preview

Install

With the Candor CLI

First time? Get started sets up the registry and theme. Or with shadcn directly: npx shadcn@latest add @candor/review-queue

Brings in: agent-avatar, button, locale, ops, utils · npm: lucide-react@^1.67.0

Usage

TSX · The example above
"use client"

import * as React from "react"
import { ReviewQueue } from "@/components/review-queue"
import type { ReviewItem } from "@/lib/ops"

export default function Example() {
  const [items, setItems] = React.useState<ReviewItem[]>([
    { id: "r1", agent: { id: "arch", name: "Architect agent", role: "planner" }, ask: "Can we drop legacy_tier from customers now?", answer: "Yes, it has had no writes in the last 90 days, so it’s safe to drop.", judge: { verdict: "pass", reason: "Answers the question directly." } },
    { id: "r2", agent: { id: "dev", name: "Dev agent", role: "coder" }, ask: "Why did the backfill stop?", answer: "Batch 12 hit a row lock four times, so the run stopped itself. The rows updated before it keep their region.", judge: { verdict: "pass", reason: "Explains the stop and its effect." } },
    { id: "r3", agent: { id: "qa", name: "QA agent", role: "tester" }, ask: "Is the new_checkout flag on in Staging?", answer: "It’s on for 50% of Staging traffic, per flags/new_checkout.yaml." },
  ])
  return <ReviewQueue className="max-w-xl" items={items} onGrade={(id, grade, note) => setItems((xs) => xs.map((x) => (x.id === id ? { ...x, grade, note } : x)))} />
}

<ReviewQueue>

PropTypeDefaultDescription
itemsrequiredReviewItem[]—Answers to grade; it opens on the first one without a grade.
onGraderequired(id: string, grade: "pass" | "fail", note?: string) => void—Called with the item's id, the grade, and the reviewer's note if they wrote one.
classNamestring | undefined—Extra classes for the outer element.

Strings

The fixed words, in English by default. Change any of them under reviewQueue in <LocaleProvider strings={{ … }}>; the table is exported as reviewQueueStrings.

KeyEnglish
reviewQueueReview queue
reviewReview
progress{position} of {total} · {done} graded
youPassYou: pass
youFailYou: fail
askedAsked
answeredAnswered
judgeSaidJudge said {verdict}: {reason}
verdictPasspass
verdictFailfail
notePlaceholderNote (optional): why
noteNote
hintPasspass
hintFailfail
hintNavnext/previous
failFail
passPass