| ... | @@ -818,15 +818,22 @@ export default function Sidebar() { | ... | @@ -818,15 +818,22 @@ export default function Sidebar() { |
| 818 | async (projectId: ProjectId, position: { x: number; y: number }) => { | 818 | async (projectId: ProjectId, position: { x: number; y: number }) => { |
| 819 | const api = readNativeApi(); | 819 | const api = readNativeApi(); |
| 820 | if (!api) return; | 820 | if (!api) return; |
| | 821 | const project = projects.find((entry) => entry.id === projectId); |
| | 822 | if (!project) return; |
| | 823 | |
| 821 | const clicked = await api.contextMenu.show( | 824 | const clicked = await api.contextMenu.show( |
| 822 | [{ id: "delete", label: "Remove project", destructive: true }], | 825 | [ |
| | 826 | { id: "copy-path", label: "Copy Project Path" }, |
| | 827 | { id: "delete", label: "Remove project", destructive: true }, |
| | 828 | ], |
| 823 | position, | 829 | position, |
| 824 | ); | 830 | ); |
| | 831 | if (clicked === "copy-path") { |
| | 832 | copyPathToClipboard(project.cwd, { path: project.cwd }); |
| | 833 | return; |
| | 834 | } |
| 825 | if (clicked !== "delete") return; | 835 | if (clicked !== "delete") return; |
| 826 | | 836 | |
| 827 | const project = projects.find((entry) => entry.id === projectId); | | |
| 828 | if (!project) return; | | |
| 829 | | | |
| 830 | const projectThreads = threads.filter((thread) => thread.projectId === projectId); | 837 | const projectThreads = threads.filter((thread) => thread.projectId === projectId); |
| 831 | if (projectThreads.length > 0) { | 838 | if (projectThreads.length > 0) { |
| 832 | toastManager.add({ | 839 | toastManager.add({ |
| ... | @@ -864,6 +871,7 @@ export default function Sidebar() { | ... | @@ -864,6 +871,7 @@ export default function Sidebar() { |
| 864 | [ | 871 | [ |
| 865 | clearComposerDraftForThread, | 872 | clearComposerDraftForThread, |
| 866 | clearProjectDraftThreadId, | 873 | clearProjectDraftThreadId, |
| | 874 | copyPathToClipboard, |
| 867 | getDraftThreadByProjectId, | 875 | getDraftThreadByProjectId, |
| 868 | projects, | 876 | projects, |
| 869 | threads, | 877 | threads, |