Repository navigation
Description
What I see
Adding a workspace on Windows (选择目录 / Select directory → 本机), the dialog starts at the drive list — C:, D:, E: — with a path box and a 前往 button. Without a breadcrumb, quick locations (home, Desktop, Downloads, recent projects) or type-ahead, reaching a project under C:\Users\me\Documents\… means either typing the absolute path or clicking down one level at a time.
Every native folder dialog on the same machine already does this better, because it is the UI people use all day: breadcrumbs, Up, quick-access sidebar, search, recent folders, and keyboard navigation.
This is a UX suggestion, not a bug: the picker works, it is just slower to find a folder in than the OS dialog.
Proposal: a Browse… button that opens the OS folder dialog
- In
components/DirectoryPicker.tsx, next to the path input: a button that asks the server to open the operating system's folder chooser, then fills the path with the result. - Only offered when the page is served to the machine the server runs on —
isLoopbackHost(lib/hosts/host-login.ts) already answers that, and remote/mobile browsers never see the button (a dialog would otherwise open on a desktop nobody is looking at). - Degrades silently: no desktop session, unknown platform, user cancels, or the dialog times out → the button does nothing and the existing in-page browsing stays exactly as it is.
Sketch
GET /api/cwd/picker → { supported: boolean, reason?: "remote" | "headless" | "unsupported-platform" }
POST /api/cwd/pick { initialPath?, hostId? }
→ { path } chosen
→ { cancelled: true } cancelled
→ 501 picker_unsupported
- Loopback check +
localhost only (hostIdabsent orlocal); anything else answers 501. - The chooser runs in a child process, never in the server process:
powershell -STA+System.Windows.Forms.FolderBrowserDialogon Windows,osascript -e 'choose folder'on macOS,zenity --file-selection --directory(or the XDG portal) on Linux. A timeout keeps a stuck dialog from holding the request open. - The returned path goes through the existing
/api/cwd/validatebefore it is accepted, so a directory that is not a valid workspace is rejected the same way a typed path is. - New strings go into all four locales (
directoryPicker.*keys already exist as flat keys, e.g.directoryPicker.go).
Why not only improve the in-page browser
Both are useful and not exclusive: breadcrumbs / start-at-home / recent projects make the web picker better for everyone, including remote hosts. But they cannot give the quick-access sidebar, the OS search or the muscle memory of the native dialog, and that is the part that makes "find my project folder" fast.
Willing to send a PR
I can implement this behind the capability check above, with tests for the parts that are testable without a desktop:
isLoopbackHostgate and thehostIdrejection (route-level, fake req),- argument building and output parsing per platform (
lib/...pure helpers), - the cancel/timeout mapping,
- the component test that the button is absent when
supportedis false.
The dialog itself cannot be exercised in CI (no interactive desktop); the PR would say so and describe the manual check on Windows/macOS.
If you would rather not carry three platform implementations, a Windows-only button behind supported would already cover the platform this report comes from.
Activity
feat(directory-picker): add a Browse… button that opens the OS folder…
kahme247 commentedon Nov 23, 2026
Verified fixed on current main (head
c93b5b13) by merged PR #544 (merge commit19330325).Evidence on main:
components/DirectoryPicker.tsx:337-348renders a Browse button (directoryPicker.browse) next to the path input, shown only whennativePickerAvailableis true.GET /api/cwd/pickerreturnspickerAvailable(context.localPeer)(app/api/cwd/picker/route.ts), and the component only checks it for the local host.POST /api/cwd/pick(app/api/cwd/pick/route.ts) opens the OS dialog and returns{ path }/{ cancelled: true }, refusing non-local hosts with 501picker_unavailable.lib/cwd-picker.tsruns the chooser in a child process per platform — PowerShellFolderBrowserDialogon Windows,osascript choose folderon macOS,zenity --file-selection --directoryon Linux — with a 5-minute timeout, and the picked path goes through the existing/api/cwd/validateflow.Closing as implemented by #544.