From 95ebece7ed21b5c5eda8d576e115ce06a6064ed4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 9 Mar 2026 16:35:34 +0000 Subject: [PATCH] fix: add !isMobile check to shouldBrowseForProjectImmediately condition The folder picker should only open immediately in desktop Electron environments, not mobile Electron layouts. Import useSidebar to access isMobile and update the condition from just isElectron to isElectron && !isMobile. Co-authored-by: Julius Marminge --- 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 af8255a272..4e0ad675b0 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -65,6 +65,7 @@ import { SidebarMenuSubItem, SidebarSeparator, SidebarTrigger, + useSidebar, } from "./ui/sidebar"; import { formatWorktreePathForDisplay, getOrphanedWorktreePathForThread } from "../worktreeCleanup"; import { isNonEmpty as isNonEmptyString } from "effect/String"; @@ -266,6 +267,7 @@ function ProjectFavicon({ cwd }: { cwd: string }) { } export default function Sidebar() { + const { isMobile } = useSidebar(); const projects = useStore((store) => store.projects); const threads = useStore((store) => store.threads); const markThreadUnread = useStore((store) => store.markThreadUnread); @@ -312,7 +314,7 @@ export default function Sidebar() { const renamingCommittedRef = useRef(false); const renamingInputRef = useRef(null); const [desktopUpdateState, setDesktopUpdateState] = useState(null); - const shouldBrowseForProjectImmediately = isElectron; + const shouldBrowseForProjectImmediately = isElectron && !isMobile; const shouldShowProjectPathEntry = addingProject && !shouldBrowseForProjectImmediately; const pendingApprovalByThreadId = useMemo(() => { const map = new Map();