Repository navigation
feat(wsl): offer the drive-path conversion in project settings, and convert the window's stores (D1c-4d) - #33143
Conversation
ae0edfe to
2195374
Compare
87947b8 to
ecf791d
Compare
2195374 to
b34a214
Compare
ecf791d to
d1ba391
Compare
b34a214 to
58e5339
Compare
d1ba391 to
cf19285
Compare
58e5339 to
54befbd
Compare
cf19285 to
6462c3a
Compare
54befbd to
a53538e
Compare
6462c3a to
0242d40
Compare
a53538e to
9f1192c
Compare
0242d40 to
6c14210
Compare
9f1192c to
c728220
Compare
6c14210 to
7166c56
Compare
c728220 to
c3e6842
Compare
7166c56 to
9a2b332
Compare
c3e6842 to
914b6c2
Compare
9a2b332 to
244abe6
Compare
914b6c2 to
05fef6a
Compare
244abe6 to
b36bf0a
Compare
05fef6a to
2112bdc
Compare
b36bf0a to
0e8e459
Compare
2112bdc to
38da560
Compare
0e8e459 to
363e860
Compare
38da560 to
bec0863
Compare
363e860 to
1f34285
Compare
bec0863 to
e415940
Compare
0a22512 to
b9ca555
Compare
75aa19f to
a58d1f0
Compare
[Medium impact] The PR affects a bounded project-conversion flow and its saved state. Do not merge yet: projects with several checkouts still cannot use the conversion action. Findings
SummaryAdds a settings action to reopen WSL UNC drive projects at Windows drive paths and copies the window's saved preferences after restart.
|
| const roots = conversion.rootPaths.flatMap((root) => { | ||
| const drive = wslUncDrivePathToWindows(root, distro) | ||
| return drive ? [normalizeRuntimePathForComparison(drive)] : [] | ||
| }) |
There was a problem hiding this comment.
Sibling worktree preferences stay behind
wslDriveUncRendererKeys allows paths only under rootPaths. A saved worktree can sit outside those folders, such as a sibling app-feature folder beside the repo’s app folder. The main rewrite explicitly includes those worktree paths, but this mapper rejects them even when their IDs appear in worktreeIds.
Those worktrees reopen at drive paths without their quick-open history, PDF zoom, CSV widths, or notebook choices. The renderer still records the stores as complete. Include the old worktree paths in the allowed roots, as the main rewrite does, and add a sibling-worktree test.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
b9ca555 to
74d1a1b
Compare
a58d1f0 to
a30bcc8
Compare
74d1a1b to
8e4c006
Compare
4288890 to
6cfca04
Compare
| // Committed WSL moves only: the list is empty otherwise, and always with the internal gate closed. | ||
| useEffect(() => void runWslMoveRendererStoreRewrites(), []) | ||
| // A Windows-drive conversion's own stores, after the restart that converted the project. | ||
| useEffect(() => void runWslDriveUncRendererStoreRewrites(), []) |
There was a problem hiding this comment.
Restored viewers miss saved preferences
App starts the preference copies without waiting for them before restoring the workspace. If a restored CSV or PDF opens before the copies finish, it reads the new key before the saved preference exists. These viewers do not watch for later storage changes, so they keep default widths or zoom until reopened.
Finish the copies before restoring editor tabs, or notify mounted viewers after copying.
Knowledge Base Used: Desktop renderer experience
8e4c006 to
7fb0b5b
Compare
6cfca04 to
881d451
Compare
| setStep({ kind: 'converting' }) | ||
| let result: WslDriveUncConversionResult | ||
| try { | ||
| result = await window.api.wslDriveUnc.convert({ distro, repoIds: [repo.id] }) |
There was a problem hiding this comment.
Multi-checkout projects cannot convert
The button sends only the selected repository in repoIds. A project can contain several local checkouts of the same upstream. Even when all those checkouts have convertible UNC drive paths, checkScope keeps only the requested ID, and withWindowsGit refuses the conversion because the other project repositories are missing. Every checkout’s button therefore fails for that project.
Pass all convertible repositories belonging to the project together, while keeping the refusal for projects that genuinely span incompatible locations.
7fb0b5b to
c675fa9
Compare
881d451 to
17b6f70
Compare
…onvert the window's stores (D1c-4d)
…sion A refusal over saved state now names the cause: a folder with different details under both its WSL path and its drive path, or a project that also holds a repository that isn't converting. An older host's refusal without a cause keeps the general message.
…ter> is not that Windows drive Co-Authored-By: Claude <[email protected]>
…journal now records
…al: it waits for the window, and finishes on any platform once the gate is open
…comes, as the journal can finish on any platform
17b6f70 to
1c20978
Compare
|
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 7 minutes. 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. Comment |
ELI5
This PR finishes the drive-path conversion from #33135 and puts a button on it. A project that Orca opens through WSL's view of a Windows drive, such as
\\wsl.localhost\Ubuntu\mnt\c\src\app, now has a "Location" row in its settings with "Open at C:\src\app". Clicking it explains what happens, then Orca restarts and reopens the project at the drive path. Git then runs on Windows, and terminals and agents stay in the distro. The window also brings along its own small saved preferences for the project: recent files in quick open, CSV column widths, PDF zoom, and notebook interpreter choices.What Changed
WslDriveUncConversionRowfor a project at a UNC drive path.src/shared/wsl-drive-unc-renderer-store-keys.ts. Unlike the mover, routes stay local and notebook interpreters keep their own path.wslUncDrivePathToWindowsmoves tosrc/shared/wsl-paths.ts, so the window can use it.Why
Linked Issue
Part of the WSL re-write, step D1c-4 (risk rows R36, R6). Stacked on #33135.
Visual Proof
Not captured. The row only appears on Windows with the internal WSL hosts gate on, and I have no Windows box for this work. The row uses only existing settings primitives (
SettingsRow,Button), in the same layout as #33097's Git row.Testing
End-to-end test
tests/e2e/wsl-drive-unc-conversion.spec.ts(electron-headless, passes locally on macOS). It seeds a stopped profile with a UNC drive project, a slept terminal session folder and apreparedjournal. After relaunch it checks:C:\src\app;The tab itself isn't checked there: off Windows
C:\src\appdoesn't exist, so the window drops a missing workspace's tabs. The unit tests check the re-keyed session against a real profile database.Unit tests:
pnpm tc, all ratchets, and the changed-code quality gate pass locally.Manual on Windows: not run.
Review
Self-reviewed.
Agent skill upstream boundary
Notes
App.tsxeffect makes one IPC call at startup, and main answers[]without touching disk while the gate is closed, so no store is imported or rewritten. The settings row shows only behinduseWslHostsEnabled(). The web and mobile client get inert stubs (web-preload-api.ts).wslUncDrivePathToWindowsmoved intowsl-paths.tsverbatim; no existing function there changed.Status
a30bcc848a0: rebased onto main64344142fa0, which has feat(wsl): run Git for Windows for a WSL project on a Windows drive (D1c-2) #33090 squash-merged (fix(wsl-host): tell users how to fix a distro Orca can't host (D1c-1) #33085 earlier) and fix(wsl-mover): hold an app update install while a moved project comes back #35357; feat(wsl): offer Git for Windows in a Windows-drive WSL project's settings (D1c-3) #33097 now targets main. Every commit is kept. CI: running on this head.en.jsonagainst fix(wsl-mover): hold an app update install while a moved project comes back #35357's keys, merged the same way as feat(wsl): offer Git for Windows in a Windows-drive WSL project's settings (D1c-3) #33097 (every key from both sides kept). This PR also carries feat(wsl): convert UNC Windows-drive projects to drive paths across a restart (D1c-4c) #33135's new startup tests onto its own behavior: the journal waits for the window's stores, and once the gate is open the step runs on any platform.profileId: null. The load rule now includescheck:e2e-typecheck-ratchet, which caught it.wslDriveUnc.blocker.notDriveMount). The renderer-rewrite test fixture carries the journal's newprofileId.pnpm tc,pnpm run typecheck:ci, the PR's tests,check:code-quality:changed, the anti-slop oxlint, repo oxlint and ast-grep (including the no-real-time-sleep test rules) and the e2e typecheck ratchet all pass locally on this head, run one branch at a time.