Cowork C: activity timeline replaces tool pills #64

Merged
ryan merged 2 commits from feat/cowork-timeline into main 2026-10-12 18:36:31 -04:00
Owner

Task C from docs/cowork-ui-plan.md.

What

  • ActivityTimeline replaces ToolBubble. Consecutive tool calls in a turn render as one block:
    • While running: "Simba is working…", expanded, one row per call with an integration icon, the server label, a compact input summary (month: 2026-10 · group_by: category), a spinner/✓/✗ and the duration.
    • When done: collapses to "Simba worked · N steps · 4.2 s", which expands on click.
    • Rows with an artifact show an Open chip (onOpenArtifact prop; a no-op until #D wires the panel).
  • useChat:
    • Tool rows keyed by run_id, so parallel calls pair correctly.
    • TOOL_MESSAGES deleted; labels come from the server.
    • Falls back gracefully for older servers that send only {tool}.
    • Rows still running when a stream ends or is cancelled get ✗, so no spinner hangs.
  • Reload: rows rebuilt from the conversation payload (tool, label, artifact); old saved messages read the tool name from the [<tool> result] header.
  • src/api/artifactTypes.ts: shared ArtifactKind/ArtifactRef/Artifact types.
  • test-fixtures/cowork/mock-server.mjs: dependency-free mock /api (SSE scenarios) for Playwright checks.

Test plan

  • yarn build; tsc --noEmit shows only the existing MessageInput.tsx error
  • Playwright against the mock server, screenshots checked by eye: sequential tools, parallel tools with an artifact, tool error, legacy server, reload, 390 px mobile
  • Coordinator review, 2 passes (calendar-tool icon fixed)

🤖 Generated with Claude Code

Task C from `docs/cowork-ui-plan.md`. ## What - **`ActivityTimeline`** replaces `ToolBubble`. Consecutive tool calls in a turn render as one block: - **While running:** "Simba is working…", expanded, one row per call with an integration icon, the server label, a compact input summary (`month: 2026-10 · group_by: category`), a spinner/✓/✗ and the duration. - **When done:** collapses to "Simba worked · N steps · 4.2 s", which expands on click. - Rows with an artifact show an **Open** chip (`onOpenArtifact` prop; a no-op until #D wires the panel). - **`useChat`:** - Tool rows keyed by `run_id`, so parallel calls pair correctly. - `TOOL_MESSAGES` deleted; labels come from the server. - Falls back gracefully for older servers that send only `{tool}`. - Rows still running when a stream ends or is cancelled get ✗, so no spinner hangs. - **Reload:** rows rebuilt from the conversation payload (`tool`, `label`, `artifact`); old saved messages read the tool name from the `[<tool> result]` header. - `src/api/artifactTypes.ts`: shared `ArtifactKind`/`ArtifactRef`/`Artifact` types. - `test-fixtures/cowork/mock-server.mjs`: dependency-free mock `/api` (SSE scenarios) for Playwright checks. ## Test plan - [x] `yarn build`; `tsc --noEmit` shows only the existing `MessageInput.tsx` error - [x] Playwright against the mock server, screenshots checked by eye: sequential tools, parallel tools with an artifact, tool error, legacy server, reload, 390 px mobile - [x] Coordinator review, 2 passes (calendar-tool icon fixed) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ryan added 2 commits 2026-10-12 18:36:22 -04:00
Tool calls in a turn now render as one ActivityTimeline block: expanded
with "Simba is working…" while running (icon, label, input summary,
spinner/✓/✗, duration, Open chip for artifacts), collapsing to
"Simba worked · N steps · 4.2 s" when the turn finishes. useChat keys tool
rows by run_id (parallel calls), synthesises ids for legacy servers that
send only {tool}, and restores rows from the conversation payload.

Adds src/api/artifactTypes.ts (shared with the artifact panel) and a
dependency-free mock API server under test-fixtures/cowork/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
get_calendar_events / create_calendar_event never matched the "calendar"
prefix and fell back to the wrench icon; match "calendar" anywhere in the
tool name instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryan merged commit f2b02a188d into main 2026-10-12 18:36:31 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/simbarag#64