Skip to content

feat(dashboard): open a side-panel file in the attached Kiro window - #33953

Closed
jcjaskula-aws wants to merge 1 commit into
kirodotdev:mainfrom
jcjaskula-aws:feat/open-in-attached-window-main
Closed

jcjaskula-aws wants to merge 1 commit into
kirodotdev:mainfrom
jcjaskula-aws:feat/open-in-attached-window-main

Conversation

@jcjaskula-aws

@jcjaskula-aws jcjaskula-aws commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: When a Kiro window is already attached to the gateway host over Remote-SSH, a file shown in the side panel opens in that window with one click and no setting.

The Markdown panel's ⋯ menu offers "Open in VS Code" for a gateway on another machine, but only once Settings → Display → Remote editor names an editor and an SSH host. A user who already has a Kiro window connected to the gateway host over Remote-SSH, the usual way to work on a cloud dev box, has to configure a host alias that must also exist on every machine they browse from, and the file then opens in a second remote window instead of the one they are working in.

Why it matters

The attached window is already connected to the right host with the right SSH authority, so asking the user to describe that connection again is a setup step with nothing to gain. Opening the file in the window they are working in keeps one editor session instead of two.

Not a goal

  • Path chips and the file viewer's ⋯ menu. Like the remote editor link, the row is offered in the side panel only, where the panel shows the gateway's copy of the file; a transcript chip may name a file in a session environment on another machine.
  • Editors other than Kiro. The command is fixed: no setting chooses what the gateway runs.
  • Changing the remote editor link itself, which stays the row whenever no window is attached; how it opens a file or a folder, and which editors it offers, is Remote editor link opens the file's path as a folder, and Kiro is not offered #38284.

What changed (motivation → approach → change)

A Kiro window attached over Remote-SSH leaves a remote CLI on the gateway host that talks to the window over an IPC socket. The gateway can run that CLI, so the open needs no setting and always uses the SSH connection already in place. That beats extending the link: a link opens a new window and needs a host alias the gateway cannot know.

Piece Behaviour
Probe Branding reports editor_available: whether a live socket accepts a connect() (external_editor.py, run in a worker thread).
Open /api/reveal takes action: "editor" and runs the window's remote CLI. It is not behind the direct-local gate, since the window is on the caller's desk.
Path ~ expands against home and a relative path joins the project directory before the CLI sees it, and the sensitive-path check runs again on that resolved path: .ssh/id_rsa passes as written and names a key once anchored. No project directory for a relative path is a 400 path_unresolved. No window is a 503, a failed CLI a 502.
Menu The Markdown panel's ⋯ menu shows "Open in Kiro" while a window is attached, in place of the link (MarkdownPanelHeader.tsx). A failure reports through the panel's existing error notice.

useBranding.tsx carries editorAvailable, and the API client types (api/client/themes.ts, api/client/files.ts) gain the field and the action. The reveal handler's two helpers live in file_api/desktop.py and are bound in the handlers/files.py facade, which owner code runs on. The spec's Reveal and new Attached editor window paragraphs and the feature map describe the action and the row. No new translation keys: the row reuses open_in_remote_editor with "Kiro".

Backwards compatibility

Compatible: every request /api/reveal accepts today behaves as before, and the branding field is new and optional.

Reader: website/src/components/MarkdownPanelHeader.tsx:OverflowMenu -- chat -- the "Open in VS Code" link is hidden only while editor_available is true and renders unchanged otherwise | MarkdownPanel.remoteEditor.test.tsx "replaces the configured link while a window is attached" and the existing "Open in VS Code" tests

Tests

  • test_external_editor.py: socket probe, CLI discovery, resolve_target for absolute, ~, relative, unknown-user and stale-project-dir paths, and the fixed argv.
  • test_reveal_path.py: action=editor opens and audits, serves a tunnelled caller, refuses sensitive and traversal paths before any spawn, maps no window to 503 and a CLI failure to 502, anchors a relative path, refuses one with no project directory, and screens the resolved path.
  • test_dashboard_branding.py: editor_available reaches the payload.
  • MarkdownPanel.remoteEditor.test.tsx: the row posts action=editor, replaces the link while attached, needs no setting, reports a failure through onError, and is absent from the path chip menu.

Locally: those four Python files plus the facade-mirror guards, 150 passed; 195 frontend suites that use branding or reveal, all passed; tsc, eslint, mypy, flake8 and isort clean.

Manual verification

Earlier revisions of this change were run end to end on a headless Linux gateway reached through ssh -L, with a Kiro window attached over Remote-SSH: the file opened in that window. This revision moves the row to the side panel menu and has not been clicked through yet.

Screenshots / video

The side panel ⋯ menu with a Kiro window attached ("Open in Kiro") and without one ("Open in VS Code"): to be added in the description.

Related Issues

Closes #38285

Part of #11338

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@jcjaskula-aws
jcjaskula-aws requested review from a team and KiroCrewCaptain as code owners November 9, 2026 15:59
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 9, 2026
@jcjaskula-aws
jcjaskula-aws force-pushed the feat/open-in-attached-window-main branch from 809c694 to a923b92 Compare November 10, 2026 02:26
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 10, 2026
@jcjaskula-aws
jcjaskula-aws force-pushed the feat/open-in-attached-window-main branch from a923b92 to e7380bd Compare November 12, 2026 02:20
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 16, 2026
The Markdown panel's "Open in <editor>" link needs
`dashboard.remote_editor.editor` and `.host` set, even when a Kiro window
is already attached to the gateway host over Remote-SSH. The gateway can
open the file through that window's remote CLI (its IPC socket on the
host) instead: no setting, and the SSH authority is always the one
already in use.

* Branding reports `editor_available`, from a connect() probe of the live
  sockets run in a worker thread.
* `/api/reveal` action=editor runs the CLI. It does not sit behind the
  direct-local gate, since the window it drives is on the caller's desk.
* The path is anchored first (`~` against home, a relative path against
  the project directory, an unanchorable one a coded 400) and the
  sensitive-path screen runs again on the resolved form: `.ssh/id_rsa`
  passes as written and names a key once anchored. The CLI would
  otherwise resolve a relative path against the gateway's working
  directory.
* The Markdown panel's ⋯ menu offers "Open in Kiro" while a window is
  attached, in place of the configured link, which stays the fallback
  when none is. Like the link, it is offered in that menu only, not in
  path chips, whose path may name a file in a session environment.

The editor command is fixed, so no config write can choose what the
gateway runs. No new translation keys.
@jcjaskula-aws
jcjaskula-aws force-pushed the feat/open-in-attached-window-main branch from e7380bd to ab0d16e Compare November 17, 2026 03:21
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 17, 2026
@jcjaskula-aws

Copy link
Copy Markdown
Contributor Author

Closing: opening a side-panel file in the attached Kiro window will live in an installable app for now rather than in core. The link fix and the Kiro editor option continue in #38292.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 17, 2026
@jcjaskula-aws
jcjaskula-aws deleted the feat/open-in-attached-window-main branch November 20, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open a side-panel file in the Kiro window already attached over Remote-SSH

1 participant