Repository navigation
feat(dashboard): open remote files in a local editor via ssh links - #11345
helenastafford wants to merge 2 commits into
Conversation
|
Intent: Give a remote/headless-gateway session a way to open a file in the user's local editor over their own SSH creds, via an opt-in |
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Description promises Watch
[DESIGN-REVIEWED] 5e98b66 |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Configuring an editor with the SSH host empty is a silent no-op — the menu row never appears and nothing in Settings says why. Watch
Suggestions
[UX-REVIEWED] 5e98b66 |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The description ships a four-editor enum ( Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: let someone using the dashboard against a remote/headless gateway open a file in their local editor over their own SSH session — an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 5e98b66 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsFINDING -- website/src/components/FilePathMenu.tsx:183 -- False positive or not applicable? A repository writer can comment: |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
8cf6bc9 to
69d5cdf
Compare
69d5cdf to
6442f42
Compare
…inks (#11338) Adds dashboard.remote_editor.editor (vscode/kiro, empty = off) and a charset-clamped dashboard.remote_editor.host setting, exposed through the branding payload beside direct_local. FilePathMenu, MarkdownPanel, and FileViewer gain an "Open in <editor>" row gated on !directLocal && editor && host, building vscode-remote ssh-remote+<host><absolute path> links so edits ride the user's own SSH credentials. Absolute-path guard rejects relative paths that could graft onto the SSH authority. Settings > Display gains a Remote editor card; i18n across all locales. Closes #11338
6442f42 to
cef86a0
Compare
…nu row
Two committed harnesses so reviewers can reproduce the PR's evidence frames:
- capture-remote-editor-settings.mjs drives the REAL built SPA against the
shared stub and shoots the Settings > Display "Remote editor" card in its
off, configured, and light-parity states, asserting the applied data-theme
matches each frame's name.
- capture/remote-editor-menu.{html,tsx} + capture-remote-editor-menu.mjs mount
the real MarkdownRenderer + FilePathMenu inside the REAL BrandingProvider
with only the transport stubbed (direct_local false, editor + host set), so
the "Open in <editor>" row's gate is exercised rather than bypassed. Frames
assert the row's presence per menu, including a DIRECTORY chip (the row is
deliberately not file-gated: a directory opens as a remote workspace).
- run-capture-with-vite.mjs runs an entry-based harness against a temporary
vite dev server, owning the child's lifecycle in-process.
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days with failing CI. I've assessed the blockers and they appear resolvable — I'll push fixes directly to this branch as a co-author. Assessment: No lane blocks this — GPT 5.6 and Opus 4.8 both pass with a single advisory finding between them, and 77 checks are green. Four things to settle, all mechanical or answerable:
One I can't close myself: Design's Watch If you'd prefer I don't touch this PR, add the |
jcjaskula-aws
left a comment
There was a problem hiding this comment.
Thanks for this. It matches a setup I use daily: a headless gateway, with the dashboard opened from a laptop over an ssh -L forward. I've worked on something quite similar locally (opening transcript path chips in the attached Kiro IDE from the file-path menu), and ran into the two issues below along the way, see the inline comments.
The branch is now conflicting and has had no commits since 09-18. If it helps, I'm happy to take this PR over: rebase it and address these two points. Just say so.
| // Remote gateways only; a local (or origin-unknown) session uses the OS | ||
| // open/reveal rows instead. `!remoteEditor` guards a branding value that has | ||
| // not loaded yet or a partial test stub that omits the field. | ||
| if (directLocal || !remoteEditor) return null |
There was a problem hiding this comment.
With a browser that reaches the gateway through an SSH port forward, this hides the row in exactly the topology #11338 targets. The request arrives on loopback, so direct_local is true even though the gateway host has no desktop, and useRemoteEditorOpen returns null.
The same thing affects the issue's premise that Open with default app / Reveal "degrade to Copy path" on remote sessions. Through a tunnel they don't degrade: they render, and clicking them falls back to a clipboard copy, because nothing checks whether the host has a launcher.
What fixed both for me was gating on whether the host can actually launch something (a stat of the binary the launcher would spawn: xdg-open / open / explorer.exe, never spawning it to find out) instead of on locality.
| */ | ||
| export function remoteEditorUrl(editor: string, host: string, absPath: string): string | null { | ||
| const entry = REMOTE_EDITORS[editor] | ||
| if (!entry || !host || !absPath || !absPath.startsWith('/')) return null |
There was a problem hiding this comment.
Transcript chips often carry ~/… or repo-relative paths. Those currently lose the row without any feedback.
Expanding ~ and anchoring relative paths to the session's project directory worked well for me, provided the sensitive-path screen runs again on the resolved form. For example, .ssh/id_rsa passes the screen as written and only matches once it's anchored.
|
PR triage (2026-10-05): REBASE + merge discussion. No close, no request-changes.
|
|
@helenastafford are you still planning to work on this one? It's now quite far behind main (see the 10-05 triage above), and it's a feature I'd like to see land. If you're short on bandwidth, I'm happy to take it over: rebase onto current main keeping your commits and authorship, then address the open items from the triage and my review above. Just let me know either way, and if I don't hear back in a week or so I'll open a follow-up PR that builds on your branch and credits you. |
|
Superseded by #19557. That PR is this change rebased onto current main, with two redesigns: the row is no longer hidden on direct-local sessions (an ssh -L forward reads as direct-local, as @jcjaskula-aws and the triage pointed out), and Remote editor is now its own pane in the split Display settings. I couldn't push here because this PR's head branch lives in kirodotdev/KiroCrew and my account now has only read access, so the new PR comes from my fork. |
Problem / Motivation
When the KiroCrew gateway runs on a remote/headless host (cloud desktop, EC2) and you use the dashboard from a laptop, the file-path menus have no working "open in an editor" action. Open with default app and Reveal are correctly gated on
direct_local— they shell out on the gateway host, which has no desktop here — and the Electron Open in editor bridge targets the laptop's filesystem, where the file does not exist. So every file-open affordance dead-ends at Copy path, and editing a file the agent cannot write (trust-root config likeconfig.json,.env) means a manual SSH session.Why it matters
The remote-gateway-on-a-cloud-desktop topology is common, and it is exactly where you most need to jump into an editor for the files the agent and the read-only Files app cannot touch. Today that is a context switch to a terminal every time.
What changed (motivation → approach → change)
VS Code-family editors accept a remote authority in their URL scheme, so a link like
vscode://vscode-remote/ssh-remote+<host><path>launches the user's local editor, which connects over the user's own SSH credentials and opens the remote file with full edit authority. That is the right approach because KiroCrew grants nothing new — no write endpoint on the page or the agent; the write rides SSH, entirely outside KiroCrew's trust boundary.The only missing piece is that the browser cannot know the user's SSH authority for the gateway host, so this adds two opt-in dashboard settings and one menu row:
dashboard.remote_editor.editor— an enum (""off ·vscode·kiro·cursor·windsurf), not a free string: the value is interpolated into a clickable custom-scheme URL, so an open string would let a config write mint a link to any registered protocol handler.dashboard.remote_editor.host— charset-restricted to^[A-Za-z0-9._@+-]*$so it cannot inject path/query/authority structure into the generated URL.Both keys ride the existing
dashboard.terminal.*nested-sub-key pattern (schema flatten +_EDITABLE_CONFIGwrite gate). The/api/dashboard/brandingpayload carriesremote_editor {editor, host}next todirect_local, and clamps both: an unknown editor or a non-charset-clean host becomes""before it reaches the client, so a hand-edited config that slipped past the load-time schema can never produce a link.FilePathMenu(and the shared MarkdownPanel/FileViewer overflow menus that reuse its hooks) grow one Open in row, gated on!directLocal && editor !== "" && host !== "". Directories are allowed — a vscode-remote authority opens a directory as a remote workspace. A Remote editor card in Settings → Display (next to Terminal) sets the two keys.Before → After, the file-path menu on a remote session:
<editor>🟩 added · 🟥 unavailable · 🟦 unchanged — a remote user now has a way into an editor instead of only "Copy path".
Tests
test/test_config_patch.py::TestRemoteEditor): editor enum accepts each valid value and"", rejects unknowns; host accepts valid authorities/aliases, rejects URL-structural characters (/ : ? #, whitespace) and over-length; the two sub-keys nest without clobbering each other.test/test_config_schema.py): both keys flatten into first-class schema entries; the enum and host pattern/maxLength are present; the dict stays open.test/test_dashboard_branding.py): branding is{"":""}by default, forwards a configured pair, and clamps an unknown editor and a dirty host to""(keeping a valid editor when only the host is dirty).src/test/FilePathMenu.test.tsx): the row shows only on a remote session with editor+host set, is hidden when local / editor unset / host unset, is shown for a directory, and routes the exactvscode-remoteURL throughwindow.locationon select. PlusremoteEditorUrlunit tests for URL shape, per-editor scheme, path percent-encoding, and null cases.Manual verification
Verified the backend end-to-end against a temp config (load round-trip + branding clamp) and the frontend row/URL via the vitest suite above. Live click-through in a real remote session is covered by the unit-level URL assertion; N/A beyond that.
Screenshots / video
All frames are reproducible from the committed harnesses:
node scripts/capture-remote-editor-settings.mjs(built SPA + shared stub) andnode scripts/run-capture-with-vite.mjs scripts/capture-remote-editor-menu.mjs 6812(isolated entry mounting the realMarkdownRenderer+FilePathMenuinside the realBrandingProvider, transport-stubbed as a remote session). Each harness asserts content and applied theme before shooting.Settings → Display → Remote editor card — off (default), configured, light parity:
"Open in ‹editor›" menu row on a remote session — file chip with VS Code, a DIRECTORY chip with Kiro (the row is deliberately not file-gated: a directory opens as a remote workspace), light parity:
Live click-through result: verified on a real deployment — from a macOS client,
code --remote ssh-remote+<cloud-desktop-fqdn> <path>(the exact command shape the menu row'svscode://vscode-remote/ssh-remote+<host><path>URL triggers) opened the remote gateway host's config file in local VS Code over the user's own SSH session and edits saved back to the remote host.Related Issues
Fixes #11338
Related: #9411 (remote path-chip actions fail silently)
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)i18n notes
The new
settings.display.remoteEditor.*keys are translated across all 11 locales. Thei18n:checkpassthrough report's pre-existinguntranslated-scriptcounts (ru 110, zh-CN 116) predate this PR and are untouched by it.