Skip to content
GitHub (opens in a new tab)
AgentsScreen

Plan review

Approve an agent's plan before it runs, step by step, as a whole page.

What a screen is

A screen is a whole page exported from the kit, built only from kit components and tokens. Import it once, pass your data and callbacks, and render it as the page: it brings its own nav and <main>, and its loading and empty states are built in. A pattern is the copy-in version you own and change; a block is one area that sits inside your <main>.

When to use

  • an agent proposes a multi-step plan and a person reviews, edits and approves it before anything runs
  • the reviewer should see how risky each step is, why the agent takes it, and what the run will touch and cost
  • you want the whole page done, with loading and empty states, and only need to pass the plan and callbacks

When not to use

  • the plan review inside your own page or panel — PlanReview
  • the plan while it runs — RunDetail or AgentPlan
  • one action that needs an OK — ApprovalCard
  • a run with several agents handing work on — RunHandoffsScreen

Usage

Approve an agent's plan before it runs, as a whole page: the steps with their risk and why, edit, remove and move up or down by keyboard, what the plan changes with its estimated time and cost, the autonomy for this run, and Reject, Request changes and Approve plan pinned at the bottom. Import it once, pass the plan and your callbacks; the High risk and Edited alerts, the sent state, loading skeletons and the empty state come with it.

<PlanReviewScreen plan={plan} onEditStep={saveStep} onRemoveStep={removeStep} onReorder={reorder} onAutonomyChange={setAutonomy} onApprove={({ autonomy, steps }) => run(autonomy, steps)} onRequestChanges={sendBack} onReject={reject} onNavigate={go} workspace={{ name: "Northwind" }} user={{ name: "Alex Morgan", email: "alex@northwind.example" }} />
import { PlanReviewScreen } from "agentic-ds-kit";

export default function PlanPage({ plan, loading }) {
  // The screen renders its own app nav and <main>: don't wrap it in another main.
  return (
    <PlanReviewScreen
      plan={plan}                            // { title, question?, planTitle, agent, target?, owner, proposedAt, estimate: { time, cost }, steps, changes? }
      loading={loading}                      // Skeletons for the plan and the side column
      empty={plan?.steps.length === 0}       // No plan yet
      onEditStep={(step) => saveStep(step)}  // Save step, or a new step from Add step
      onRemoveStep={(id) => removeStep(id)}
      onReorder={(ids) => saveOrder(ids)}    // Move up / Move down: every id in the new order
      onAutonomyChange={(stop) => setAutonomy(stop)}
      onApprove={({ autonomy, steps }) => run(autonomy, steps)}
      onRequestChanges={(note) => sendBack(note)}
      onReject={() => reject()}
      onNavigate={(to) => router.push(`/${to}`)}
      workspace={{ name: "Northwind" }}
      user={{ name: "Alex Morgan", email: "alex@northwind.example" }}
    />
  );
}

Props

PlanReviewScreen props, from the screen contract.
PropTypeDefaultNotes
planobject—{ title, question?, planTitle, agent, target?, owner: { name, src? }, proposedAt, estimate: { time, cost }, steps: { id, label, tool?, target?, note?, needsApproval?, risk?: "low" | "medium" | "high", why? }[], changes?: { id, label, before, after, delta, direction, sentiment?, why? }[], changesPeriod?, autonomy?, autonomyOptions?, decision?: "pending" | "approved" | "changes-requested" | "rejected", decisionNote? } The plan as the agent proposed it (the saved version). title is the page h1; question is the PlanReview heading (default "Run this plan?"). The status line counts the working steps and shows estimate.time and estimate.cost as given; the estimate also ends What the plan changes as two neutral rows (Run time, estimated and Run cost, estimated). A step with risk "high" puts a warning Alert above the plan that names it and says whether it waits for your OK. decision left out: the screen keeps it, and Approve, Request changes and Reject set it with a note and the time. Sample billing-fix plan when omitted.
stepsarray—Starting working copy of the steps when it differs from plan.steps, such as a draft kept from an earlier visit. The screen keeps edits itself; while the copy differs from plan.steps the status line says Edited and an info Alert names the changes ("1 step removed · order changed") with Undo changes. Default plan.steps.
onEditStepfunction—(step) => void. Save step on an edited step, or a new step from Add step.
onRemoveStepfunction—(stepId) => void. Remove on a step.
onReorderfunction—(stepIds) => void. Move up or Move down on a step: every step id in the new order.
onAutonomyChangefunction—(autonomy) => void. The AutonomyDial stop for this run.
onApprovefunction—({ autonomy, steps }) => void. Approve plan, the page's one solid primary, or ⌘/Ctrl+Enter in the block. steps is the working copy, so approving saves the edits.
onRejectfunction—() => void. Reject (outline neutral), or Escape in the block.
onRequestChangesfunction—(note) => void. Request changes opens "What should change?"; Send request sends the note and the plan shows Changes requested with it.
workspaceobject—{ name: string, icon?: KitIcon } App nav brand (and the Drawer title below --grid-breakpoint-md). Same shape as SettingsPreferencesScreen. Example workspace when omitted.
userobject—{ name: string, email?: string, src?: string } Account menu at the foot of the app nav (kit DropdownMenu: the avatar on the rail, the account card in the Drawer, both with src as the photo and an online presence mark; the menu holds View profile, Account settings, Documentation, Switch account with a sample second account, Add account and Sign out, all samples that only close the menu except Account settings, which goes to a Settings row when the screen has one). Same shape as SettingsPreferencesScreen. Example person when omitted.
onNavigatefunction—(destination) => void. destination is "overview" | "agents" | "runs" | "workflows" | "tools" (app nav rows; "runs" also from All runs in the … menu).
loadingbooleanfalseNav and PageHeader title stay; Skeletons for the plan and the side column (one Loading plan label); main is aria-busy.
emptybooleanfalseKit Empty (no-data) "No plan yet" in place of the block. Also shown when plan.steps is [].
classNamestring—On the root layout-shell.

States

  • page: default, loading, empty, edited, high-risk, changes-requested
  • plan: planned (pending: steps editable, dial on, decision row pinned), edited (status line says Edited; an info Alert names the changes, with Undo changes; Approve plan saves them), high risk (a warning Alert names the High risk step and whether it waits for your OK), changes requested (the plan and dial lock; the outcome Alert shows the note sent to the agent), approved and rejected (the plan and dial lock; the outcome Alert says so)
  • layout: steps beside What the plan changes over the AutonomyDial (block 64rem and wider), one column, the side column under the steps (block narrower than 64rem: at a 1024 viewport with the nav, and below), one column with the decision buttons on full rows, pinned at the bottom (below --grid-breakpoint-sm)

Accessibility

  • Renders its own <main> named Plan: <title>; the app SideNav is an aside named App. Don't wrap the screen in another main
  • PageHeader title is the page h1; PlanReview is a section with an h2 (the question), the plan card an h3, and the decision a section with its h3
  • The steps are an ordered list. Move up and Move down are icon Buttons named with the step ("Move step 2 up: Round once per invoice"); focus stays on the arrow and the new position is announced politely. No drag
  • Risk is a Badge with the word (Low risk, Medium risk, High risk), never colour alone; the High risk Alert names the step in text
  • Approve plan sits in the section named by the question and is described by the line that says how many steps wait for your OK at the chosen autonomy
  • ⌘/Ctrl+Enter approves and Escape rejects while focus is in the block and not in a text field; the key hint is aria-hidden and hidden on touch screens and below --grid-breakpoint-sm
  • Request changes opens a kit Field + Textarea labelled What should change?; it takes focus, Escape cancels
  • The decision row is pinned but stays last in reading order
  • Below --grid-breakpoint-md the nav opens from an IconButton named Menu into a kit Drawer
  • loading sets aria-busy on main and the Skeletons say Loading plan once
  • No motion of its own

Responsive

  • Wide: SideNav on the canvas, the page on the inset panel; in the block the steps take the primary column and What the plan changes over the AutonomyDial the secondary one
  • The block stacks by its own width (below 64rem): the side column moves under the steps, at a 1024 viewport too
  • Below --grid-breakpoint-md: the nav moves into a left kit Drawer
  • Below --grid-breakpoint-sm: one column; Reject, Request changes and Approve plan take full rows, pinned at the bottom of the page
  • Dark mode follows the root theme; semantic tokens only

Do not

  • Do not copy the screen's parts into a local cousin; change it through its props or compose PlanReview yourself
  • Do not wrap it in an app shell or another main
  • Do not add a second solid primary Button; Approve plan is the only one
  • Do not show risk by colour alone or reorder by drag only
  • Do not use raw hex

Built from

  • Block
    →

    Plan review

    The go / no-go before an agent runs: edit its steps, see what will change, then approve, send back or reject.

  • Block
    →

    Run detail

    One agent run on one screen: clock, cost, pending approval and every step, all following the step you pick.

  • Component
    →

    AgentPlan

    What an agent intends to do, before or during a run.

  • Component
    →

    ApprovalCard

    The agent asks before it acts: risk, what will happen in words, an exact preview of the command or diff, and Approve (⌘/Ctrl+Enter) / Deny (Escape) with an optional auto-deny countdown.