fix(web): open remote files correctly in VS Code editors - #10824
fix(web): open remote files correctly in VS Code editors#10824KyleKincer wants to merge 1 commit into
Conversation
FilePreviewPanel passes a selected file to the shared picker. Preserve file or folder intent and add the line suffix VS Code and its forks require for remote file URLs.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, localized fix that distinguishes remote files from folders by adding the VS Code-compatible line suffix while preserving existing folder and local editor behavior. The affected URL-building and forwarding paths have focused regression coverage, with no product-default or static-analysis configuration changes. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change distinguishes file and folder paths when opening remote editors. File URLs receive a ChangesRemote editor path handling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Remote file previews now open as files through supported VS Code-based remote editor URLs, while project and worktree launches retain folder behavior. No concrete current-head merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What Changed
Opening a remote file from the file preview could connect over SSH and leave an empty VS Code window with
ENOTDIR.FilePreviewPanelintentionally passed the selected file's absolute path toOpenInPickerasopenInCwd; the URL builder treated every target as a folder.Rename the picker input to
openInPathand require an explicit file/folder kind. File links get a:1suffix, while project and worktree links keep their folder behavior. The shared fix covers VS Code, Cursor, VS Code Insiders, and VSCodium.Why
VS Code's remote protocol handler uses a trailing line number to distinguish a file from a folder. The caller already knows which it is, so this needs no filesystem request, extension guessing, project-root restriction, or server protocol change. Local editor launches keep their existing behavior.
Validation:
remoteOpen.test.ts,ChatHeader.test.ts, andElectronShell.test.ts. Coverage includes all supported remote editor schemes, extensionless files, Windows paths, URL encoding, folders with extensions, and desktop URL forwarding.ENOTDIR, and the corrected URL opened the fixture's contents over SSH.UI Changes
Captured the file-preview button's output in an isolated T3 web environment and replayed it through VS Code's URL handler because the embedded test browser did not launch the custom scheme. Both runs used the same harmless fixture and SSH host. No layout changes.
Short recording of the remote file opening
Checklist
Model: GPT-6. Harness: Codex.
Summary by CodeRabbit