Repository navigation
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
There was a problem hiding this comment.
Read through, plus the selection domain tests (55 pass) and the packages/app type check (passes). I couldn't check the Windows-only display here.
The separator part fixes a real bug. displayPickerPath already shows Windows drive paths with \, but the base still added / to directory suggestions and accepted completions, and only stripped trailing /. So C:\repo\apex/ showed up, and a typed C:\repo\ wasn't seen as the current folder. The new helpers fix both, and POSIX paths behave as before.
The start-directory reorder doesn't change behaviour, so on its own it doesn't fix #54626 (see the inline comment). The web client always sets sync.data.path.home to an empty string (loadPathQuery in runtime/server/global-sync/bootstrap.ts), so home never won in the old order either. sync.data.path.directory and the fallback both come from GET /api/location. In my reading, when the picker opens at home it's because the server it talks to reports home as its location. The background service used by opencode and opencode pair does that. Could you say on #54626 how you started the server, and attach before/after screenshots of the picker on Windows?
Public API: unchanged.
| props.location?.directory || | ||
| sync.data.path.directory || | ||
| fallbackPath.latest?.directory, | ||
| const start = createMemo(() => |
There was a problem hiding this comment.
This reorder doesn't seem to change which directory the picker opens at. sync.data.path.home is always "" on the web side (loadPathQuery sets home: ""), so it never won before either. location()?.directory (props.location, or api.location.get()) and sync.data.path.directory both come from the same /api/location response. The old and new orders end up at the same value. If the picker opened at home for you, the server probably reported home as its location (e.g. the background service). That would need a fix elsewhere, not in this memo. Unless you have a case where the result differs, I'd drop resolvePickerStart and keep this PR to the separator fix.
| expect(nextSuggestionIndex(0, 1, 0)).toBe(-1) | ||
| }) | ||
|
|
||
| test("prefers the server directory over home for the picker start", () => { |
There was a problem hiding this comment.
These four resolvePickerStart tests only check the order of an a || b || c chain, and home is never set at runtime. If the reorder is dropped (see the comment on dialog.tsx), they can go too. The test.each separator cases are enough.
|
Windows in-browser verification (dev app + \serve\ backend from a nested dir, pristine \707de58\ vs this branch). Same steps both times: Add project picker, type \C:\...\opencode-pristine\pack, read the suggestion list:
Server started with \serve\ from the nested directory; screenshots available on request (no image upload via CLI, can drag-drop them here if needed). |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Screenshot attached. |
802415e to
fb08633
Compare
fb08633 to
485cd06
Compare
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #54663 (split out from #54626).
Type of change
What does this PR do?
Fix the separators added by the Windows web directory picker. Previously, directory suggestions and Tab-completed paths could end with a mixed separator such as
C:\repo\apex/, and input comparison stripped only/.Add
pickerDisplaySeparator,withPickerSeparator, andstripPickerTrailingSeparatorindomain.ts; use them for completion, suggestion suffixes, and input comparison indialog.tsx. POSIX behavior and the public API are unchanged.Commit
802415ealready removes the ineffectiveresolvePickerStartreorder and its four tests. The picker start order matches base707de58. This PR does not claim to change the server-reported starting directory.How did you verify your code works?
Rechecked on Windows at
802415e98198fbe67ebed61bcbab864a02238df8with Bun 1.3.14:packages/app:bun test ./src/workspaces/selection— 52 pass, 0 fail, 107 expect() calls, 2 files. The previous count of 56 included the four removed tests.git diff --checkagainst base707de58: passes.bun typecheckfrompackages/app: fails with TS1128 atsrc/custom-elements.d.ts(1,1)and(1,2). That file is unchanged by this PR. No full type-check success is claimed.check,test, andnix-evalfor this head reportaction_required; CI is not confirmed passing.Windows reproduction and recorded before/after
The existing Windows verification record compared pristine
707de58with this branch, using the local dev app and a backend started withservefrom a nested directory. The exact historical arguments and working directory were not recorded.Recorded steps: open Add project, type
C:\...\opencode-pristine\pack, inspect suggestions, and press Tab.C:\...\opencode-pristine\packages/C:\...\opencode-pristine\packages\C:\...\packages/C:\...\packages\These are previously recorded observations, not a new browser run. They establish separator behavior only, not a change in the initial directory.
The repository documents separate local development processes:
bun dev serve --port 4096packages/app:bun dev -- --port 4444http://localhost:4444, targeting the backend athttp://localhost:4096.This is documented setup guidance, not a claim that these exact arguments were used in the earlier nested-directory verification.
Screenshots / recordings
Checklist