Skip to content

Commit b65f255

Browse files
Add trash icon to destructive context menu items
- Show trash icon for delete actions in the sidebar menu - Match fallback icon sizing for destructive items
1 parent adfdfd0 commit b65f255

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

‎apps/web/src/components/Sidebar.tsx‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,13 +1481,6 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
14811481
};
14821482
};
14831483

1484-
const iconForAction: Record<"rename" | "grouping" | "copy-path" | "delete", string> = {
1485-
rename: "pencil",
1486-
grouping: "folder-tree",
1487-
"copy-path": "copy",
1488-
delete: "trash",
1489-
};
1490-
14911484
const buildTargetedItem = (
14921485
action: "rename" | "grouping" | "copy-path" | "delete",
14931486
label: string,
@@ -1504,14 +1497,14 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
15041497
...(options?.isDisabled?.(singleMember) ? { disabled: true } : {}),
15051498
}),
15061499
label,
1507-
icon: iconForAction[action],
1500+
...(action === "delete" ? { icon: "trash" } : {}),
15081501
};
15091502
}
15101503

15111504
return {
15121505
id: `${action}:submenu`,
15131506
label,
1514-
icon: iconForAction[action],
1507+
...(action === "delete" ? { icon: "trash" } : {}),
15151508
children: project.memberProjects.map((member) =>
15161509
makeLeaf(action, member, {
15171510
...(options?.destructive ? { destructive: true } : {}),
@@ -1942,7 +1935,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
19421935
{ id: "mark-unread", label: "Mark unread" },
19431936
{ id: "copy-path", label: "Copy Path" },
19441937
{ id: "copy-thread-id", label: "Copy Thread ID" },
1945-
{ id: "delete", label: "Delete", destructive: true },
1938+
{ id: "delete", label: "Delete", destructive: true, icon: "trash" },
19461939
],
19471940
position,
19481941
);

‎apps/web/src/contextMenuFallback.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function createIconElement(name: string, tone: "neutral" | "destructive"): SVGSV
5757
svg.setAttribute("stroke-linejoin", "round");
5858
svg.setAttribute(
5959
"class",
60-
tone === "destructive" ? "size-4 shrink-0" : "size-4 shrink-0 text-muted-foreground",
60+
tone === "destructive" ? "size-3.5 shrink-0" : "size-3.5 shrink-0 text-muted-foreground",
6161
);
6262
for (const node of paths) {
6363
const child = document.createElementNS(SVG_NS, node.tag);

0 commit comments

Comments
 (0)