Closes #246. The transcript, composer and approval controls move from structured.ts/structuredRender.ts into components under web/src/components/structured/, against docs/STRUCTURED-VIEW.md: eight row kinds, both projections, the single-active approval nonce, and diff rendering with its own line counts. The pure layers stay shared — structuredDiff.ts computes the diff, structuredRender.ts still sanitizes markdown — and model.ts holds the client-side decisions (activity grouping, notice classification, offered decisions, `/` completion) so they are testable without a DOM. Like TerminalPane, the pane draws the body only; pane chrome reads the connection through onStatusChange. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
36 lines
926 B
TypeScript
36 lines
926 B
TypeScript
// The glyph column of a tool row's head. Recognition is narrow on purpose: an
|
|
// unrecognised or absent `ToolKind` gets the generic bullet, never a blank
|
|
// column and never a mark that stands for the wrong kind of work.
|
|
|
|
import type { AcpToolKind } from "../../types.js";
|
|
|
|
/** Glyph shown in a tool row's head, by `ToolKind`. */
|
|
const KIND_GLYPH: Record<string, string> = {
|
|
read: "≡",
|
|
edit: "±",
|
|
delete: "✕",
|
|
move: "→",
|
|
search: "⌕",
|
|
execute: "$",
|
|
think: "…",
|
|
fetch: "⇣",
|
|
switch_mode: "⇄",
|
|
};
|
|
|
|
export function toolGlyph(kind: string | undefined): string {
|
|
return (kind && KIND_GLYPH[kind]) || "•";
|
|
}
|
|
|
|
export interface ToolIconProps {
|
|
kind: AcpToolKind | string | undefined;
|
|
className?: string;
|
|
}
|
|
|
|
export function ToolIcon({ kind, className = "st-tool-glyph" }: ToolIconProps) {
|
|
return (
|
|
<span className={className} aria-hidden="true">
|
|
{toolGlyph(kind)}
|
|
</span>
|
|
);
|
|
}
|