Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between dcb765eac77353ace71f86858c1207dec6e32c36 and 47ae973b228f628df701b00af5fe8e94b06bcea2. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis 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 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/remote-file-browser-drive-paths.ts (1)
39-41: 📐 Maintainability & Code Quality | 🔵 TrivialConsider
path.win32.joininstead of manual backslash concatenation.As per coding guidelines,
**/*.{ts,tsx,js,jsx}should "Usepath.joinor Electron/Node path utilities for file paths — never assume/or\for cross-platform compatibility."joinDrivePath(and the siblingdriveRootOf) manually hardcode\\. Since the target is a remote/Windows host regardless of the local OS,path.joinitself 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
pathmodule is cleanly importable in this renderer bundle, and there's no directpath.win32API 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.tssrc/main/runtime/windows-drive-listing.test.tssrc/main/runtime/windows-drive-listing.tssrc/renderer/src/components/sidebar/RemoteFileBrowser.tsxsrc/renderer/src/components/sidebar/remote-file-browser-drive-paths.test.tssrc/renderer/src/components/sidebar/remote-file-browser-drive-paths.tssrc/renderer/src/components/sidebar/remote-file-browser-helpers.test.tssrc/renderer/src/components/sidebar/remote-file-browser-helpers.ts
47ae973 to
5c6790e
Compare
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]>
5c6790e to
8d3adda
Compare
| const kept = segments.slice(0, endIndex + 1) | ||
| return kept.length === 0 ? driveRoot : `${driveRoot}${kept.join('\\')}` | ||
| } | ||
| import type { FilesystemPathFlavor } from '../../../../shared/types' |
There was a problem hiding this comment.
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!
| } from './remote-file-browser-drive-paths' | ||
| export type DirEntry = { |
There was a problem hiding this comment.
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 SummaryThis PR fixes the remote-host filesystem picker being stuck on
Confidence Score: 4/5Safe 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 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.
|
| 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
Reviews (1): Last reviewed commit: "fix(ui): key remote breadcrumbs by path" | Re-trigger Greptile
…#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]>
Fixes #7438
Problem
On a multi-drive Windows remote server, the "Browse host filesystem" picker is locked to the system drive:
/) resolves toC:\(resolve('/')on win32), so drives are never listed.M:\,M:/dev) don't start path mode —isPathModeonly recognizes/and~— so the input just filters the current directory and showsNo 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+ newwindows-drive-listing.ts):/or\) on win32 now returns the mounted drives as directory entries (nameM:\, resolved path stays/). Enumeration statsA:\–Z:\and keeps the ones that answer; the stat function is injectable for tests.M:is drive-relative on Windows.Client (
remote-file-browser-helpers.ts, newremote-file-browser-drive-paths.ts,RemoteFileBrowser.tsx):isPathMode/parsePathInputrecognize drive-anchored input (M:\,M:/, barem:) as a newdrivebase, normalized to an uppercaseM:\root; segments accept both separators since Windows users habitually type backslashes.joinPath/parentPathare drive-aware: joining from the host root treats drive rows as absolute, "up" fromM:\returns to/(the drive list)./ > M: > dev > debox) and rebuild click targets with the matching separator.\as a separator.Notes
M:\...input fails resolution with the normal inline error.Testing
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).remote-file-browser-helpers.test.tswith drive cases forisPathMode,parsePathInput(incl. repeated-separator rejection for both separators),joinPath,parentPath.RemoteFileBrowser.paste.test.tsx,AddRepoDialogStepContent.test.tsx, and the runtimebrowseServerDirtest.typecheck:web,typecheck:node,oxlint,oxfmtclean.Verified against a real macOS client → Windows 11 remote server (Tailscale,
ws://…:6768) where the picker could not leaveC:\whileorca 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.