* feat(app): add persistent workspace side panes Keep the common review and file-browsing workflow beside the active agent without tearing down pane contents. Workspace tabs now share one compact chip language, assistant file links route into the retained right pane, and diff/file trees share stable geometry. * fix(app): localize pull request empty state * test(app): update explorer pane coverage * fix(app): preserve explorer pane workflows * test(app): make explorer tab selection idempotent * fix(app): persist workspace review pins * fix(app): preserve sidebar scrim drag hook * fix(app): restore companion pane interactions * test(app): follow selected sidebar surface
50 lines
2.0 KiB
TypeScript
50 lines
2.0 KiB
TypeScript
import { mkdir, writeFile } from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { test, expect, type Page } from "../support/fixtures";
|
|
import { seedMockAgentWorkspace, openAgentRoute } from "../support/helpers/mock-agent";
|
|
import { openChangesPanel } from "../support/helpers/workspace-tabs";
|
|
|
|
function visibleComposer(page: Page) {
|
|
return page.locator("textarea[data-composer-input]").filter({ visible: true }).first();
|
|
}
|
|
|
|
test("adds a changed file to the focused chat without replacing its composer draft", async ({
|
|
page,
|
|
}) => {
|
|
const workspace = await seedMockAgentWorkspace({
|
|
repoPrefix: "add-file-to-chat-",
|
|
title: "Target chat",
|
|
});
|
|
const relativePath = "src/changed file.ts";
|
|
|
|
try {
|
|
await mkdir(path.join(workspace.cwd, "src"), { recursive: true });
|
|
await writeFile(path.join(workspace.cwd, relativePath), "export const changed = true;\n");
|
|
await workspace.client.checkoutRefresh(workspace.cwd);
|
|
|
|
await page.setViewportSize({ width: 1400, height: 900 });
|
|
await openAgentRoute(page, {
|
|
workspaceId: workspace.workspaceId,
|
|
agentId: workspace.agentId,
|
|
});
|
|
|
|
const agentComposer = visibleComposer(page);
|
|
await expect(agentComposer).toBeEditable({ timeout: 30_000 });
|
|
await agentComposer.fill("Preserve this thought");
|
|
|
|
await openChangesPanel(page);
|
|
const changedFile = page.getByText("changed file.ts", { exact: true }).first();
|
|
await expect(changedFile).toBeVisible({ timeout: 30_000 });
|
|
await page.getByTestId("diff-file-0-toggle").click({ button: "right" });
|
|
await page.getByTestId("diff-file-0-add-to-chat").click();
|
|
|
|
const attachment = page.getByTestId("composer-workspace-file-attachment-pill");
|
|
await expect(attachment).toContainText("changed file.ts");
|
|
await expect(attachment).toContainText(relativePath);
|
|
await expect(agentComposer).toHaveValue("Preserve this thought");
|
|
await expect(agentComposer).toBeFocused();
|
|
} finally {
|
|
await workspace.cleanup();
|
|
}
|
|
});
|