Repository navigation
feat(studio): port the prototype's session dialogs, menus, and side panels - #2255
Conversation
04e7f6f to
e7e54db
Compare
e7e54db to
6eb6710
Compare
6eb6710 to
284bf2a
Compare
284bf2a to
c4f776f
Compare
c4f776f to
15be9fa
Compare
15be9fa to
d432aa9
Compare
d432aa9 to
e9eceb2
Compare
e9eceb2 to
87bdeb6
Compare
d4a2094 to
1d1179d
Compare
Pin the session surfaces' outcomes before their UI moves to the prototype's dialogs and menus: - each inspection view's data (details, saved transcript, soul, worktrees), a denied ID copy, and the selector rejection relist for a clear; - the inspect-only and proven-chat classification; - the debug consent's cancel and its binding to the open chat; - copying the session ID from the chat options and the details; - the chat list's select, inline rename, delete, folder filing, and the inspect-only group; - the side panels' focus and Escape order, the file preview's data paths, the canvas, and copying a side thread. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…anels The session surfaces now come from the prototype (stack-08) on Studio's session-inspection logic: - The session dialog's views take the prototype's details, saved transcript, soul, and worktree picker layouts. SessionInspection still owns every read, capability gate, the worktree choice, and the relist on a selector-specific rejection; each view only renders its data. - The Debug with AI consent is the prototype's dialog, over the same consent text, and still binds the debug chat to the open chat. - The chat options take the prototype's order: Compact, Clear, Fork, Switch worktree, a Copy submenu (Select conversation, Copy conversation, Copy session ID, Copy debug target ID), View transcript, Inspect session, Soul, Debug with AI, Rename, and Delete. - A chat list row's actions move into the prototype's row menu (copy, View transcript, Fork chat, Move to folder, Rename, Delete), and an inspect-only row takes the prototype's kind and Read-only badges. - The side panel frame takes the prototype's header and window controls; the file preview numbers a code file's lines; the canvas gains its toolbar with Copy and Clear; the side thread takes the prototype's header and composer card. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… narrow panel - On a phone, the chat options' Copy actions and a list row's Move to folder choices sit inline under a label: a submenu had no room beside the menu at 390 px and fell off the screen. - A side panel narrower than 22rem hides its "Esc to Close" hint, so the panel's title (Thread, Local canvas) is not truncated away. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ide panels Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Clear deleted every canvas note in one click, and the canvas has no undo. It now opens a confirmation; Cancel or Escape keeps the notes. The existing toolbar test confirms the dialog before it checks the cleared canvas. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Fork chat in a row's menu read the row's model before it posted the fork, and only the post counted as in flight. Forking from another row, or the fork shortcut, during that read started a second (and third) fork. A fork is now in flight from its first step to its end: a second start returns early, and every Fork chat entry is disabled meanwhile. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copy conversation headed a scheduled task's delivery note with the user's name, so the copy said the user wrote the agent's report. A note is now headed "Scheduled task <name>", as the transcript and the minimap show it. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A chat whose daemon withholds IDs (capabilities.copyId) still showed its ID in the saved transcript's description, and its debug target's ID in the details and the row menu's Copy debug target ID. The transcript names the chat by title only, the details say the target is unavailable, and the menu item is disabled with the daemon's reason, like Copy session ID. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The inspection dialog renders only while its row is in the chat list, but "inspection open" came from the request alone. When the row left the list (deleted in another tab, say), the dialog vanished while shortcuts and Escape stayed suppressed. It is now open only while its row resolves. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
At 1280px the model pill under the side thread's composer ran past the
panel's right edge ("Model Claude Sonnet 4.5 · Mediu"), because the
pill never shrinks. In the side thread the pill and its row may now
shrink: the model and effort truncate, and the trigger's title keeps
the whole choice. The chat composer's pill keeps its size and gains the
same title.
Refs #2207
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ation Confirming Clear empties the canvas, which disables the Clear button, so the dialog's focus return fell to the page. Escape then no longer closed the canvas, and a keyboard user lost their place. Focus now returns to the canvas field, or to the Preview toggle in preview mode. The confirmation also registered no shortcut scope, so ? and mod+shift+o acted on the chat behind it. It now suppresses app shortcuts while open. Refs #2207 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1d1179d to
a64d1d3
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: delete, fork, clear, rename and the debug-consent dialog all act on a captured session id and are gated by daemon capabilities; copy and export only use already-rendered text; CI is green.
One optional polish item is in #2303, section E: forkListedChat navigates to the new chat even if the user went elsewhere during the fork. The other candidates (parent id shown when ID copying is gated off, Fork/Clear/Debug on a debug chat, row-menu "View transcript" gating) were checked and dropped: the daemon already disables Fork and Clear for debug chats, and session ids are not secret.
Fully or partially written by an AI agent.
Summary
This is the Session surfaces step of the chat alignment (#2207, part of #2210): step 4 of 4, after the approvals (#2251), the composer (#2253), and the transcript and delegation (#2254). It's stacked on #2254, so review that first. With this PR, #2207 is complete across #2251, #2253, #2254, and this PR.
The session surfaces now come from the prototype (
stack-08): its details, saved-transcript, soul, worktree-picker, and Debug with AI dialogs; the chat options' order, with a Copy submenu for the whole conversation; a ⋯ menu on each chat in the list; the inspect-only rows; and the side panels' frame, the side thread, the line-numbered file preview, and the canvas toolbar.The prototype's UI runs on Studio's session logic. These are unchanged:
session-inspection.tsx's reads and gates: every query, the capability and online checks, the worktree choice, its eviction when the picker closes or the session changes, and the relist only on aplacement_selector_*rejectionisInspectOnlySession,isProvenChatSession)debug-session.ts) and its binding to the open chatGET /api/v1/soulandGET /api/v1/sessions/{id}/worktrees; no contract changesWhat changed
Session dialogs (
session-details-dialog.tsx,transcript-dialog.tsx,soul-dialog.tsx,worktree-picker-dialog.tsx,debug-session-dialog.tsx, new;session-inspection.tsx)SessionInspectionkeeps the data and the rules; each new file is a view over them.Chat options (
chat-workspace.tsx,transcript-actions.tsx,transcript-text.ts,session-copy-menu-items.tsx,session-row-action-items.tsx, new)Session list (
session-sidebar.tsx,lib/session-kinds.ts, new)Side panels (
side-panel-shell.tsx,content-preview-panel.tsx,side-thread-panel.tsx,code-block.tsx, new)CodeBlock(Shiki colours, in the page theme); Markdown, images, and text in the prototype's padding. Studio's one-line note stays, now pinned to the top.Docs
user-docs/operating/studio.mddescribes the dialogs' extra facts, the chat options' direct entries and Copy actions, the row menu, the inspect-only labels, the file preview's line numbers, and the canvas toolbar.Differences from the prototype
Visible change
No regression
Pinning tests
083c37c50was committed first, alone. It passes on the base (57ea6b74d) and on this branch, unchanged. To check the base, the branch's implementation files were swapped back to the base's (git checkout 57ea6b74d -- apps/web/src) with the pins kept, and the three pin files passed (25 tests); thenHEADwas restored.session-surfaces.pinning.test.tsx(11 tests): the inspect-only and proven-chat classification (truth tables); the details' facts and its ID copy; a denied copy hides the ID and copies nothing; the saved transcript's order, roles, and incomplete mark; the soul's body and source, and an absent soul; the worktrees' label, branch, and revision, and the empty state; the relist after a selector rejection of a clear, with the choice cleared; the debug consent's cancel (nothing created) and its binding to the open chat; copying the session ID from the chat options.session-sidebar.pinning.test.tsx(6 tests): selecting a row andaria-current; inline rename with the trimmed title; delete through the owner's confirm; filing into a folder, out of it, and into a new one; a denied rename and delete; the inspect-only group without chat actions.side-panels.pinning.test.tsx(8 tests): the close control takes focus, Escape closes, and focus returns to the opener; an open menu takes Escape first; the chat surface's Escape order; the close control; the canvas edit and preview; the file preview's code, Markdown, image, text, and no-preview paths, and its local note; copying a side thread.The row actions' and chat options' helpers reach an item whichever control holds it (an icon button, a top-level item, or a submenu item) and select it from the keyboard, so the pins pass on both trees. Those helpers were settled before this branch's implementation commit and folded into the pin commit.
New tests
session-surfaces.alignment.test.tsx(11 tests): the chat options open the transcript, soul, and worktree views directly, and hide what the connection or chat doesn't offer; Select conversation selects only the transcript and Copy conversation copies it with headings; the Copy actions inline on a phone; Compact conversation; a row's View transcript for another chat without leaving the open one (and no Debug with AI there); a row's Fork chat with that row's model; a row's ID and debug-target copies; the transcript's tool-call line and empty note; a debug chat's target and its copy; an untrusted, drifted soul.side-panels.alignment.test.tsx(4 tests): line numbers in the code preview; the canvas's Copy, Clear, and pressed view; the panel's controls; an inspect-only row's kind and Read-only badges.code-block.test.tsx,transcript-text.test.ts,lib/session-kinds.test.ts(6 tests), with the ported helpers.Modified tests
None. These pass with their assertions unchanged:
session-inspection.test.tsx,side-panel-shell.test.tsx,content-preview-panel.test.tsx,chat-workspace.integration.test.tsx,chat-workspace.transcript.integration.test.tsx,approval-interactions.test.tsx,steer-trace.test.tsx,chat-escape.test.tsx, and every e2e journey, includingsession-inspection.spec.ts,side-panel-shell.spec.ts, andchat-header-stop.spec.ts.Gate counts
Both columns ran through the shared gate lock on the same machine. Base is
57ea6b74d(#2254's head; its counts are that PR's own head run), and this branch is04e7f6f70.57ea6b74d)04e7f6f70)task studio:browser)The 46 new web tests are the 25 pins, the 15 alignment tests, and the 6 ported helper tests. The browser run includes the session-inspection, side-panel, chat approval, header Stop, delivery-follow, message-minimap, session-activity, 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. The chats are the prototype harness's own (the flaky-scheduler chat and its side thread), with the prototype's soul, worktrees, and placement, plus two inspect-only sessions (a scheduled run and a subagent). The file previews attach the prototype tour's
logger.tsandjose-migration-guide.md, and a PNG of its chart. The clock is fixed at 2026-09-25 12:30 UTC, the time zone isEurope/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 (
57ea6b74d, #2254's head) and after is this branch's head (04e7f6f70). Each tree was captured twice; both pairs matched pixel for pixel on all 64 shots. Every before and after pair was pixel-compared, and red boxes mark the regions that differ. Before has no direct dialog entries, so each dialog is opened from Inspect session on both trees. 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 Copy submenu, the row menu, the tour's Markdown and image previews, and the 390 px row actions. Its chats differ where noted, so it's a visual reference, not the same content.Session dialogs
Session details
Intended change: the prototype's details dialog: a description, the ID in a box with Copy, and one labelled row per fact (title with its provenance chip, state with a dot, kind, permission mode, safety level, provider, model, effort, context window, placement, branch, revision, created, turns). Matches the prototype, except: the state stays the daemon's word, the token counts stay (Studio shows usage here), the prototype's tool-call count and limits are absent (Studio's contract has neither), and the strip of view switches under the header stays (see Differences).
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Saved transcript
Intended change: the prototype's replay: a role badge per turn, an activity line for a turn's tool calls, and the chat's title and ID under the dialog title (before: a bordered card per saved row, including empty tool rows). Matches the prototype, except the dialog keeps Studio's title, "Saved transcript".
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Soul inspection
Intended change: the prototype's soul view: source, trust, and size badges, the body in a monospace box, and its SHA-256 (before: "Provenance: user" and the raw text). Matches the prototype, except the title stays "Soul inspection".
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Worktree picker
Intended change: the prototype's worktree cards: the label, the branch as a chip, and a short revision, with a note on what fork and clear bring. Matches the prototype's list. Studio keeps its two actions, Clear in selected worktree and Fork in selected worktree, where the prototype has a "What to bring" choice and Switch: same operations, one step fewer, and the relist rule's tests name them.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Debug with AI consent
Intended change: the prototype's consent dialog, over Studio's consent text. Matches the prototype; the only visible change is the title's trailing question mark.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Inspect-only session, opened
Intended change: an inspect-only session (a scheduled run here) opens on the same details dialog, with the list's new inspect-only rows behind it. Matches the prototype's details layout; the prototype opens an inspect-only row's transcript instead, Studio keeps its read-only landing.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Menus
Chat options
Intended change: the prototype's order and grouping: token usage; Show Tools, Expand details, the steer trace; Compact, Clear, Fork, Open local canvas (phone), Switch worktree…; a Copy submenu; View transcript, Inspect session, Soul, Debug with AI; Rename, Delete. Matches the prototype, except the item that opens the details is still named Inspect session (the prototype's "Session details"), the steer trace and Debug with AI stay, and on a phone the Copy actions sit inline under a "Copy" label.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Chat options, Copy
Intended change: Copy opens Select conversation, Copy conversation, and Copy session ID (before: Copy session ID alone, at the top level). Matches the prototype on desktop. On a phone they sit inline in the menu, because the prototype's submenu has no room beside the menu at 390 px and falls off the screen.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Session row menu
Intended change: a chat row's three hover icons (move, rename, delete) become the prototype's ⋯ menu: Copy session ID, View transcript, Fork chat, Move to folder, Rename, Delete. Rows also regain their title width. Matches the prototype, except Debug with AI isn't in the row menu (it stays bound to the open chat), the ⋯ stays visible on a phone instead of a long-press sheet, and Move to folder is inline on a phone. The prototype's phone column shows its list: its row actions open from a long press, which the harness can't send.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Session list
Inspect-only rows
Intended change: each inspect-only row takes the prototype's eye glyph, a kind chip, a Read-only badge whose tooltip is the daemon's reason, and the relative time (before: title and state). Matches the prototype's rows. Studio keeps its "Inspect-only sessions" group, where the prototype groups runs by recency under Scheduled; the prototype column shows its list.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Side panels
Side thread with replies
Intended change: the panel takes the prototype's frame: a thread glyph and title, the window controls (maximize and an X), a 64 px header on the chat header's seam, and the prototype's composer card. A narrow panel hides the "Esc to Close" hint so the title stays. Matches the prototype, except the thread still shows its own transcript without the prototype's root-message card and reply count: Studio's thread is a fork that carries the chat's history (see Differences).
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
File preview, code
Intended change: a code file opens in the prototype's line-numbered viewer, in the page's theme, under the prototype's header. Matches the prototype, except Studio keeps its one-line note ("Local preview · 1.8 KB · not sent to Mecatl"), which the prototype dropped.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
File preview, Markdown
Intended change: the prototype's reading padding and type size for a Markdown file. Matches the prototype, with the same note.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
File preview, image
Intended change: the prototype's padded, rounded image. Matches the prototype, with the same note. (Studio's fixture is a PNG of the prototype tour's chart; Studio's image previews accept raster images.)
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Canvas
Intended change: the prototype's toolbar above the editor, with the view switch as a pill, Copy canvas, and Clear canvas; "Saved only in this browser." moves under the editor. Matches the prototype, except the views keep Studio's names, Preview and Edit (the prototype's Styled and Raw), and the canvas has no maximize control.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
Phone check
Reply in thread at 390 px
No change intended. At 390 px the row actions, including Reply in side thread, sit clear of the minimap: the screenshot journey asserts that the element on top at the button's centre is the button itself, on both trees. The prototype's rail covers its Reply in thread and Open in detail panel at this width.
Dark and mobile
Desktop, dark:
Mobile, light:
Mobile, dark:
The prototype reference code is on
stack-08, inapps/web/src/features/chat/:session-details-dialog.tsx,soul-dialog.tsx,transcript-dialog.tsx,transcript-text.ts,worktree-picker-dialog.tsx,debug-session-dialog.tsx,session-copy-menu-items.tsx,session-row-action-items.tsx,transcript-actions.tsx,side-thread-panel.tsx,file-preview.tsx,code-block.tsx,local-canvas-panel.tsx,side-panel.tsx,inspect-session-list.tsx, andlib/session-kinds.ts.#2207 is complete across #2251 (approvals), #2253 (composer), #2254 (transcript and delegation), and this PR (session surfaces).
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.
04e7f6f70, passes now)c8ed0f2f4side-panels.alignment.test.tsx"asks before Clear wipes the canvas…"; the existing toolbar test now confirms the dialog before it checks the cleared canvas7b8056aa4session-surfaces.alignment.test.tsx"forks only once while a fork is in flight" (on the old head: three forks)d8db757fctranscript-text.test.ts3427c08d4session-surfaces.alignment.test.tsx"withholds every ID, the debug target's too…"inspectionOpenstuck when the row disappearedinspection && inspectionSession, so shortcuts and Escape come back when the dialog unmounts.7033b5fc6session-surfaces.alignment.test.tsx"releases the shortcuts when an inspected row leaves the list"titlekeeps the whole choice.504a281d8e2e/side-panel-shell.spec.ts"the side thread's model pill stays inside the panel" (old head: pill ends at 1308px in a 1280px viewport)Gates at
983dcf706:04e7f6f70)task docsNo assertion was removed. One
studio:checkrun failed once onchat-composer.alignment.test.tsx("clears the stored draft…", a #2253 test this PR doesn't touch, with asocket hang up). It passed 5 times alone and in the two full reruns.Screenshots
Before
04e7f6f70| After983dcf706| Prototypestack-08.Canvas Clear asks first. Deliberate deviation: the prototype clears in one click; Studio confirms because the canvas has no undo.
More screenshots
A debug chat that withholds IDs: row menu. Copy debug target ID is disabled with the daemon's reason, like Copy session ID. The prototype has no copyId gate.
Saved transcript of that chat. The description names the chat without its ID.
Side-thread model pill at 1280px. It now ends inside the panel, with the value truncated. Mobile is pixel-identical to before.
Re-verification (2026-10-11)
?and mod+shift+o acted on the chat behind it; it now suppresses them while open. (87bdeb6bd) Tests:side-panels.alignment.test.tsx"keeps focus in the canvas after a keyboard Clear, in both views", "blocks app shortcuts while the Clear confirmation is open" (both fail without the fix). No visible change.Gates on the restacked head
87bdeb6bd:studio:checkpasses (web 1,382, 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.
Closes #2207
🤖 Generated with Claude Code