diff --git a/ui-electrobun/src/bun/index.ts b/ui-electrobun/src/bun/index.ts index d23bcfd..ec1bb2c 100644 --- a/ui-electrobun/src/bun/index.ts +++ b/ui-electrobun/src/bun/index.ts @@ -133,24 +133,15 @@ const rpc = BrowserView.defineRPC({ try { const { execSync } = await import("child_process"); const start = startingFolder?.replace(/^~/, process.env.HOME || "/home") || process.env.HOME || "/home"; - // zenity --file-selection --directory gives a proper "Select Folder" dialog - // with dark theme support, dirs sorted first, and correct title const result = execSync( `zenity --file-selection --directory --title="Select Project Folder" --filename="${start}/"`, { encoding: "utf-8", timeout: 120_000 } ).trim(); return { path: result || null }; - } catch { - // User cancelled or zenity not found — try Electrobun fallback - try { - const paths = await Utils.openFileDialog({ - startingFolder: startingFolder || "~/", - canChooseFiles: false, - canChooseDirectory: true, - allowsMultipleSelection: false, - }); - return { path: paths?.[0] ?? null }; - } catch { return { path: null }; } + } catch (e: any) { + // zenity exits with code 1 on cancel, code 5 if not found + // Do NOT fall back to Electrobun dialog — just return null + return { path: null }; } }, diff --git a/ui-electrobun/src/mainview/ProjectWizard.svelte b/ui-electrobun/src/mainview/ProjectWizard.svelte index 9119403..d0c512b 100644 --- a/ui-electrobun/src/mainview/ProjectWizard.svelte +++ b/ui-electrobun/src/mainview/ProjectWizard.svelte @@ -210,6 +210,7 @@ function handleBrowserSelect(path: string) { localPath = path; + showBrowser = false; validatePath(path); } @@ -304,7 +305,7 @@ {/if} -
+
showBrowser = false} />
{#if pathValid === 'valid' && isGitRepo}