feat(web): type absolute paths directly in the workspace picker - #1556
Conversation
The add-workspace dialog's fuzzy-search box now doubles as an absolute path entry: input starting with "/" or "~" is validated live (missing path / missing parent get specific errors plus prefix-matched candidates), and a valid path live-follows the folder browser so the existing "Open this folder" button submits it. Enter accepts the first candidate or opens a valid path; Esc clears the box. The collapsed paste-path section at the bottom is removed, and the degraded (no-browse) mode reuses the same box with format-only validation.
🦋 Changeset detectedLatest commit: 17421b4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b17ea86fb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // switches from fuzzy search to path mode. A valid path live-follows (the | ||
| // browser jumps to it, so "Open this folder" submits it); an invalid one | ||
| // shows a specific error plus prefix-matched candidates in the list. | ||
| const PATH_LIKE = /^(?:\/|~(?:\/|$))/; |
There was a problem hiding this comment.
Support Windows absolute paths in path mode
On Windows, absolute workspace roots are usually drive-letter or UNC paths; the backend file browser uses the platform node:path.isAbsolute, and the removed paste fallback emitted any non-empty path. With this regex, C:\Users\me\repo is treated as fuzzy text instead of path entry, so in degraded mode Enter returns before emitting add and there is no remaining button to add it. Please recognize Windows absolute forms here or keep a generic paste fallback.
Useful? React with 👍 / 👎.
| pathState.value = 'valid'; | ||
| pathCandidates.value = []; | ||
| currentPath.value = res.path; |
There was a problem hiding this comment.
Disable add after an invalid path follow
When a user pauses on a valid prefix and then finishes an invalid path, e.g. /tmp followed by /tmp/not-here, this live-follow assignment leaves currentPath set to the valid prefix while the UI shows a not-found error for the full input. The primary “Open this folder” button remains enabled and will add that stale prefix, so the dialog can register the wrong workspace; clear/separate the followed path on validation failure or disable the button unless path mode is valid.
Useful? React with 👍 / 👎.
…th mode Two review fixes on the workspace picker's path entry: - PATH_LIKE now also matches Windows drive (C:\x, C:/x) and UNC (\\srv\x) forms, matching node:path.isAbsolute on the daemon side. Without this, Windows users in degraded (no-browse) mode had no way to submit a path at all. Parent-dir splitting and trailing-separator trimming are now separator-aware (drive roots are preserved). - "Open this folder" is disabled while path mode has no validated target. Previously, after typing a valid prefix and then an invalid path, the button still submitted the stale followed prefix.
1 similar comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76e6a283ea
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (res.path) { | ||
| pathState.value = 'valid'; | ||
| pathCandidates.value = []; | ||
| currentPath.value = res.path; |
There was a problem hiding this comment.
Preserve the typed path when adding path-mode workspaces
When path-mode validation succeeds, this stores res.path from fs:browse, and openThisFolder() later emits currentPath. The backend folder browser canonicalizes with fsp.realpath, while workspace/session IDs are based on the lexical root and the removed paste field used to submit the user's typed root. For a symlinked cwd such as /tmp/project on macOS resolving to /private/tmp/project, typing /tmp/project now registers the real target instead, so sessions under the typed cwd won't group under the workspace. Keep the typed normalized path for the add action while using the browse result only to populate the visible folder contents.
Useful? React with 👍 / 👎.
…th mode fs:browse canonicalizes via realpath, but workspace/session ids are based on the lexical root. For a symlinked cwd (/tmp/project -> /private/tmp/ project on macOS), live-follow stored the resolved target in currentPath and "Open this folder" emitted it, so sessions under the typed cwd would not group under the workspace. Keep the typed normalized path for the add action and use the browse result only to populate the visible browser.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41233b37af
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (token !== pathToken) return; | ||
| // Split on whichever separator the path uses (Windows paths use "\"). | ||
| const lastSep = Math.max(target.lastIndexOf('/'), target.lastIndexOf('\\')); | ||
| const parent = (lastSep > 0 ? target.slice(0, lastSep) : '') || '/'; |
There was a problem hiding this comment.
Preserve the drive-root separator for completions
On Windows, typing a missing direct child of a drive root such as C:\Us or C:/Pro makes lastSep point at the root separator, but this slice produces parent === 'C:'. The server-side browse path must be absolute, so C: is rejected before entries are listed and the new completion UI reports a bad parent instead of suggesting C:\Users or C:\Program Files. Keep the separator when the parent is a drive root (C:\ / C:/).
Useful? React with 👍 / 👎.
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Related Issue
No linked issue — problem explained below.
Problem
When starting a new session, the "Add workspace" dialog only accepted an absolute path through a small field collapsed behind a ghost button at the bottom of a 300px folder list. That field had no inline validation (bad paths only failed after a backend round-trip with a generic error), no completion, and an ambiguous "+" submit button. Users who already know the path (power users, remote/browse-less environments) had a poor, error-prone experience.
What changed
The dialog's existing fuzzy-search box now doubles as the absolute-path entry — no layout change beyond removing the collapsed paste section:
/or~switches the box from fuzzy search to path mode (ambiguous-free:/can't appear in folder names,~only as~/or bare~).browseFscall on the parent dir): missing path / missing parent directory each get a specific message, and prefix-matched sibling folders are offered as clickable candidates in the list area.Includes a
web:changeset (patch).Note: an earlier iteration of this change (including a fly-out close animation that was later dropped) currently also lives in #1554. This PR is the final, animation-free version of just this feature; #1554 should drop this part when rebased. The changeset filename intentionally matches the one in #1554 so the duplicate is easy to spot.
Checklist
apps/kimi-webhas no component test harness (pure logic tests only); verified withvue-tsctypecheck,vite build,vitest,oxlint,check:style, plus an interactive mock covering the keyboard/validation flows.gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update. — no doc update needed; user-facing note ships via the changeset/changelog sync.