Repository navigation
fix(dashboard): open remote-editor links as a file, not a folder - #39642
Conversation
VS Code reads a vscode://vscode-remote/ssh-remote+<host><path> link with no :<line> suffix as a folder, so Open in VS Code opened an empty remote workspace instead of the file. End the link in :1; the editor strips it and opens the file at line 1.
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The PR changes only the "Open in VS Code" row's link target ( [UX-REVIEWED] 1659c2d Description read[DESCRIPTION-READ] 7d6ed33bbfa4f686fc3f33bfe9c310f5413479f6c46b7c7f98b2d3929234c31a That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (3 items) — 3 justifiedIntent: make the side panel's "Open in VS Code" row open the file itself on the remote host, not an empty remote workspace. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 1659c2d Description read[DESCRIPTION-READ] 760358051b250ca2a45785baea933785ca89728f7e0b9bad3316881bd05668d6 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this is a one-line fix in the only link builder, and the desktop app's link check already accepts the Notes
[DESIGN-REVIEWED] 1659c2d Description read[DESCRIPTION-READ] c56900f20ff58cf857e8b6e62d0511f62da4099a29e76a42e1af88f9e0f7d1d4 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
bolichen97
left a comment
There was a problem hiding this comment.
Approved on head 1659c2d29f.
Appending :1 to the vscode-remote link is the smallest fix for #38284: without a :<line> VS Code reads an ssh-remote path as a folder and opens an empty workspace, and the editor strips the suffix before opening the file. The desktop's editor-link check already accepts an optional :line[:col], so the link still passes it. Tests pin the new suffix. Readiness passed.
Thanks, Helena!
AI-assisted, sent by Bolin Review bot
Problem / Motivation
Goal: The side panel's "Open in VS Code" row opens the file itself in the viewer's local VS Code, instead of an empty remote workspace.
With Settings → Display → Remote editor set to VS Code and an SSH host, ⋯ → Open in VS Code launches VS Code, connects to the host, and shows no file. The link is
vscode://vscode-remote/ssh-remote+<host><path>, and VS Code's protocol handler reads anssh-remotepath with no:<line>suffix as a folder (getWindowOpenableFromProtocolUrlinsrc/vs/code/electron-main/app.tsreturnsfolderUriunless the path is a.code-workspaceor ends in:<line>[:<col>]).Why it matters
The row's only job is to open the file, and today it fails on every click for everyone who turns the setting on.
Not a goal
What changed (motivation → approach → change)
Symptom: the link opens the path as a folder. Cause: no
:<line>suffix, so VS Code picksfolderUri. Change:remoteEditorUrlends every link in:1. Its one caller (the Markdown panel ⋯ menu) only links files. VS Code opens protocol links withgotoLineMode: true, so it strips the:1withparseLineAndColumnAwareand opens the file at line 1. The desktop app's editor-link check (EDITOR_LINK_REinwebsite/electron/external-scheme.js) already accepts up to two:<n>suffixes, so it needs no change.One limit stays:
parseLineAndColumnAwaredrops every all-digit:-segment of the decoded path, so a file whose name has one (run-12:30:05.log) still opens the wrong path. No link shape avoids that, and those files opened as a folder before too.The feature map, the dashboard module spec and the
REMOTE_EDITOR_IDScomment insrc/kiro_crew/config/sections_dashboard.pydescribe the link shape; each now shows the:1. The config change is that comment only.Backwards compatibility
Compatible: only the generated
hrefgains a:1; no config key, schema or API changes.Removes nothing: the row, its gating and its path checks are unchanged.
Tests
website/src/test/MarkdownPanel.remoteEditor.test.tsx: the ⋯ menu row'shrefand the directremoteEditorUrlcase now expect the trailing:1, so a link without it fails.Proof: not provable -- frontend test (prove.py runs Python only)
By hand: with
remoteEditorUrl.tsrestored to main 98a7d29, both changed tests fail (2 failed, 5 passed); on head 1659c2d the file passes 7/7.Manual verification
Pasting the before and after links into a Mac browser with VS Code + Remote-SSH: without
:1VS Code opens a remote window with the file's path as its (empty) workspace; with:1it opens the file.Real-machine verification
Machine: MacBook (macOS, arm64) running VS Code with Remote-SSH, dashboard served from an AL2023 x86_64 cloud desktop gateway
Before (main 98a7d29, installed 0.13.0.4 build): ⋯ → Open in VS Code -> VS Code connects to the host and opens no file
After (head 1659c2d):
vscode://vscode-remote/ssh-remote+<host>/<abs path to an existing file>:1, clicked from the Mac -> VS Code connects to the host and opens the file with its contentsCleanup: own computer
Screenshots / video
Why no screenshot: the menu row looks the same; only its link target changes.
Related Issues
Part of #38284
Sibling sweep
Swept: git grep -n 'ssh-remote+' -- website/src src docs
Sibling: website/electron/external-scheme.js -- not affected -- it validates links and already allows a : suffix
Sibling: website/src/utils/urlTransform.ts -- not affected -- passes through links a user wrote, which keep their own suffix
Pattern harvest
Not generalizable: one link builder targets one editor's URL handler; there is no second builder of this link.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commits