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