Skip to content

feat(wsl): offer the drive-path conversion in project settings, and convert the window's stores (D1c-4d) - #33143

Merged
nwparker merged 7 commits into
mainfrom
nwparker/wsl-d1c-4d-unc-conversion-ui
Oct 29, 2026
Merged

nwparker merged 7 commits into
mainfrom
nwparker/wsl-d1c-4d-unc-conversion-ui

Conversation

@nwparker

@nwparker nwparker commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​409 $\color{#cf222e}{\Huge{\mathbf{−}}}$​26 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​383
Prod 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​674 $\color{#cf222e}{\Huge{\mathbf{−}}}$​20 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​654

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

  • Before: only the main process could convert these projects (feat(wsl): convert UNC Windows-drive projects to drive paths across a restart (D1c-4c) #33135), with no way in from the UI, and the window's own preferences for the project stayed under the old id.
  • After (internal WSL hosts gate on):
    • Settings row. Project settings show WslDriveUncConversionRow for a project at a UNC drive path.
    • Window stores. After the restart, the window copies its stores to the new keys, then records each one. The journal is removed only once every main and window store is recorded.
      • This is the WSL mover's renderer-rewrite pattern: the same stores and copy functions, an applied-marker in the window's storage, and a ledger entry over IPC.
      • The key mapping is in src/shared/wsl-drive-unc-renderer-store-keys.ts. Unlike the mover, routes stay local and notebook interpreters keep their own path.
    • Startup gating. Starting a conversion stays Windows-only. Running an already-journaled conversion at startup, and the window's list and record calls, now follow the journal on any platform. Only Windows can write that journal, and this lets the end-to-end test run on every lane.
    • Housekeeping.
      • wslUncDrivePathToWindows moves to src/shared/wsl-paths.ts, so the window can use it.
      • There is a desktop-only stub for the web client.
      • The new localStorage module is listed in the mover's storage census.

Why

  • This closes the D1c-4 loop: UNC drive projects now have a destination, so D4 doesn't strand them (R36).
  • Why copy the window entries rather than move them. It reuses the mover's store functions unchanged, and a downgraded build still finds its old entries.

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 a prepared journal. After relaunch it checks:

    • the project lists at C:\src\app;
    • the session folder is renamed;
    • the worktree comment follows the new id;
    • the project gets Windows Git;
    • the journal goes once the window has recorded its stores.

    The tab itself isn't checked there: off Windows C:\src\app doesn'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:

    • the window key mappings;
    • the main-side window ledger (list, record, drop the journal when complete, keep it while a main store retries);
    • the row and its refusal copy.
  • pnpm tc, all ratchets, and the changed-code quality gate pass locally.

  • Manual on Windows: not run.

Review

Self-reviewed.

Agent skill upstream boundary

  • Not applicable.

Notes

  • Flag-off: no change. The new App.tsx effect 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 behind useWslHostsEnabled(). The web and mobile client get inert stubs (web-preload-api.ts). wslUncDrivePathToWindows moved into wsl-paths.ts verbatim; no existing function there changed.
  • Known gap: if the window's storage write is lost after it records a store, that store isn't re-applied, because the journal is already gone. The mover instead lists committed moves forever. Here the cost is only recent-file history and view preferences.
  • SSH: remote projects are never offered the row.
  • Wire compatibility: none. These are desktop IPC only, and the web client gets a refusing stub.

Status

@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from ae0edfe to 2195374 Compare October 25, 2026 02:01
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 87947b8 to ecf791d Compare October 25, 2026 02:02
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 2195374 to b34a214 Compare October 25, 2026 02:31
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from ecf791d to d1ba391 Compare October 25, 2026 02:32
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from b34a214 to 58e5339 Compare October 25, 2026 04:35
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from d1ba391 to cf19285 Compare October 25, 2026 04:35
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 58e5339 to 54befbd Compare October 25, 2026 06:40
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from cf19285 to 6462c3a Compare October 25, 2026 06:40
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 54befbd to a53538e Compare October 25, 2026 08:30
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 6462c3a to 0242d40 Compare October 25, 2026 08:30
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from a53538e to 9f1192c Compare October 25, 2026 09:48
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 0242d40 to 6c14210 Compare October 25, 2026 09:48
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 9f1192c to c728220 Compare October 25, 2026 10:21
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 6c14210 to 7166c56 Compare October 25, 2026 10:22
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from c728220 to c3e6842 Compare October 25, 2026 11:10
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 7166c56 to 9a2b332 Compare October 25, 2026 11:10
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from c3e6842 to 914b6c2 Compare October 25, 2026 12:00
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 9a2b332 to 244abe6 Compare October 25, 2026 12:00
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 914b6c2 to 05fef6a Compare October 25, 2026 12:36
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 244abe6 to b36bf0a Compare October 25, 2026 12:36
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 05fef6a to 2112bdc Compare October 25, 2026 13:03
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from b36bf0a to 0e8e459 Compare October 25, 2026 13:03
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 2112bdc to 38da560 Compare October 25, 2026 13:16
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 0e8e459 to 363e860 Compare October 25, 2026 13:16
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 38da560 to bec0863 Compare October 27, 2026 23:53
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 363e860 to 1f34285 Compare October 27, 2026 23:53
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from bec0863 to e415940 Compare October 28, 2026 02:13
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 0a22512 to b9ca555 Compare October 28, 2026 20:57
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 75aa19f to a58d1f0 Compare October 28, 2026 20:57
@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P1 Multi-checkout projects cannot convert ▶
  2. P2 Sibling worktree preferences stay behind ▶
  3. P2 Restored viewers miss saved preferences ▶

Summary

Adds a settings action to reopen WSL UNC drive projects at Windows drive paths and copies the window's saved preferences after restart.

  • Project settings can reopen eligible WSL projects at their Windows drive paths.
  • Saved window preferences follow a converted project to its Windows drive path.

Diagram

sequenceDiagram
  participant U as User
  participant R as Settings window
  participant M as Main process
  participant J as Conversion journal
  U->>R: Confirm conversion
  R->>M: Convert selected repository
  M->>J: Save prepared conversion
  M->>M: Restart and rewrite profile
  M->>J: Record main stores
  R->>M: List renderer rewrites
  M-->>R: Paths and worktree IDs
  R->>R: Copy saved preferences
  R->>M: Record each renderer store
  M->>J: Remove when all stores finish
Loading

Reviews (7) · Last reviewed commit: "test(wsl): off Windows the conversion IP..." · Reviewed by Greptile

Comment on lines +37 to +40
const roots = conversion.rootPaths.flatMap((root) => {
const drive = wslUncDrivePathToWindows(root, distro)
return drive ? [normalizeRuntimePathForComparison(drive)] : []
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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!

@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from b9ca555 to 74d1a1b Compare October 28, 2026 22:47
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from a58d1f0 to a30bcc8 Compare October 28, 2026 22:47
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 74d1a1b to 8e4c006 Compare October 29, 2026 01:16
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 4288890 to 6cfca04 Compare October 29, 2026 01:16
Comment thread src/renderer/src/App.tsx
// 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(), [])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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

@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 8e4c006 to 7fb0b5b Compare October 29, 2026 02:02
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 6cfca04 to 881d451 Compare October 29, 2026 02:05
setStep({ kind: 'converting' })
let result: WslDriveUncConversionResult
try {
result = await window.api.wslDriveUnc.convert({ distro, repoIds: [repo.id] })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4c-unc-conversion-run branch from 7fb0b5b to c675fa9 Compare October 29, 2026 02:26
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 881d451 to 17b6f70 Compare October 29, 2026 02:33
nwparker and others added 7 commits October 28, 2026 23:39
…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.
…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
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-4d-unc-conversion-ui branch from 17b6f70 to 1c20978 Compare October 29, 2026 06:48
@nwparker
nwparker requested a review from Jinwoo-H as a code owner October 29, 2026 06:48
@nwparker
nwparker changed the base branch from nwparker/wsl-d1c-4c-unc-conversion-run to main October 29, 2026 06:48
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c0e03e36-ed7a-4278-83ec-173d17d8f529
Commits

Reviewing files that changed from the base of the PR and between f245dc7 and 1c20978.

Files selected for processing: 24
  • src/main/ipc/wsl-drive-unc-conversion-handlers.test.ts
  • src/main/ipc/wsl-drive-unc-conversion-handlers.ts
  • src/main/wsl/wsl-drive-unc-conversion-renderer.test.ts
  • src/main/wsl/wsl-drive-unc-conversion-renderer.ts
  • src/main/wsl/wsl-drive-unc-conversion-startup.test.ts
  • src/main/wsl/wsl-drive-unc-conversion-startup.ts
  • src/main/wsl/wsl-drive-unc-conversion-stores.ts
  • src/main/wsl/wsl-drive-unc-project-scope.ts
  • src/preload/api-types.ts
  • src/preload/api/wsl-drive-unc-conversion-bridge.ts
  • src/preload/index.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/settings/repository/execution/RepositoryWindowsRuntimeSection.tsx
  • src/renderer/src/components/wsl-drive-project/WslDriveUncConversionRow.test.tsx
  • src/renderer/src/components/wsl-drive-project/WslDriveUncConversionRow.tsx
  • src/renderer/src/components/wsl-drive-project/wsl-drive-unc-conversion-copy.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/wsl-drive-unc-renderer-store-rewrites.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/wsl-drive-unc-renderer-store-keys.test.ts
  • src/shared/wsl-drive-unc-renderer-store-keys.ts
  • src/shared/wsl-move/wsl-move-storage-dispositions.ts
  • src/shared/wsl-paths.ts
  • tests/e2e/wsl-drive-unc-conversion.spec.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit a7f9888 into main Oct 29, 2026
4 checks passed
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.

2 participants