desktop: directory picker submits home directory instead of typed path when adding a project
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- electron, typescript
调研方向
报告指出,DirectoryPickerDialog 是客户端入口点。阅读它的提交处理器,以及搜索输入、活动建议和当前选择的跟踪方式;然后通过输入绝对路径并在不选择建议的情况下选择文件夹,复现 Windows 流程。请求使用输入的路径,或者在路径得到确认前阻止提交,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Summary
In the "Open project" (Add project) directory picker, typing an absolute path (e.g. F:\Video-Edit) and clicking Select folder without first clicking the matching suggestion row submits the server's default location (C:\Users\<user>) instead of the typed path. The app then switches to the drive-root project C:/ (project id global), so "Add project" always lands on C:.
Environment
- opencode version: 2.2.0 (OpenCode Desktop, bundled
opencode-cli.exe, Electron 44.9.1 / Chrome 152) - OS: Windows 11 (Windows_NT 10.0.26200, win32 x64)
- Terminal: Unavailable — reproduced in the desktop app (v2 web UI served by the background service), not a terminal
- Shell: cmd.exe (system default)
- Install/channel: desktop, channel
latest - Active plugins: none found in
~/.config/opencode/opencode.jsonc(only MCP servers configured)
Reproduction
- Open the v2 web UI served by the desktop's background service (e.g. via an
opencode pairlink) and go to Home. - Click Add project. The in-app "Open project" dialog opens; the footer/selection line shows the home directory (
C:\Users\<user>). - Type an absolute path on another drive, e.g.
F:\Video-Edit, into the search input. Suggestions appear (F:\Video-Edit/, its subfolders, ...). Do not click a suggestion. - Click Select folder.
- Watch the network tab: the app sends
GET /api/location?location[directory]=C%3A%5CUsers%5C%3Cuser%3E(HTTP 200) — the typed path is ignored. - Home switches to the project
C:(worktreeC:/, idglobal).
Verified working alternative: click the suggestion row F:\Video-Edit/ first (the footer line changes to F:\Video-Edit), then click Select folder — the request is then GET /api/location?location[directory]=F:\Video-Edit.
Note: pressing ArrowDown only sets the highlighted (active) suggestion; with an active-but-not-chosen suggestion, Select folder still submitted the home directory in my test.
Expected Behavior
Select folder should submit the typed path (or the active suggestion), i.e. resolve F:\Video-Edit — or refuse to submit while the input contains an unconfirmed path.
Actual Behavior
The dialog submits the server default location directory. The server resolves it to the drive-root project and the client switches selection to it:
- Sent:
GET /api/location?location[directory]=C:\Users\<user>→ 200 - Response:
{"directory":"C:\\Users\\<user>","project":{"id":"global","directory":"C:\\","canonical":"C:\\"}} - Home selection becomes the
C:/project.
For comparison, the server itself resolves paths correctly — the bug is client-side state handling in DirectoryPickerDialog (submit uses the current selection, defaulting to the home root, instead of the input text / active suggestion):
GET /api/location?location[directory]=F:\Video-Edit
→ {"directory":"F:\\Video-Edit","project":{"id":"d72c10…","directory":"F:\\Video-Edit","canonical":"F:\\Video-Edit"}}
Additional Context
- Frequency: 100% reproducible via the in-app (server-kind) picker on Windows.
- Workaround: click the suggestion row first so the footer shows the intended path, then Select folder; or resolve the directory via the API/CLI directly.
- Related annoyance: the
global(C:/) project keeps reappearing in Home because default-location bootstraps (GET /api/locationwith no directory) touch it on every relevant page load. - The desktop-native flow (Electron
openDirectorypicker) was not separately verified in this session; this report covers the in-app DirectoryPickerDialog served at the v2 web UI.
- 主要语言
- TypeScript
- 星标
- 221k
- 派生
- 29.6k
- 平均合并
- 4 小时 55 分钟
- 30 天内合并 PR
- 500
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
anomalyco/opencode#59886 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#59826 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#59677 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 61/100
anomalyco/opencode#59557 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
anomalyco/opencode#59302 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
e2e-failure ready-to-code
难度 1/5 1 小时以内 新手友好度 82/100
redhat-developer/rhdh-plugin-export-overlays#4616 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
ai-handle
难度 2/5 1-3 小时 新手友好度 72/100
nextlevelbuilder/dewee-web-v2#73 ·
维护者通常 1 天内回复
-
backend bug good first issue
难度 2/5 1-3 小时 新手友好度 70/100
PoCInnovation/Distribox#255 ·
维护者通常 1 天内回复