Repository navigation
fix(wsl): offer the existing host when adding a folder from a distro that already runs as one - #37377
Merged
Merged
Conversation
…that already runs as one
nwparker
marked this pull request as ready for review
November 2, 2026 06:52
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 53 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…ep the offer when the host fails to start - Translate existingTitle/existingWhy/existingAccept into every locale. - A drop onto the open dialog after "Add on host" now prefills the dropped path. - A failed host start keeps the offer so the user can retry or add on this computer. - Tests run the real saved-host read (flag off gives the run-as-host offer) and the offer-to-prefill wiring.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When you pick a
\\wsl.localhost\<distro>\...folder and that distro already runs as a WSL host, Orca now asks whether to add the project on that host (recommended) or keep it on Windows, instead of silently adding it on Windows.What Changed
\\wsl.localhost\<distro>\...in Add Project added it as a Windows project reaching across the file share, with no offer. The "Run as a host" offer only appears while the WSL hosts setting is off, so this case got nothing.\\wsl.localhost\<distro>\mnt\c\...path is a Windows drive seen through the distro, so it gets no offer, matching drops.Why
Sidebar drops already send such folders to the existing host. The folder picker took the old Windows path because the offer is gated on the setting being off. The fix reuses the drop routing and the dialog's own host-path prefill rather than adding a new add path. Declining is not remembered: every add from a host's distro offers the host. That is deliberate, because the host is the recommended home for those folders.
Linked Issue
Found on a Windows test build (v1.4.246-adhoc).
Visual Proof
Not captured: needs a Windows desktop with a WSL host. The notice reuses the layout and primitives of the existing offer.
Testing
use-add-repo-wsl-host-offer.test.tsx(new) covers four cases: the existing-host offer replaces the run-as-host offer; Add on host selects the host and hands over the Linux path; a host that can't be selected is connected through the existing Connect action; Add on this computer adds the Windows path.wsl-host-offer.test.tscovers the routing: a matching distro (any casing), another distro, a drvfs path, a Windows drive, and no hosts.Gates:
pnpm tc,pnpm typecheck:ci,pnpm run check:code-quality:changed, oxlint, and the localization verifiers all pass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Risk
Renderer-only change in the Add Project dialog. It applies only on a Windows desktop with WSL hosts available, the setting on, a saved host for that distro, and "This computer" selected. SSH, paired hosts and folder workspaces are unaffected: the host-path step adds folders as well as repos. Back out with a plain revert.
Level: Low
Notes
Flag-off / User-risk: with the WSL hosts setting off (the default) nothing changes, because the saved-host list is empty and the old offer path runs.
Checklist