fix(web): add project path action to sidebar menu (#1436)

Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
FllipandJulius Marminge authored and GitHub committed 2026-03-28 18:56:46 +00:00
1 parent 52fa6a7333
commit ce463a5360
1 file changed
+14 -6
+14 -6
View File
@@ -818,15 +818,22 @@ export default function Sidebar() {
async (projectId: ProjectId, position: { x: number; y: number }) => {
const api = readNativeApi();
if (!api) return;
const clicked = await api.contextMenu.show(
[{ id: "delete", label: "Remove project", destructive: true }],
position,
);
if (clicked !== "delete") return;
const project = projects.find((entry) => entry.id === projectId);
if (!project) return;
const clicked = await api.contextMenu.show(
[
{ id: "copy-path", label: "Copy Project Path" },
{ id: "delete", label: "Remove project", destructive: true },
],
position,
);
if (clicked === "copy-path") {
copyPathToClipboard(project.cwd, { path: project.cwd });
return;
}
if (clicked !== "delete") return;
const projectThreads = threads.filter((thread) => thread.projectId === projectId);
if (projectThreads.length > 0) {
toastManager.add({
@@ -864,6 +871,7 @@ export default function Sidebar() {
[
clearComposerDraftForThread,
clearProjectDraftThreadId,
copyPathToClipboard,
getDraftThreadByProjectId,
projects,
threads,