Skip to content

Commit fb18b2d

Browse files
fix(web): show text input for adding projects on Linux desktop (#1075)
1 parent 0de5742 commit fb18b2d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apps/web/src/components/Sidebar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { useLocation, useNavigate, useParams } from "@tanstack/react-router";
3939
import { useAppSettings } from "../appSettings";
4040
import { isElectron } from "../env";
4141
import { APP_STAGE_LABEL, APP_VERSION } from "../branding";
42-
import { isMacPlatform, newCommandId, newProjectId } from "../lib/utils";
42+
import { isLinuxPlatform, isMacPlatform, newCommandId, newProjectId } from "../lib/utils";
4343
import { useStore } from "../store";
4444
import { shortcutLabelForCommand } from "../keybindings";
4545
import { derivePendingApprovals, derivePendingUserInputs } from "../session-logic";
@@ -305,7 +305,8 @@ export default function Sidebar() {
305305
const clearSelection = useThreadSelectionStore((s) => s.clearSelection);
306306
const removeFromSelection = useThreadSelectionStore((s) => s.removeFromSelection);
307307
const setSelectionAnchor = useThreadSelectionStore((s) => s.setAnchor);
308-
const shouldBrowseForProjectImmediately = isElectron;
308+
const isLinuxDesktop = isElectron && isLinuxPlatform(navigator.platform);
309+
const shouldBrowseForProjectImmediately = isElectron && !isLinuxDesktop;
309310
const shouldShowProjectPathEntry = addingProject && !shouldBrowseForProjectImmediately;
310311
const projectCwdById = useMemo(
311312
() => new Map(projects.map((project) => [project.id, project.cwd] as const)),

apps/web/src/lib/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export function isWindowsPlatform(platform: string): boolean {
1616
return /^win(dows)?/i.test(platform);
1717
}
1818

19+
export function isLinuxPlatform(platform: string): boolean {
20+
return /linux/i.test(platform);
21+
}
22+
1923
export function randomUUID(): string {
2024
if (typeof crypto.randomUUID === "function") {
2125
return crypto.randomUUID();

0 commit comments

Comments
 (0)