Skip to content

Commit c0f42c5

Browse files
committed
fix: E2E tests and keyboard handling for new sidebar design
- Update E2E tests to click expand button instead of project row - Fix keyboard handler to ignore events bubbling from child buttons (addresses Codex review feedback)
1 parent b676bf8 commit c0f42c5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/browser/components/ProjectSidebar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,10 @@ const ProjectSidebarInner: React.FC<ProjectSidebarProps> = ({
515515
selected={false}
516516
onClick={() => handleAddWorkspace(projectPath)}
517517
onKeyDown={(e: React.KeyboardEvent) => {
518+
// Ignore key events from child buttons
519+
if (e.target instanceof HTMLElement && e.target !== e.currentTarget) {
520+
return;
521+
}
518522
if (e.key === "Enter" || e.key === " ") {
519523
e.preventDefault();
520524
handleAddWorkspace(projectPath);

tests/e2e/utils/ui.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ export function createWorkspaceUI(page: Page, context: DemoProjectConfig): Works
9292
const workspaceItem = workspaceItems.first();
9393
const isVisible = await workspaceItem.isVisible().catch(() => false);
9494
if (!isVisible) {
95-
await projectItem.click();
95+
// Click the expand/collapse button within the project item
96+
const expandButton = projectItem.getByRole("button", { name: /expand project/i });
97+
await expandButton.click();
9698
await workspaceItem.waitFor({ state: "visible" });
9799
}
98100

0 commit comments

Comments
 (0)