From 04cc2897d5f1d7379396607679f83575ce0d3d16 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Sun, 8 Mar 2026 17:49:26 -0700 Subject: [PATCH 1/4] improvements --- apps/web/src/components/Sidebar.tsx | 136 ++++++++++++++++------------ 1 file changed, 80 insertions(+), 56 deletions(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 2a96f9e9f3..0b6b3cb4c0 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -2,7 +2,9 @@ import { ChevronRightIcon, FolderIcon, GitPullRequestIcon, + PlusIcon, RocketIcon, + SettingsIcon, SquarePenIcon, TerminalIcon, } from "lucide-react"; @@ -1025,6 +1027,70 @@ export default function Sidebar() { +
+ + Projects + + + setAddingProject((prev) => !prev)} + /> + } + > + + + Add project + +
+ + {addingProject && ( +
+ setNewCwd(event.target.value)} + onKeyDown={(event) => { + if (event.key === "Enter") handleAddProject(); + if (event.key === "Escape") setAddingProject(false); + }} + autoFocus + /> + {isElectron && ( + + )} +
+ + +
+
+ )} + {projects.map((project) => { const projectThreads = threads @@ -1288,68 +1354,26 @@ export default function Sidebar() { {projects.length === 0 && !addingProject && (
- No projects yet. -
- Add one to get started. + No projects yet
)}
- - {addingProject ? ( - <> -

- Add project -

- setNewCwd(event.target.value)} - onKeyDown={(event) => { - if (event.key === "Enter") handleAddProject(); - if (event.key === "Escape") setAddingProject(false); - }} - /> - {isElectron && ( - - )} -
- - -
- - ) : ( - - )} + + + + void navigate({ to: "/settings" })} + > + + Settings + + + ); From da217c0e1cca575aa7c29fe8e4c9c64194ebfd7f Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Sun, 8 Mar 2026 17:58:10 -0700 Subject: [PATCH 2/4] sidebar ui pt2 --- apps/web/src/components/Sidebar.tsx | 75 ++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 24 deletions(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 0b6b3cb4c0..21b3647270 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -295,6 +295,8 @@ export default function Sidebar() { const [newCwd, setNewCwd] = useState(""); const [isPickingFolder, setIsPickingFolder] = useState(false); const [isAddingProject, setIsAddingProject] = useState(false); + const [addProjectError, setAddProjectError] = useState(null); + const addProjectInputRef = useRef(null); const [renamingThreadId, setRenamingThreadId] = useState(null); const [renamingTitle, setRenamingTitle] = useState(""); const [expandedThreadListsByProject, setExpandedThreadListsByProject] = useState< @@ -488,6 +490,7 @@ export default function Sidebar() { const finishAddingProject = () => { setIsAddingProject(false); setNewCwd(""); + setAddProjectError(null); setAddingProject(false); }; @@ -514,12 +517,9 @@ export default function Sidebar() { await handleNewThread(projectId).catch(() => undefined); } catch (error) { setIsAddingProject(false); - toastManager.add({ - type: "error", - title: "Unable to add project", - description: - error instanceof Error ? error.message : "An error occurred while adding the project.", - }); + setAddProjectError( + error instanceof Error ? error.message : "An error occurred while adding the project.", + ); return; } finishAddingProject(); @@ -543,6 +543,8 @@ export default function Sidebar() { } if (pickedPath) { await addProjectFromPath(pickedPath); + } else { + addProjectInputRef.current?.focus(); } setIsPickingFolder(false); }; @@ -1038,7 +1040,10 @@ export default function Sidebar() { type="button" aria-label="Add project" className="inline-flex size-5 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground" - onClick={() => setAddingProject((prev) => !prev)} + onClick={() => { + setAddingProject((prev) => !prev); + setAddProjectError(null); + }} /> } > @@ -1049,41 +1054,63 @@ export default function Sidebar() { {addingProject && ( -
- setNewCwd(event.target.value)} - onKeyDown={(event) => { - if (event.key === "Enter") handleAddProject(); - if (event.key === "Escape") setAddingProject(false); - }} - autoFocus - /> +
{isElectron && ( )} -
+
+ { + setNewCwd(event.target.value); + setAddProjectError(null); + }} + onKeyDown={(event) => { + if (event.key === "Enter") handleAddProject(); + if (event.key === "Escape") { + setAddingProject(false); + setAddProjectError(null); + } + }} + autoFocus + /> +
+ {addProjectError && ( +

+ {addProjectError} +

+ )} +
From 1c168286a686e783f35e18984e69903f5bd9276d Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Sun, 8 Mar 2026 18:02:03 -0700 Subject: [PATCH 3/4] back flow --- apps/web/src/components/Sidebar.tsx | 31 ++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 21b3647270..243c0c6c6e 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -1,4 +1,5 @@ import { + ArrowLeftIcon, ChevronRightIcon, FolderIcon, GitPullRequestIcon, @@ -19,7 +20,7 @@ import { type ResolvedKeybindingsConfig, } from "@t3tools/contracts"; import { useMutation, useQueries, useQuery, useQueryClient } from "@tanstack/react-query"; -import { useNavigate, useParams } from "@tanstack/react-router"; +import { useLocation, useNavigate, useParams } from "@tanstack/react-router"; import { useAppSettings } from "../appSettings"; import { isElectron } from "../env"; import { APP_STAGE_LABEL } from "../branding"; @@ -280,6 +281,7 @@ export default function Sidebar() { (store) => store.clearProjectDraftThreadById, ); const navigate = useNavigate(); + const isOnSettings = useLocation({ select: (loc) => loc.pathname === "/settings" }); const { settings: appSettings } = useAppSettings(); const routeThreadId = useParams({ strict: false, @@ -1391,14 +1393,25 @@ export default function Sidebar() { - void navigate({ to: "/settings" })} - > - - Settings - + {isOnSettings ? ( + void navigate({ to: "/" })} + > + + Back + + ) : ( + void navigate({ to: "/settings" })} + > + + Settings + + )} From d6f03509ce5715f638d1c60420845af10bdce41c Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Sun, 8 Mar 2026 18:02:13 -0700 Subject: [PATCH 4/4] fix back flow --- apps/web/src/components/Sidebar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 243c0c6c6e..2c3caa427e 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -1397,7 +1397,7 @@ export default function Sidebar() { void navigate({ to: "/" })} + onClick={() => window.history.back()} > Back