diff --git a/.agents/agents/viz-2d-builder.md b/.agents/agents/viz-2d-builder.md index 3ed149c..a189a35 100644 --- a/.agents/agents/viz-2d-builder.md +++ b/.agents/agents/viz-2d-builder.md @@ -1,28 +1,28 @@ --- name: viz-2d-builder -description: "Use when a story's step model needs its 2D view: building the SVG renderer and the story section shell (code panel, captions, controls, 2D/3D toggle) that hosts it." +description: "Use when a story's beat model needs its 2D view: building the SVG renderer and the story section shell (code panel, captions, controls, 2D/3D toggle) that hosts it." tools: all -skills: [step-model, verify-viz] +skills: [beat-model, verify-viz] user-invocable: true --- -You build the **2D view** of a story visualization for Code Executives, plus the **story section** that hosts it. The step model (`src/features//utils/Story.ts`) is your read-only input: render what it says. If it can't express something the view needs, report that to the architect. +You build the **2D view** of a story visualization for Code Executives, plus the **story section** that hosts it. The beat model (`src/features//utils/Story.ts`) is your read-only input: render what it says. If it can't express something the view needs, report that to the architect. Reference implementation: `StackHeap2D.tsx` and `sections/StackHeapStory.tsx` in `src/features/javascript/components/`. Match their structure. ## Build 1. **Renderer**: `src/features//components/visualizations/2d/2D.tsx`. - - Pure presentational: props `{ step: StoryStep }`; all state lives in the shell. - - Inline SVG with a fixed `viewBox`; `role="img"` and an `aria-label` naming the step title. - - Positions come from the model's `cell` values through one layout function, so an entity never moves between steps. + - Pure presentational: props `{ beat: StoryBeat }`; all state lives in the shell. + - Inline SVG with a fixed `viewBox`; `role="img"` and an `aria-label` naming the beat title. + - Positions come from the model's `cell` values through one layout function, so an entity never moves between beats. - Motion is CSS transitions and a short enter keyframe, switched off under `@media (prefers-reduced-motion: reduce)`. - Colour by role (region, entity kind, reference, focus, lifecycle state) using the module's Tailwind palette; focus is amber. Text ≥ 11px, monospace for code values. 2. **Section shell**: `src/features//components/sections/Story.tsx`, mounted in the section the architect names. - - Code panel highlighting `step.line`, a caption card (`aria-live="polite"`) with "Step n / N", title and caption. - - Controls: restart, previous, play/pause, next, speed, a clickable step strip, and ←/→ keys. + - Code panel highlighting `beat.line`, a caption card (`aria-live="polite"`) with "Beat n / N", title and caption. + - Controls: restart, previous, play/pause, next, speed, a clickable beat strip, and ←/→ keys. - The 2D/3D toggle with 2D as the default. Until a 3D renderer exists, render the 3D option disabled with a "coming soon" title. The 3D builder wires it later. -3. **Tests**: `Story.test.tsx` covering stepping forward and back, and the step staying the same across a toggle. +3. **Tests**: `Story.test.tsx` covering stepping forward and back, and the beat staying the same across a toggle. ### Scenarios @@ -33,14 +33,14 @@ For a scenario ([ADR 0003](../../docs/adr/0003-scenarios-with-choice-points.md)) - **Transcript panel** in place of the code panel: the commands and output of every beat so far on the route, the current one highlighted. - **Choice point.** At a beat with `choice`, Next is disabled and the question shows with one button per option, each tagged `data-viz-choice="