Universal scratch: every session gets a scratch root; Artifacts panel everywhere

Gated sessions run workspace+scratch dual-root; artifact listing scans scratch only.
Artifact chips resolve across workspace, scratch, and granted roots; request_directory registers for all sessions.
This commit is contained in:
Rohit C Prasad
2026-08-20 21:28:52 -07:00
parent 1299760400
commit 65c568cd44
8 changed files with 247 additions and 40 deletions
+18
View File
@@ -53,3 +53,21 @@ test("a transcript chip opens the viewer on the FIRST click even with the rail h
await page.getByTestId("artifact-chip").click();
await expect(page.getByTestId("artifact-frame")).toBeVisible();
});
test("Artifacts section renders for a folder-gated coworker too (universal scratch)", async ({
page,
}) => {
// UX-036: every session has a scratch surface, so the drawer's Artifacts section is no
// longer cowork-only — a security session lists its scratch-side reports the same way.
await page.goto("/");
await page.getByTestId("coworker-chip").click();
await page.locator(".setup-menu").getByRole("button", { name: /Security Coworker/ }).click();
await page.getByPlaceholder(/Ask the coworker/).fill("audit this repo");
await page.getByRole("button", { name: "Send" }).click();
await page.getByTestId("send-folder-dialog").getByRole("button", { name: "Choose a folder…" }).click();
await expect(page.getByText(/Echo: audit this repo/)).toBeVisible();
await expect(page.getByTestId("rail-toggle-artifacts")).toBeVisible();
await page.getByTestId("rail-toggle-artifacts").click();
await expect(page.locator(".artifact-row", { hasText: "security-review.html" })).toBeVisible();
});
+4 -2
View File
@@ -2065,12 +2065,14 @@ export function App() {
todo={todo}
running={running}
onPreviewChange={onArtifactPreview}
showArtifacts={agent === "cowork"}
// Universal scratch (UX-036): every session has a scratch surface, so the
// Artifacts section always shows — the server lists the scratch root only.
showArtifacts
personaId={agent}
projectScoped={isProjectScoped(personaOf(agent))}
workspace={workspace || undefined}
branch={branch}
scratchPrimary={agent === "cowork" || tempWorkspace}
scratchPrimary={tempWorkspace || !isProjectScoped(personaOf(agent))}
openAccessKey={accessKey}
onOpenIntegrations={() => setSurface("integrations")}
board={board}