From ce7b24bfb151cc5dfee54d669c3490611e74119e Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 9 Mar 2026 09:14:18 -0700 Subject: [PATCH] Inline Electron project picker check in Sidebar - Replace `shouldOpenProjectFolderPickerImmediately` with direct `isElectron` usage - Remove obsolete `Sidebar.logic.ts` and its tests --- apps/web/src/components/Sidebar.logic.test.ts | 24 ------------------- apps/web/src/components/Sidebar.logic.ts | 5 ---- apps/web/src/components/Sidebar.tsx | 5 +--- 3 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 apps/web/src/components/Sidebar.logic.test.ts delete mode 100644 apps/web/src/components/Sidebar.logic.ts diff --git a/apps/web/src/components/Sidebar.logic.test.ts b/apps/web/src/components/Sidebar.logic.test.ts deleted file mode 100644 index 6caeffed31bd2bbddfde34e34c3715047aeb26e9..0000000000000000000000000000000000000000 --- a/apps/web/src/components/Sidebar.logic.test.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { shouldOpenProjectFolderPickerImmediately } from "./Sidebar.logic"; - -describe("shouldOpenProjectFolderPickerImmediately", () => { - it("opens the folder picker immediately in Electron", () => { - expect( - shouldOpenProjectFolderPickerImmediately({ - isElectron: true, - }), - ).toBe(true); - }); - - it("still opens the folder picker immediately for mobile-width Electron layouts", () => { - expect( - shouldOpenProjectFolderPickerImmediately({ - isElectron: true, - }), - ).toBe(true); - }); - - it("keeps manual project entry outside Electron", () => { - expect(shouldOpenProjectFolderPickerImmediately({ isElectron: false })).toBe(false); - }); -}); diff --git a/apps/web/src/components/Sidebar.logic.ts b/apps/web/src/components/Sidebar.logic.ts deleted file mode 100644 index 95346241e2d46df3fd0a10ffa3c0d58b8b17e297..0000000000000000000000000000000000000000 --- a/apps/web/src/components/Sidebar.logic.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function shouldOpenProjectFolderPickerImmediately(input: { - isElectron: boolean; -}): boolean { - return input.isElectron; -} diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 6421343827b44d271be740daa66054676c312ef3..af8255a272dd29d0bc12bf2f523f1976972829c1 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -49,7 +49,6 @@ import { } from "./desktopUpdate.logic"; import { Alert, AlertAction, AlertDescription, AlertTitle } from "./ui/alert"; import { Button } from "./ui/button"; -import { shouldOpenProjectFolderPickerImmediately } from "./Sidebar.logic"; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible"; import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; import { @@ -313,9 +312,7 @@ export default function Sidebar() { const renamingCommittedRef = useRef(false); const renamingInputRef = useRef(null); const [desktopUpdateState, setDesktopUpdateState] = useState(null); - const shouldBrowseForProjectImmediately = shouldOpenProjectFolderPickerImmediately({ - isElectron, - }); + const shouldBrowseForProjectImmediately = isElectron; const shouldShowProjectPathEntry = addingProject && !shouldBrowseForProjectImmediately; const pendingApprovalByThreadId = useMemo(() => { const map = new Map(); -- 2.54.0