Skip to content

Commit dbf24fe

Browse files
committed
fix: start workspace files collapsed
1 parent d03932a commit dbf24fe

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

ui/src/ui/app-render.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ function getChatWorkspaceFilesState(state: AppViewState, agentId: string): ChatW
701701
const next = {
702702
activeName: null,
703703
agentId,
704-
collapsed: false,
704+
collapsed: true,
705705
error: null,
706706
list: null,
707707
loading: false,

ui/src/ui/e2e/chat-flow.e2e.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ describeControlUiE2e("Control UI mocked Gateway E2E", () => {
221221
}
222222
});
223223

224-
it("collapses the workspace files panel from its header control", async () => {
224+
it("starts the workspace files panel collapsed and toggles it open", async () => {
225225
const context = await browser.newContext({
226226
locale: "en-US",
227227
serviceWorkers: "block",
@@ -240,6 +240,14 @@ describeControlUiE2e("Control UI mocked Gateway E2E", () => {
240240

241241
try {
242242
await page.goto(`${server.baseUrl}chat`);
243+
await page.getByRole("button", { name: "Expand workspace files" }).waitFor({
244+
timeout: 10_000,
245+
});
246+
expect(await gateway.getRequests("agents.files.list")).toHaveLength(0);
247+
expect(await page.locator(".chat-workspace-rail__file").count()).toBe(0);
248+
expect(await page.locator(".chat-workspace-rail__collapsed-icon svg").count()).toBe(1);
249+
250+
await page.getByRole("button", { name: "Expand workspace files" }).click();
243251
await page.getByRole("button", { name: "Collapse workspace files" }).waitFor({
244252
timeout: 10_000,
245253
});
@@ -258,6 +266,7 @@ describeControlUiE2e("Control UI mocked Gateway E2E", () => {
258266
timeout: 10_000,
259267
});
260268
await page.getByText("AGENTS.md").waitFor({ timeout: 10_000 });
269+
expect(await gateway.getRequests("agents.files.list")).toHaveLength(1);
261270

262271
await page.setViewportSize({ height: 900, width: 1000 });
263272
expect(await page.locator(".chat-workspace-rail").isHidden()).toBe(true);

0 commit comments

Comments
 (0)