Skip to content

Commit 10472cc

Browse files
fix: simplify workspace actions trigger
1 parent fe69173 commit 10472cc

4 files changed

Lines changed: 23 additions & 14 deletions

File tree

apps/web/components/task/file-browser-toolbar.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ describe("FileBrowserToolbar workspace actions", () => {
3838
);
3939

4040
const trigger = screen.getByRole("button", { name: "Workspace actions" });
41-
expect(trigger.className).toContain("min-h-11");
4241
fireEvent.pointerDown(trigger, { button: 0, ctrlKey: false });
4342
fireEvent.click(trigger);
4443

apps/web/components/task/file-browser-toolbar.tsx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { useCallback, useEffect, useRef, type ReactNode, type Ref, type RefObjec
44
import {
55
IconSearch,
66
IconListTree,
7-
IconFolderShare,
87
IconFolderOpen,
98
IconCopy,
109
IconCheck,
1110
IconPlus,
11+
IconDots,
1212
} from "@tabler/icons-react";
1313
import { Tooltip, TooltipContent, TooltipTrigger } from "@kandev/ui/tooltip";
1414
import {
@@ -155,18 +155,22 @@ function WorkspaceActionsMenu({
155155

156156
return (
157157
<DropdownMenu>
158-
<DropdownMenuTrigger asChild>
159-
<button
160-
ref={setTriggerRef}
161-
type="button"
162-
aria-label="Workspace actions"
163-
data-testid="files-workspace-actions"
164-
className="inline-flex min-h-11 min-w-11 items-center gap-1 rounded px-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground cursor-pointer sm:min-h-8 sm:min-w-0"
165-
>
166-
<IconFolderShare className="h-3.5 w-3.5" />
167-
<span>Workspace actions</span>
168-
</button>
169-
</DropdownMenuTrigger>
158+
<Tooltip>
159+
<TooltipTrigger asChild>
160+
<DropdownMenuTrigger asChild>
161+
<button
162+
ref={setTriggerRef}
163+
type="button"
164+
aria-label="Workspace actions"
165+
data-testid="files-workspace-actions"
166+
className="inline-flex size-11 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground cursor-pointer sm:size-8"
167+
>
168+
<IconDots className="h-4 w-4" />
169+
</button>
170+
</DropdownMenuTrigger>
171+
</TooltipTrigger>
172+
<TooltipContent>Workspace actions</TooltipContent>
173+
</Tooltip>
170174
<DropdownMenuContent
171175
align="end"
172176
className="w-56"

apps/web/e2e/tests/task/add-workspace-sources.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ test.describe("Attach local workspace sources", () => {
7070

7171
const workspaceActions = testPage.getByTestId("files-workspace-actions");
7272
await expect(workspaceActions).toBeEnabled();
73+
await expect(workspaceActions).toHaveAccessibleName("Workspace actions");
74+
const workspaceActionsBox = await workspaceActions.boundingBox();
75+
expect(workspaceActionsBox).not.toBeNull();
76+
expect(workspaceActionsBox!.width).toBeLessThanOrEqual(44);
7377
await workspaceActions.click();
7478
const addSources = testPage.getByRole("menuitem", { name: "Add sources" });
7579
const openFolder = testPage.getByRole("menuitem", { name: "Open workspace folder" });

apps/web/e2e/tests/task/mobile-add-workspace-sources.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ test("mobile Files drawer attaches sources with fixed controls and persisted wor
6767
const entryBox = await entryPoint.boundingBox();
6868
expect(entryBox).not.toBeNull();
6969
expect(entryBox!.height).toBeGreaterThanOrEqual(44);
70+
expect(entryBox!.width).toBeGreaterThanOrEqual(44);
71+
expect(entryBox!.width).toBeLessThanOrEqual(48);
7072
await entryPoint.tap();
7173
const addSources = testPage.getByRole("menuitem", { name: "Add sources" });
7274
const openFolder = testPage.getByRole("menuitem", { name: "Open workspace folder" });

0 commit comments

Comments
 (0)