Repository navigation
feat(studio): port the prototype's chat transcript and delegation views - #2254
Conversation
57ea6b7 to
b940dd7
Compare
b940dd7 to
eca9547
Compare
eca9547 to
e1e873c
Compare
e1e873c to
f6b0938
Compare
9f7fd94 to
0077545
Compare
0077545 to
2249011
Compare
f9fb24e to
34873fa
Compare
… and delivery notes Before the transcript takes the prototype's look, pin what a reader can find in it: each tool call's name, arguments, result, and failure, the Show Tools rule and an ask's exception, the row's open action and the tool panel; the subagent, parallel, and team cards in their running, done, failed, and unknown states; the selection toolbar's Copy and Add to canvas; and a scheduled delivery note's schedule, fire, outcome, and plain-text body. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…tion cards The chat transcript takes the prototype's look (stack-08) on Studio's chat logic: - Rows: an avatar for both speakers, the name, the body, and a Copy and side-thread action column that shows on hover or focus (always on touch). The side thread uses the same rows. - Tool calls: one "Activity: N tools" disclosure per turn that follows Expand details, with a status dot, the friendly MCP name, clamped arguments, and a one-line result per call. A finished Edit or Write shows its diff; the head opens the tool panel, which shows the status, the input as a diff with Raw, and the whole output. A call's ask or authorization still sits in its row and holds the disclosure open. - Delivery notes: the prototype's card, with the schedule, the fire, an outcome badge, and the plain-text body clamped behind Show more. - Markdown: the dark code panel, and list and paragraph spacing. - Delegation: the prototype's chips (subagent, team member, and a parallel group with its branches as inner pills), its roster glyphs and tab look in the activity panel, and the header's fleet chip, which opens the panel on a family. - The minimap becomes the prototype's dashes with a hover preview, the developer steer trace moves above the queued strip in the prototype's dashed line, and the selection toolbar gains Add to chat, which adds the selection to the composer's draft. Studio's semantics stay: the fleet reducer and placement, the Show Tools rule, the verdict and authorization flows, the delivery note's contract data, markdown safety, the edit-diff caps, and the minimap's navigation. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…at the bottom The transcript followed new messages only, so a card that grew in place (a delegation card, an ask, a highlighted code block, an image) left a reader who sat at the bottom behind it. Observe the content's size as well: while the reader is at the bottom, and not jumping through the minimap, a resize scrolls to the end. A reader who scrolled up stays put. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- The fleet chip reads the chat header's width: full labels only in a wide header, the compact glyphs below that, and no chip in a narrow one, so the title keeps its room beside Activity, Canvas, the run badge, and Stop. - A row's Copy and side-thread actions sit on its author line instead of a column of their own, so a phone keeps the text width. - The activity panel's family tabs let their count wrap under the label in a narrow panel, and roster rows fill the panel's width. - Inline code wraps only where it must. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ds, and actions The Activity line and its tool rows, the tool panel, delegation cards and the header's family counts, the minimap's preview, the per-message Copy and side-thread actions, and the selection toolbar's Add to chat. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A truncated line keeps its full text in its hover title, which a phone can't show, so the outcome at the end of the line was lost there. Below 500px the lines wrap instead. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A chip truncates its line and keeps the whole line as its hover title, which a phone can't show, so a child's state and facts were cut off there. Below 500px a chip's line (and a failed child's cause) wraps and the chip grows a line instead. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A fence with no language (and an indented code block) reached the code renderer without a language class, so it took the inline chip's light background inside the dark panel: near-white text on near-white in the light theme. Code inside a panel now always renders as a block with the panel's dark tone, labelled or not. The hast node no longer leaks onto the DOM as a node="[object Object]" attribute. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Each dash was a 12px-tall button on every pointer, too small to hit with a finger. On a coarse pointer a dash is now a 44px-tall button with the same 3px mark inside; a mouse keeps the prototype's 12px pitch. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The tool panel kept the call it was opened on, so a panel opened while the call ran said "(still running)" after the output arrived. The panel now resolves its call (run and id) from the transcript on each render, like the authorization review, and keeps the opened snapshot only when the row is gone. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copy and the side-thread action were 24px buttons on every pointer. On a coarse pointer they are now 44px; a mouse keeps the prototype's compact actions. The browser journey's long-chat fixture moves into a helper so the new touch check can share it. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The header's family tally counted every child that wasn't running as done, so a child Studio stopped following before it reported an outcome read as finished. Such children now get their own count: "· N unknown" in the label and "N?" in the compact form, shown only when there are any. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The 44px row actions on a coarse pointer made each author line 44px tall, so the name sat below its avatar and every turn grew. A negative vertical margin keeps the 44px target while the author line keeps its 24px height. The touch check now also asserts the line's height. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The transcript's new list styles replaced react-markdown's list elements with ones that dropped its attributes. An ordered list split by a code block lost its start number, so steps read 1, 1, 1, and a GFM task list lost its classes, so each checkbox also got a bullet. The list elements now pass react-markdown's attributes through, and a task list drops the bullet. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
34873fa to
08ddeb1
Compare
kantord
left a comment
There was a problem hiding this comment.
Approving. I reviewed the diff with an independent reviewer and a skeptic pass. No blockers found: markdown, link and image handling is unchanged, with no new clickable-link or external-image path; delegation and delivery cards can't be mistaken for another speaker; CI is green.
Non-blocking follow-ups are in #2303, section E: tool-row aria-label drops the status for screen readers, bounded tool-output summaries, hidden labels in copied selections, scroll-follow pulling the reader down when they expand something (needs a small design call). Not tracked, since checked and judged fine: collapsed tool rows still render diffs (cost is small and memoized), and the long-goal delegation chip (the glyph, tint and panel carry the state).
Fully or partially written by an AI agent.
Summary
This is the Transcript and Delegation step of the chat alignment (#2207, part of #2210): step 3 of 4, after the approvals (#2251) and the composer (#2253), and before the session dialogs. It's stacked on #2253, so review that first.
The chat transcript now comes from the prototype (
stack-08): its message rows with avatars and row actions, the per-turn Activity line of tool calls with inline Edit diffs, the tool panel, the dark code panel, the scheduled-delivery card, the selection toolbar with Add to chat, the dashed minimap, and the steer-trace line. Delegated work takes the prototype's chips, its activity-panel look, and the header's fleet chip.The prototype's UI runs on Studio's chat logic. These are unchanged:
run-stream.ts,use-chat-messages.ts, and the transcript's row memoisationdelegation-fleet.ts(the subagent, parallel, and team shapes and their observed facts) anddelegation-placement.tsmarkdown-message.tsx's safety: link, image, and URL handlingedit-diff.tsx's caps and labelsaria-currentWhat changed
Message rows (
message-bubble.tsx, new;chat-transcript.tsx)Tool calls (
tool-call-list.tsx, new;tool-summary.tsandlib/tool-names.ts, ported)Tool panel (
content-preview-panel.tsx)Markdown (
markdown-message.tsx,code-highlight.tsx)Delivery notes (
delivery-note-card.tsx, ported)Delegation (
delegation-card.tsx,delegation-panel.tsx,fleet-status-chip.tsx, new)Minimap, steer trace, and selection (
message-minimap.tsx,steer-trace.tsx,text-selection-toolbar.tsx, new)ChatComposertakes it asappendText.Scroll follow (fix)
Docs
user-docs/operating/studio.mddescribes the Activity line and the tool panel, delegation cards and the header's counts, the minimap's preview, the row actions, and the selection toolbar.Differences from the prototype
CodeBlock(a file-preview component) andtranscript-actions.tsx(Select conversation and Copy conversation in the chat menu) belong to the file preview and the chat menu, which are step 4.tool-diff.tsxwas already Studio'sedit-diff.tsx.[steer] id decisionfrom the steer request's reply (Studio alignment: chat UI from the prototype on Studio's chat logic #2207's open decision stays on the stream-derived outcome).Visible change
No regression
Pinning tests
a0a192320was committed first, alone. It passes on the base (7ef2c69af) and on this branch, unchanged:chat-transcript.pinning.test.tsx(21 tests):chat-workspace.selection.pinning.test.tsx(3 tests): Copy copies the selection, Add to canvas quotes it into the canvas, and an empty selection offers nothing.Before the implementation, one pin's open-action query gained
{ hidden: true }, so it finds the action whether or not the call's line is open. It passed on the base before and after that change.New tests
transcript-alignment.test.tsx(17 tests): the Activity line's summary, its closed and open states under Expand details, its hold while an ask is pending, the finished-only diff, the friendly MCP name and its open action; the tool panel's diff, Raw, running state, and exact MCP name; the row actions, wired and not; the avatars; the delivery badge's mapping and its clamp; the fleet chip's counts, its empty state, its open action, and the panel's requested family; the minimap's preview and dash widths; the steer trace's lines.chat-workspace.transcript-alignment.test.tsx(2 tests): Add to chat adds the selection to the draft and focuses the box; the transcript follows a card that grows at the bottom, and doesn't move a reader who scrolled up. Without the fix, the second test fails ("Nothing observes the transcript's content"); this was checked by removing the observer.tool-summary.test.tsandlib/tool-names.test.ts, ported with the helpers.Modified tests
None. These pass with their assertions unchanged:
chat-workspace.integration.test.tsx,chat-workspace.transcript.integration.test.tsx,delegation-workspace.test.tsx,delegation-card.test.tsx,delegation-panel.test.tsx,approval-interactions.test.tsx,approval-shortcuts.test.tsx,authorization-review.test.tsx,message-minimap.test.tsx,steer-trace.test.tsx,chat-transcript.test.tsx,edit-diff.test.ts,truncated-text-tooltips.test.tsx,content-preview-panel.test.tsx,code-highlight.test.ts, the side-thread and side-panel suites, and every e2e chat journey (approvals, header Stop, delivery follow, message minimap, session activity, side panels, auth recovery).Gate counts
Both columns ran through the shared gate lock on the same machine. Base is
7ef2c69af(#2253's head; its counts are that PR's own head run), and this branch is57ea6b74d.7ef2c69af)57ea6b74d)task studio:browser)The 70 new web tests are the 24 pins, the 19 alignment tests, and the 27 ported helper tests (
tool-summary.test.ts,lib/tool-names.test.ts). The browser run includes the chat approval, header Stop, delivery-follow, message-minimap, session-activity, side-panel, and auth-recovery journeys on desktop and mobile Chromium.task docspassed:matlatl --strictreported 185 documents and 0 broken links. It also rewraps one line ofuser-docs/reference/server-cli.md, because the default workspace path depends on the checkout's path length; that change isn't part of this PR.Screenshots
Captured with a throwaway Playwright journey (Chromium, not committed), with offline BFF routes and a loopback activity stream that stays open for the running chats. The transcripts are the prototype harness's own fixtures (the flaky-scheduler chat, its side thread, the nightly digest), plus a failed call, a 40-message chat, a live and a finished delegation fleet, and a steered run. The clock is fixed at 2026-09-25 12:30 UTC, the time zone is
Europe/Rome, and the locale is en-US. Every surface was shot at desktop 1280×800 and mobile 390×844, in light and dark.Before is the base (
7ef2c69af, #2253's head) and after is this branch's head (57ea6b74d). Each tree was captured twice. The after runs matched pixel for pixel apart from 6 px in one shot (the tool panel, mobile light); the before runs differed in three shots, by 1 to 74 px of anti-aliasing (the live delegation cards on a phone, the activity panel in desktop dark, and the scrolled long chat in desktop dark). Every pair was pixel-compared, and red boxes mark the regions that differ. Desktop composites are downscaled to 1600px wide.The Prototype column comes from the prototype harness (
stack-08): the gallery where it has the surface, and new captures for the selection toolbar, the tool panel, the minimap preview, and the parallel group's panel. Its chats differ where noted, so it's a visual reference, not the same content.Transcript
Transcript with tool calls, collapsed
Intended change: the prototype's rows (avatar, bold name, body) and, with Show Tools on, one collapsed Activity: N tools line per turn naming the tools. Before listed every call's full input and result inline. Matches the prototype, except that Studio keeps its centred column, and the row actions sit on the author line (see the phone shots).
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Transcript scrolled to the top
Intended change: the same rows from the top of the chat. Matches the prototype.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Tool calls expanded, with an Edit diff
Intended change: under Expand details, the Activity line opens to one row per call (status dot, plug glyph, name, clamped arguments, one-line result), and a finished Edit shows its diff under its row. Matches the prototype. The diff is Studio's
edit-diff.tsx, with its caps and labels.Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Markdown and a code block
Intended change: the prototype's dark code panel in both themes (Studio keeps its Shiki highlighting, in the dark theme's colours), bulleted lists, and paragraph spacing. Before, lists had no bullets. Matches the prototype, except the syntax colours, which the prototype drops.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
A failed tool call
Intended change: the failed call's dot is red, its result is tinted, and the Activity line says 1 failed. Matches the prototype's treatment; the prototype harness has no failed-call fixture, so its column is the expanded transcript.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Tool panel
Intended change: selecting a call's row opens the prototype's tool panel: the status, Input — diff with Raw for an Edit or Write (else the formatted arguments), and the whole output. The panel keeps Studio's title and frame. Matches the prototype.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Selection toolbar
Intended change: the prototype's toolbar, with Add to chat (new: adds the selection to the composer's draft), Copy, and Add to canvas. Matches the prototype.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Scheduled delivery notes
Intended change: the prototype's card: calendar icon, "Scheduled task", the schedule, the fire, and an outcome badge (started, completed, failed, or the stop word), with the plain-text body clamped behind Show more. Matches the prototype, except that the schedule name isn't a link: the card also renders outside the router (the transcript dialog and tests).
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Developer steer trace
Intended change: the trace moves from the top of the transcript to above the composer, in the prototype's dashed, muted, monospace line. It keeps Studio's stream-derived lines (run, message, event, outcome, promoted). The prototype harness can't reach its steer trace, so its column is a running chat.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
A long transcript, scrolled
Intended change: the same rows over a long chat, after a jump through the minimap. Matches the prototype.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Minimap
Intended change: the numbered boxes become the prototype's dashes, which widen around the pointer and preview the message beside the rail. The mark a reader jumped to stays tinted. On a phone the transcript keeps its right gutter, so the rail never covers a row's actions. Matches the prototype, except the gutter: the prototype's rail covers Reply in thread on a phone.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Side thread
Intended change: the thread uses the same rows and tool line as the transcript (before: chat bubbles, with a "1 tool call" box). The panel itself is step 4. Matches the prototype's rows.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Delegation
Delegation cards, live
Intended change: the cards become the prototype's chips: a state glyph (pulsing dot, alert, or branch) and one line of Studio's observed facts. A failed child is tinted and shows its cause; a parallel group is one chip with a pill per branch; each team member has its own chip. The header gains the prototype's fleet chip, one count per family, which opens the activity panel on that family. Matches the prototype, except the wording, which stays Studio's ("Subagent child-a · Running · Tools: 3"), the parallel group's single chip, and the fleet chip's compact form (Studio's header also carries Activity, Canvas, the run badge, and Stop).
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Delegation cards, finished
Intended change: the same chips once every child has settled: a finished subagent, a parallel group with its winner and a failed branch, and a team whose lead is done and whose second member stopped on its budget. The prototype harness has no finished fleet, so its column is the live one.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Activity panel, subagent
Intended change: the prototype's tab strip and roster rows (state glyph, compact text), uppercase section labels, and monospace trace rows. The structure stays Studio's: the roster above the focused child's details, under its "Session activity" title. Matches the prototype's look; the prototype replaces the roster with a focus view and a Back button.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Activity panel, parallel group
Intended change: the same look on a parallel group: its join, branch count, and the branches as roster rows. Matches the prototype's look.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Activity panel, team member
Intended change: the same look on a team: the member's details, its trace, then the roster, tasks, and findings. Matches the prototype's look; the prototype puts tasks and findings behind a toggle.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
The prototype reference code is on
stack-08, inapps/web/src/features/chat/:chat-view.tsx,message-bubble.tsx,tool-call-list.tsx,tool-call-panel.tsx,tool-diff.tsx,code-block.tsx,transcript-actions.tsx,text-selection-toolbar.tsx,delivery-note-card.tsx,steer-trace-line.tsx,message-minimap.tsx,delegation-card.tsx,delegation-panel.tsx, andfleet-status-chip.tsx.Review fixes
Fixes from the final regression and security review of the stack (stack #2227). Each one comes with a test that fails without the fix.
57ea6b74d, passes now)<pre>panel always renders as a dark-tone block, labelled or not (indented blocks too). The hastnodeno longer leaks onto the DOM asnode="[object Object]".b5b479713markdown-message.test.tsx(3 cases)841318042e2e/message-minimap.spec.tsmeasures every dash on both projectsddd2081d5chat-workspace.integration.test.tsx"updates an open tool panel when its call finishes"6e7a36d8b,8227583f8e2e/message-minimap.spec.ts"a message row's actions are touch-size on a coarse pointer"622ee5229transcript-alignment.test.tsx"counts a child whose outcome is unknown apart from the done ones"Gates at
6272f8785:57ea6b74d)No assertion was removed. The minimap journey's long-chat fixture moved into a helper, so the new touch test can share it.
Screenshots
Before
57ea6b74d| After6272f8785| Prototypestack-08. The prototype column shows the matching surface, not the same data.Unlabelled fence. After matches the prototype's dark code panel.
More screenshots
Minimap and row actions on a phone. Deliberate deviation: the dashes and row actions are 44px touch targets, so the rail spaces its dashes further apart than the prototype. Desktop is pixel-identical to before.
Fleet tally with an unknown outcome. Deliberate deviation: the prototype has no unknown state; the header reads "0◐ 1✓ 1?".
Tool panel after the result arrives. After matches the prototype's completed panel.
Re-verification (2026-10-11)
start(steps read 1, 1, 1), and a task list lost its classes, so each checkbox also got a bullet. The list elements now pass the attributes through, and task lists drop the bullet. (2249011fa) Tests:markdown-message.test.tsx"keeps an ordered list's start number", "renders a task list with its checkboxes and no bullets" (both fail without the fix).Before and after the fix (the images are labelled with the pre-restack hashes):
More: mobile, dark
Gates on the restacked head
2249011fa:studio:checkpasses (web 1,329, server 210 tests). At the stack top (#2256):studio:browser118 passed, 30 skipped; themecated --mockintegration suite 8 passed. The browser suite takes 5.3 minutes on a CI runner.Commit hashes cited earlier in this body predate the restacks; the current commits keep the same subjects. Hashes in Review fixes are updated.
Refs #2207
🤖 Generated with Claude Code