From 99dbe4ff02d9ee8e5450e96d84e8f96170c64a71 Mon Sep 17 00:00:00 2001 From: Satyam Bansal Date: Tue, 10 Mar 2026 00:41:17 +0530 Subject: [PATCH] fix(web): disable add project button for empty path --- apps/web/src/components/Sidebar.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index f4e8af24f2efb7bc8babe32d8a216bd6eef3f8ec..284ed0da9a309e1bf5bcb9e004957e4466b347ad 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -550,6 +550,8 @@ export default function Sidebar() { void addProjectFromPath(newCwd); }; + const canAddProject = newCwd.trim().length > 0 && !isAddingProject; + const handlePickFolder = async () => { const api = readNativeApi(); if (!api || isPickingFolder) return; @@ -1223,7 +1225,7 @@ export default function Sidebar() { type="button" className="shrink-0 rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground transition-colors duration-150 hover:bg-primary/90 disabled:opacity-60" onClick={handleAddProject} - disabled={isAddingProject} + disabled={!canAddProject} > {isAddingProject ? "Adding..." : "Add"} -- 2.54.0