Skip to content

fix(app): use server directory in project picker on Windows - #50271

Closed
BoYanZh wants to merge 3 commits into
anomalyco:devfrom
BoYanZh:picker-server-directory
Closed

BoYanZh wants to merge 3 commits into
anomalyco:devfrom
BoYanZh:picker-server-directory

Conversation

@BoYanZh

@BoYanZh BoYanZh commented Sep 21, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #43173

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

On Windows, launching \opencode web\ from \C:\Users\boyanzh\Desktop\Programs\repos\ opened the Web Open project picker anchored at \C:\Users\boyanzh\ (home) instead of the server directory, and nested projects under it were effectively unreachable.

Root cause: both pickers computed their start path as \home || directory. Since home is almost always set, the server directory never won:

  • \dialog-select-directory.tsx: \sync.data.path.home || sync.data.path.directory || ...\
  • \dialog-select-directory-v2.tsx: \props.start || sync.data.path.home || sync.data.path.directory || ...\

I added a small shared helper
esolvePickerStart()\ in \directory-picker-domain.ts\ (explicit start > server directory > home > fallback directory > fallback home) and used it in both dialogs. I also generalized the V1 fallback fetch trigger from \missingHome\ to \missingBase\ so it fires when either value is absent. No UI changes, no hardcoded paths. I checked the backend separately: file list/find work fine from drive roots, so no backend change was needed.

How did you verify your code works?

  • Extended \directory-picker-domain.test.ts\ (+3 tests): start precedence with a Windows home-vs-server-directory pair, nested descent Desktop > Programs > repos > ApexLayer plus parent/root handling, absolute drive input with both separators, \C:\ root, cross-drive roots. Domain file 26/26 pass, full \packages/app\ suite 727/727 pass, prettier clean, oxlint 0 errors.
  • Manual check on Windows 11 with a dev backend (cwd = the repos dir) plus the vite dev frontend: the picker now lists the server dir contents by default, typing \ApexLayer\ finds .../repos/ApexLayer, typing the absolute backslash path narrows to it, selecting it opens the project, and typing \E:/\ lists the other drive.

Screenshots / recordings

No visual changes; behavior-only fix, verified in the browser as described above.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@BoYanZh
BoYanZh force-pushed the picker-server-directory branch from ad85f64 to 36ebe4b Compare September 22, 2026 04:13
@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: folder picker search anchored to home dir; cannot find projects on other drives (Windows)

2 participants