Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

desktop: directory picker submits home directory instead of typed path when adding a project

Đang mở Phù hợp với người mới
#59,589 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
electron, typescript
Lĩnh vực
desktop, frontend

Hướng nghiên cứu

Báo cáo xác định DirectoryPickerDialog là điểm vào phía client. Hãy đọc trình xử lý gửi và cách ô nhập tìm kiếm, gợi ý đang hoạt động và lựa chọn hiện tại được theo dõi; sau đó tái hiện luồng Windows bằng cách nhập đường dẫn tuyệt đối và chọn thư mục mà không chọn gợi ý nào. Hoàn tất khi yêu cầu sử dụng đường dẫn đã nhập hoặc thao tác gửi bị chặn cho đến khi đường dẫn được xác nhận.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

  1. Open the v2 web UI served by the desktop's background service (e.g. via an opencode pair link) and go to Home.
  2. Click Add project. The in-app "Open project" dialog opens; the footer/selection line shows the home directory (C:\Users\<user>).
  3. 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.
  4. Click Select folder.
  5. 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.
  6. Home switches to the project C: (worktree C:/, id global).

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/location with no directory) touch it on every relevant page load.
  • The desktop-native flow (Electron openDirectory picker) was not separately verified in this session; this report covers the in-app DirectoryPickerDialog served at the v2 web UI.
Ngôn ngữ chính
TypeScript
Star
221k
Fork
29.6k
Merge trung bình
4 giờ 53 phút
Pull request đã merge (30 ngày)
506

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.