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 <[email protected]>
This commit is contained in:
Cursor AgentandJulius Marminge committed 2026-03-09 16:35:34 +00:00
1 parent 70c4035b3c
commit 95ebece7ed
1 file changed
+3 -1
+3 -1
View File
@@ -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<HTMLInputElement | null>(null);
const [desktopUpdateState, setDesktopUpdateState] = useState<DesktopUpdateState | null>(null);
const shouldBrowseForProjectImmediately = isElectron;
const shouldBrowseForProjectImmediately = isElectron && !isMobile;
const shouldShowProjectPathEntry = addingProject && !shouldBrowseForProjectImmediately;
const pendingApprovalByThreadId = useMemo(() => {
const map = new Map<ThreadId, boolean>();