Skip to content

feat(studio): show each turn's work in the Activity tab - #94

Merged
jm-rivera merged 2 commits into
feat/studio-chat-chartfrom
feat/studio-activity-log
Nov 1, 2026
Merged

jm-rivera merged 2 commits into
feat/studio-chat-chartfrom
feat/studio-activity-log

Conversation

@jm-rivera

@jm-rivera jm-rivera commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Each turn in Studio's Activity tab now shows what the assistant did for the question, so a turn with no errors no longer reads as "Show 31 completed steps" with nothing in view.

Changes

  • A turn opens with its question and an outcome line: start time, duration, cards made, and "N steps not done" in red when a failure stands.
  • The approved plan and the steps that ran a tool sit on the step rail More Info uses (.rail and .step from CardInfoPanel.module.scss); status lines stay in the full log behind "Show all N lines, with times".
  • A retry that worked folds into its step as "Worked on try N", which opens the tries with the cause once. A later step counts as a retry only when it arrived after the failed try settled, so parallel searches stay separate.
  • A failure that stands reads "Not done" with its full sentence, advice included; a skipped step reads "Not run".
  • A step that made a card shows the card's title and icon as a chip that brings the card into view (iconOf shared with WidgetChips.tsx).
  • turnView in src/lib/studio/activityView.ts builds the view as a pure function with tests; ActivityLog.tsx renders it and ChatPanel.tsx passes card titles, icons, plans and the waiting state.
  • recordStep and recordApproval in src/lib/studio/activity.ts number each turn's events as they arrive and stamp approvedAt, and restoreActivity keeps both, so retries fold and the plan row sits among the steps by arrival order. Older saves fall back to the clock, and a save with no approval time shows the plan at the top of the turn.
  • A restored turn that never closed reads as ended, with no running timer.

Notes for reviewers

  • Retries match by label and tool within a turn, and causeOf drops the ", so ..." advice from a recovered try by splitting the sentence. A retry_of and a cause field on activity.step from dfo-ai would make both exact.
  • motion-kit/render.tsx selects steps with activityStyles.step, since .tool no longer exists.

Testing: pnpm lint, pnpm lint:css, pnpm typecheck, pnpm test (2,275 pass) and pnpm build pass. A headless run against next dev with a stub studio stream approved a plan and checked the rail and full log.

Screenshots

Before is origin/dev and after is this branch, both run with next dev against a seeded local Postgres and a stub studio stream, at 1440 by 900.

Change Before After
Ended turn as first seen before 01 after 01
"Worked on try 4" opened Not present after 02
Full log opened before 03 after 03
Live turn after approving a plan before 04 after 04

The Activity tab showed failures and folded every step that worked
behind "Show N completed steps", so a turn with no errors told the
reader nothing. Each turn now opens with its question and an outcome
line, then lists the plan and the steps that ran a tool on the step
rail More Info uses, with each card a step made as a chip that brings
it into view. A retry that worked folds into its step as "Worked on
try N"; a failure that stands reads "Not done" with its full sentence.

`turnView` in src/lib/studio/activityView.ts builds the view, and
useChat stamps `approvedAt` on the turn when a plan is approved, so
the plan row sits among the steps.
@jm-rivera
jm-rivera added this pull request to stack #93 October 31, 2026 23:23
Browser receive times can tie when a failed try and its retry arrive
in one chunk, so the retry and plan placement rules misread them.
`recordStep` and `recordApproval` in activity.ts number each turn's
events as they arrive (`startOrder`, `settleOrder`, `approvedOrder`),
and `turnView` folds a retry or places the plan by that order, with
the clock rule kept for older saves. A saved plan with no steps list
counts none, so reopening it no longer throws.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant