Repository navigation
feat: coding agent workspace template - #57
Conversation
- `statusIndicator: 'rail' | 'rings'` on AgentsBuilder (default `rail`) picks how the sidebar and run panel show an agent's state - Rail: each agent's stretch of its project rail lights up, seamless and centred on the line: a light travels down it while running, amber or blue breathes while waiting, red holds on failure, dashed when queued - Rail, collapsed: a slim capsule beside each agent's square, the same size for every state, no words, nothing once a run is done - Rings: a ring before each name whose arc is the run's progress; in the collapsed rail it circles the initials, with the tag word below - `AgentSummary.progress` (0 to 1) feeds the arc; the template fills it from plan steps while a run plays - Run panel status lines, header, and "Run complete" use the chosen indicator; in-flight names and initials keep their shimmer
- ModelSelector: 30px rows, ring-shadow surface, side card no longer clipped by the popover, compact search and cost meter - Popover exports popoverSurfaceClass; CommandList gains density="compact" - FluidHighlight measures through a popup's scale-in (unscaledRect) - Tool, PlanTracker, ApprovalCard, AskCard, Message: status icon sizing, wrapping, alignment and dir="auto" fixes - ChatContainer merges a caller's ref with its own - workspace-kit: iconButtonClass, useElementSize and useScrollbarInset - agent-status: shared statusSignal; playback exports REDUCED_MOTION_DELAY - Tabs: reveal tabs wider than the strip; never scroll vertically - Theme: fine-pointer scrollbar styles move into the base layer so scrollbar-hide utilities win
A workspace for running several coding sessions at once: - Sessions in a tab strip or a project sidebar; each has a transcript built from the AI kit, a composer, a resizable side panel (diff review with line comments, file tabs, a browser tab, file tree) and a terminal dock - Harness model: sessions play a script, or show a host's events (`events` array or `createHarnessStore()`), folded by the pure `reduceHarness`; controls reach the host through onAction - Sub-agents, orchestrator/worker runs, messages between agents, handoffs, phases and a shared task board, with Agents and Tasks tabs - Worktrees, pull requests and CI checks as events; changes are kept per worktree; a toolbar chip shows each worktree's PR and failing checks - A conversation rail on the transcript's edge to preview and jump between turns; long threads render in chunks and diffs draw lazily - Demo data, stories (including a 120-turn stress test), tests, and the registry item
- New /blocks/coding-agent page with a live preview whose example picker opens the tabs layout, the sidebar layout, or a sub-agents session - "Driving sessions from your harness" guide with a store-based example - Split lib/application-blocks into one module per template; building blocks carry their own intro instead of a billing default
|
Review complete. 🟡 1 medium 💬 Inline comments (1)
🧹 Nitpicks (7) — 🟢 7 low
The change introduces two new registry application blocks — a full
Reviewed commit: 25997fd |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
This PR adds the coding-agent and agents-builder application blocks with their harness/playback state machinery, refactors the AI chat components, splits the application-block manifests into modules, and wires the new docs routes — overall solid, with only minor harness state-lifecycle and registry-manifest issues.
Key findings
- 🟡 Stopping the root run leaves its approval pending and resolvable — use-harness.ts:276
| setStatus(state, runId, isRoot ? 'idle' : 'cancelled'); | ||
| if (!isRoot) releaseParent(state, runId); |
There was a problem hiding this comment.
🟡 bug · medium
Stopping the root run leaves its approval pending and resolvable
When the root run is stopped while held at an approval, stopRun sets its status to idle (packages/ui/src/components/coding-agent/use-harness.ts:276), but reduceHarness only strips pending requests on cancelled/done/failed (packages/ui/src/components/coding-agent/harness.ts:444) — idle is excluded. The request therefore stays in view.pending, so RequestDock keeps rendering the approval card for a run that is at rest, while the tab reports idle. Worse, resolving the ghost card still emits: control() builds the host action from view.pending without checking the run's status (packages/ui/src/components/coding-agent/use-harness.ts:529-533), so a permission action with the stale requestId is sent to the host for a run that no longer exists, even though the local reducer correctly no-ops it.
📋 Prompt for AI Agents
In packages/ui/src/components/coding-agent/use-harness.ts, in stopRun (lines 260-278), before setStatus(state, runId, isRoot ? 'idle' : 'cancelled') at line 276, drop any pending request owned by runId: for each entry in state.view.pending with entry.runId === runId, emit { kind: 'request.resolved', runId, requestId: entry.request.id } (or filter the pending list directly) so the approval dock clears. Also update the ended check in packages/ui/src/components/coding-agent/harness.ts line 444 to treat a transition to 'idle' for a run that had a pending human request as ended, so host-driven flows behave the same. This prevents resolving an approval for a run that has already been stopped.
Adds a Coding Agent workspace template (
@constructive/coding-agent) for running several coding sessions at once, plus the shared kit changes it needs.Template
Harness model
A session either plays a demo script or shows a real harness's event log. Both are folded by one pure reducer, and controls reach the host as actions.
Kit changes
popoverSurfaceClassCommandList density="compact"iconButtonClassuseElementSize/useScrollbarInsetunscaledRect, whichFluidHighlightuses so it measures correctly while a popup scales indir="auto"fixes in Tool, PlanTracker, ApprovalCard, AskCard and Message.ChatContainernow merges a caller's ref with its own.statusSignal.@layer base, soscrollbar-hideand similar utilities win again for mouse users.Docs
/blocks/coding-agenthas a live preview with an example picker for the tabs layout, the sidebar layout and sub-agents.lib/application-blocksis split into one module per template.Stories
Templates/CodingAgent: Tabs, Sidebar, With terminal, Multi-agent, Multi-agent (sidebar), and Long thread (stress test). The break-ui stories add worst-case data.🤖 Generated with Claude Code
https://claude.ai/code/session_012nboNEcwNWwE4SXw9jxVAv