forked from bots-garden/ori
| ✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS | 1 | /** |
| 2 | * PlanView renders the agent's current execution plan (ACP "plan" updates) | |
| 3 | * as a compact checklist, like the plan block of Zed's agent panel. | |
| 4 | * | |
| 5 | * @example | |
| 6 | * <PlanView entries={[{ content: "Read the code", priority: "medium", status: "completed" }]} /> | |
| 7 | */ | |
| 8 | ||
| 9 | import type { AcpPlanEntry } from "../protocol"; | |
| ✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme | 10 | import { InlineText } from "./InlineText"; |
| ✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS | 11 | |
| 12 | const statusMarks: Record<string, string> = { | |
| 13 | pending: "○", | |
| 14 | in_progress: "◐", | |
| 15 | completed: "●", | |
| 16 | }; | |
| 17 | ||
| 18 | export function PlanView({ entries }: { entries: AcpPlanEntry[] }) { | |
| 19 | if (entries.length === 0) { | |
| 20 | return null; | |
| 21 | } | |
| 22 | return ( | |
| 23 | <details className="plan" open> | |
| 24 | <summary className="plan-summary"> | |
| 25 | Plan ({entries.filter((e) => e.status === "completed").length}/ | |
| 26 | {entries.length}) | |
| 27 | </summary> | |
| 28 | <ul className="plan-entries"> | |
| 29 | {entries.map((entry, index) => ( | |
| 30 | // biome-ignore lint/suspicious/noArrayIndexKey: ACP plan entries carry no id and the list is replaced wholesale on every update. | |
| 31 | <li key={index} className={`plan-entry plan-entry-${entry.status}`}> | |
| 32 | <span aria-hidden>{statusMarks[entry.status] ?? "○"}</span>{" "} | |
| ✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme | 33 | <InlineText text={entry.content} /> |
| ✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS | 34 | </li> |
| 35 | ))} | |
| 36 | </ul> | |
| 37 | </details> | |
| 38 | ); | |
| 39 | } |