Skip to content

Support Windows drives in the remote host filesystem picker - #7439

Merged
OrcaWin merged 5 commits into
stablyai:mainfrom
MichaelHoughtonDeBox:fix/remote-picker-windows-drives
Jul 29, 2026
Merged

OrcaWin merged 5 commits into
stablyai:mainfrom
MichaelHoughtonDeBox:fix/remote-picker-windows-drives

Conversation

@MichaelHoughtonDeBox

@MichaelHoughtonDeBox MichaelHoughtonDeBox commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7438

Problem

On a multi-drive Windows remote server, the "Browse host filesystem" picker is locked to the system drive:

  • The breadcrumb root (/) resolves to C:\ (resolve('/') on win32), so drives are never listed.
  • Typed drive paths (M:\, M:/dev) don't start path mode — isPathMode only recognizes / and ~ — so the input just filters the current directory and shows No matches for 'M:\'.

Net effect: remote projects can only be created on C:\, while a second storage drive is the main reason to use a Windows tower as a remote server.

Fix

Server (orca-runtime.ts + new windows-drive-listing.ts):

  • A host-root browse (/ or \) on win32 now returns the mounted drives as directory entries (name M:\, resolved path stays /). Enumeration stats A:\–Z:\ and keeps the ones that answer; the stat function is injectable for tests.
  • Entry names keep the trailing separator because a bare M: is drive-relative on Windows.
  • Non-Windows behavior is unchanged.

Client (remote-file-browser-helpers.ts, new remote-file-browser-drive-paths.ts, RemoteFileBrowser.tsx):

  • isPathMode/parsePathInput recognize drive-anchored input (M:\, M:/, bare m:) as a new drive base, normalized to an uppercase M:\ root; segments accept both separators since Windows users habitually type backslashes.
  • joinPath/parentPath are drive-aware: joining from the host root treats drive rows as absolute, "up" from M:\ returns to / (the drive list).
  • Breadcrumbs render drive-shaped committed paths (/ > M: > dev > debox) and rebuild click targets with the matching separator.
  • The committed-prefix fast path (typing only the trailing segment issues no remote call) now also counts \ as a separator.

Notes

  • The existing POSIX behavior is untouched; all drive handling is behind drive-anchor detection, not platform sniffing, since the client doesn't know the host OS. On a POSIX host a literal M:\... input fails resolution with the normal inline error.
  • SSH targets use the same client parsing; a drive path sent to a POSIX SSH host fails with the normal error path. Windows SSH hosts are out of scope here.

Testing

  • New: remote-file-browser-drive-paths.test.ts (split/join/parent/breadcrumb math), windows-drive-listing.test.ts (root-request detection incl. platform gating, drive enumeration with injected stat).
  • Extended: remote-file-browser-helpers.test.ts with drive cases for isPathMode, parsePathInput (incl. repeated-separator rejection for both separators), joinPath, parentPath.
  • Existing suites pass: RemoteFileBrowser.paste.test.tsx, AddRepoDialogStepContent.test.tsx, and the runtime browseServerDir test.
  • typecheck:web, typecheck:node, oxlint, oxfmt clean.

Verified against a real macOS client → Windows 11 remote server (Tailscale, ws://…:6768) where the picker could not leave C:\ while orca repo add --path "M:\…" against the same runtime worked — the limitation reported in #7438.

🤖 Generated with Claude Code

ELI5

On multi-drive Windows remotes, the host filesystem picker was stuck on C:. You can browse and type other drive letters so projects aren’t limited to the system drive.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 52940e66-3a83-4a66-95da-b5d87b0c8fba

📥 Commits

Reviewing files that changed from the base of the PR and between dcb765eac77353ace71f86858c1207dec6e32c36 and 47ae973b228f628df701b00af5fe8e94b06bcea2.

📒 Files selected for processing (1)
  • src/renderer/src/components/sidebar/remote-file-browser-drive-paths.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/sidebar/remote-file-browser-drive-paths.ts

📝 Walkthrough

Walkthrough

This PR adds Windows drive support to the remote file browser. The main process now detects root drive-list requests and returns a drive listing. The renderer adds drive-path parsing, joining, parent traversal, and breadcrumb target helpers, then integrates them into path mode parsing and the remote file browser UI. Tests cover the new drive-request handling, drive-path utilities, helper behavior, and breadcrumb/path rendering updates.

Related PRs: None specified
Suggested labels: windows-support, renderer, main-process, tests
Suggested reviewers: None specified

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the problem, fix, testing, and notes, but it omits the template's Screenshots, AI Review Report, and Security Audit sections. Add the missing template sections, including Screenshots or 'No visual change', an AI review summary, and a basic security audit.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding Windows drive support to the remote host filesystem picker.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/remote-file-browser-drive-paths.ts (1)

39-41: 📐 Maintainability & Code Quality | 🔵 Trivial

Consider path.win32.join instead of manual backslash concatenation.

As per coding guidelines, **/*.{ts,tsx,js,jsx} should "Use path.join or Electron/Node path utilities for file paths — never assume / or \ for cross-platform compatibility." joinDrivePath (and the sibling driveRootOf) manually hardcode \\. Since the target is a remote/Windows host regardless of the local OS, path.join itself wouldn't be correct here (it uses the local platform's separator) — path.win32.join(base, name) would be the compliant equivalent and produces the same result for these cases.

That said, I'm not certain Node's path module is cleanly importable in this renderer bundle, and there's no direct path.win32 API for constructing a bare drive root from a letter, so this is optional rather than blocking.

♻️ Optional refactor using path.win32
-export function joinDrivePath(base: string, name: string): string {
-  return `${base.replace(/[\\/]+$/, '')}\\${name}`
-}
+export function joinDrivePath(base: string, name: string): string {
+  return path.win32.join(base, name)
+}

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 965ad2d6-248a-4cc5-951c-e7879a7bae63

📥 Commits

Reviewing files that changed from the base of the PR and between 492bbe3 and dcb765eac77353ace71f86858c1207dec6e32c36.

📒 Files selected for processing (8)
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/windows-drive-listing.test.ts
  • src/main/runtime/windows-drive-listing.ts
  • src/renderer/src/components/sidebar/RemoteFileBrowser.tsx
  • src/renderer/src/components/sidebar/remote-file-browser-drive-paths.test.ts
  • src/renderer/src/components/sidebar/remote-file-browser-drive-paths.ts
  • src/renderer/src/components/sidebar/remote-file-browser-helpers.test.ts
  • src/renderer/src/components/sidebar/remote-file-browser-helpers.ts

@AmethystLiang AmethystLiang added the orca-remote-server Remote Orca Server / orca serve / paired remote runtime label Jul 22, 2026
@nwparker nwparker added the bug Something isn't working label Jul 27, 2026
@OrcaWin
OrcaWin force-pushed the fix/remote-picker-windows-drives branch from 47ae973 to 5c6790e Compare July 28, 2026 07:25
MichaelHoughtonDeBox and others added 5 commits July 28, 2026 20:21
The remote picker was locked to the system drive on Windows hosts: the
breadcrumb root resolved to C:\ and typed drive paths (M:\dev) were
treated as filter text, so projects could only ever be created on C:.

- Server: answer host-root browses ('/') on win32 with the mounted
  drives instead of resolving to C:\.
- Client: recognize drive-anchored input (M:\, M:/, m:) as path mode,
  resolve segments from the normalized drive root, and make
  joinPath/parentPath/breadcrumbs drive-aware. Up from a drive root
  returns to the host root (the drive list).

Fixes stablyai#7438

Co-Authored-By: Claude Fable 5 <[email protected]>
Review feedback suggested path.win32.join, but the renderer bundle
imports no Node builtins anywhere and runs sandboxed, so path.win32 is
not available here. The backslash targets the remote Windows host
regardless of client OS; say so at the call site.

Co-Authored-By: Claude Fable 5 <[email protected]>
@OrcaWin
OrcaWin force-pushed the fix/remote-picker-windows-drives branch from 5c6790e to 8d3adda Compare July 29, 2026 03:25
const kept = segments.slice(0, endIndex + 1)
return kept.length === 0 ? driveRoot : `${driveRoot}${kept.join('\\')}`
}
import type { FilesystemPathFlavor } from '../../../../shared/types'

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 Import placed at end of file instead of top

The import type { FilesystemPathFlavor } statement is at line 62 — after all the function definitions — rather than at the top with the other module-level declarations. TypeScript hoists module imports so this doesn't break at runtime, but it violates the file-header convention used everywhere else in the codebase and reads like an accidentally committed mid-edit artifact.

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!

Comment on lines +10 to 11
} from './remote-file-browser-drive-paths'
export type DirEntry = {

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 Missing blank line between import block and first export

The last import (} from './remote-file-browser-drive-paths') runs directly into export type DirEntry = { with no separating blank line. This is a minor formatting inconsistency that makes the import block harder to visually scan at a glance.

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!

@greptile-apps

greptile-apps Bot commented Jul 29, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes the remote-host filesystem picker being stuck on C:\ for multi-drive Windows remote servers by adding drive-root enumeration on both the runtime and SSH paths, and teaching the client to parse, navigate, and render drive-anchored inputs (M:\, M:/, bare M:).

  • Server (windows-drive-listing.ts, orca-runtime.ts, ssh-browse.ts): A root-browse request (/) on a win32 runtime now returns mounted drives (A:\–Z:\) via stat probing; the SSH PowerShell path adds a parallel Get-PSDrive-based branch; both attach a new pathFlavor: 'win32' | 'posix' field to every browse result.
  • Client (remote-file-browser-drive-paths.ts, remote-file-browser-helpers.ts, RemoteFileBrowser.tsx): isPathMode and parsePathInput gain a drive base type for drive-anchored input; joinPath/parentPath delegate to drive-aware helpers; breadcrumbs render a / > M: > … shape with correct click targets; the committedPrefix fast path now also detects backslash separators.
  • All new paths are guarded behind drive-anchor detection (not platform sniffing), leaving POSIX behavior completely unchanged.

Confidence Score: 4/5

Safe to merge; the new Windows drive paths are fully gated on drive-anchor detection, leaving all POSIX navigation untouched, and both server paths (runtime and SSH) are covered by unit tests and a new E2E spec.

The implementation is thorough and well-tested across unit, integration, and E2E layers. The one file that warrants a second glance is remote-file-browser-drive-paths.ts — its FilesystemPathFlavor import landed at the very bottom of the file rather than the top, suggesting an in-progress edit that wasn't cleaned up before commit. This is the only anomaly; all other logic is correct.

Files Needing Attention: src/renderer/src/components/sidebar/remote-file-browser-drive-paths.ts — the misplaced import at the end of the file should be moved to the top before merging.

Important Files Changed

Filename Overview
src/main/runtime/windows-drive-listing.ts New module that enumerates Windows drive letters A–Z via stat, skips expected absent-drive errors, and surfaces unexpected I/O failures; well-tested with injectable stat and all paths covered.
src/main/ipc/ssh-browse.ts Adds pathFlavor to all SSH browse results and adds a root-browse short-circuit in browseWithWindowsPowerShell that emits drive roots in the `/' format consumed by the existing line parser.
src/renderer/src/components/sidebar/remote-file-browser-drive-paths.ts New client-side helpers for drive-path splitting, joining, breadcrumb reconstruction, and parent navigation; correct logic but import type { FilesystemPathFlavor } is accidentally placed at the bottom of the file instead of the top.
src/renderer/src/components/sidebar/remote-file-browser-helpers.ts Extends isPathMode, parsePathInput, joinPath, and parentPath to accept pathFlavor and delegate drive paths to the new helpers; minor missing blank line between import block and first export.
src/renderer/src/components/sidebar/RemoteFileBrowser.tsx Threads pathFlavor state through all navigation callbacks and breadcrumb rendering; adds drive-segment rendering with correct click targets; committedPrefix updated to also detect backslash separators.
src/shared/types.ts Adds the new FilesystemPathFlavor union type `'posix'
src/main/runtime/orca-runtime.ts Intercepts root browse on win32 to return the drive list, and appends the correct pathFlavor to the existing browse result.
tests/e2e/runtime-file-browser-windows-drives.spec.ts New E2E test that validates Windows drive-root listing over a paired runtime; correctly skipped on non-Windows platforms.

Sequence Diagram

sequenceDiagram
    participant User
    participant Browser as RemoteFileBrowser
    participant API as browseDir API
    participant Runtime as OrcaRuntime / SSH

    User->>Browser: Open picker (initial load)
    Browser->>API: browseDir("~")
    API->>Runtime: browseServerDir("~")
    Runtime-->>API: "{ resolvedPath, entries, pathFlavor }"
    API-->>Browser: Sets pathFlavor state

    User->>Browser: Type "M:\\"
    Browser->>Browser: isPathMode("M:\\", "win32") → true
    Browser->>API: browseDir("M:\\")
    API->>Runtime: browseServerDir("M:\\")
    Runtime-->>API: "{ resolvedPath, entries, pathFlavor:"win32" }"
    API-->>Browser: Render M: contents

    User->>Browser: Click "/" breadcrumb
    Browser->>API: browseDir("/")
    API->>Runtime: listWindowsDrives()
    Runtime-->>API: "{ resolvedPath:"/", entries:["C:\\","M:\\"] }"
    API-->>Browser: Render drive list

    User->>Browser: Click drive row "M:\\"
    Browser->>Browser: joinPath("/","M:\\","win32") → "M:\\"
    Browser->>API: browseDir("M:\\")
    API-->>Browser: Render M: root contents
Loading

Reviews (1): Last reviewed commit: "fix(ui): key remote breadcrumbs by path" | Re-trigger Greptile

@OrcaWin
OrcaWin merged commit afbd98d into stablyai:main Jul 29, 2026
41 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…#7439)

* Support Windows drives in the remote host filesystem picker

The remote picker was locked to the system drive on Windows hosts: the
breadcrumb root resolved to C:\ and typed drive paths (M:\dev) were
treated as filter text, so projects could only ever be created on C:.

- Server: answer host-root browses ('/') on win32 with the mounted
  drives instead of resolving to C:\.
- Client: recognize drive-anchored input (M:\, M:/, m:) as path mode,
  resolve segments from the normalized drive root, and make
  joinPath/parentPath/breadcrumbs drive-aware. Up from a drive root
  returns to the host root (the drive list).

Fixes stablyai#7438

Co-Authored-By: Claude Fable 5 <[email protected]>

* Document why joinDrivePath uses a literal backslash

Review feedback suggested path.win32.join, but the renderer bundle
imports no Node builtins anywhere and runs sandboxed, so path.win32 is
not available here. The backslash targets the remote Windows host
regardless of client OS; say so at the call site.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Complete Windows drive browsing over SSH

* fix remote Windows drive browsing

* fix(ui): key remote breadcrumbs by path

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: OrcaWin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working orca-remote-server Remote Orca Server / orca serve / paired remote runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Remote host filesystem picker cannot navigate to other drives on Windows hosts (locked to C:\)

5 participants