desktop(v2): "Open in" button in side panel header opens workspace root directory instead of the active file tab · Issue #55858 · anomalyco/opencode · GitHub
Skip to content

desktop(v2): "Open in" button in side panel header opens workspace root directory instead of the active file tab #55858

Open

Description

@gh-ppathi

Description

When viewing an open file tab in the right side panel in OpenCode Desktop v2 and clicking the Open in split button (e.g. Open in Zed / VS Code / Cursor) in the side-panel tab strip header, OpenCode only focuses/opens the workspace root directory in the target editor instead of opening the file currently viewed in the active tab.

For example, with Zed selected as the target app on macOS:

  • Clicking the Open in Zed button in the side-panel header while viewing a file tab switches focus to Zed (opening or focusing the workspace root folder) without opening the file shown in the tab.
  • If the file tab was opened from a link to a file outside the workspace root (or if the workspace is already open in Zed), Zed simply comes to the foreground and the file is never opened.
  • Likewise, choosing Copy path from that same dropdown copies the workspace root directory rather than the active file tab's path.
  • Additionally, right-clicking a file in the right-hand file tree sidebar (#file-tree-panel / session.panel.sidebar) or right-clicking the file tab itself does nothing because neither is wrapped in OpenInAppContextMenuV2.

Root cause

  1. Header OpenInAppButton hardcodes props.screen.file.root:
    In packages/gui-extensions/src/file/renderer.tsx (lines 405–416), OpenInAppButton is mounted in the session.panel.end slot at the right end of the side-panel tab strip (right next to the open file tabs). However, in packages/gui-extensions/src/file/open-in-app.tsx (lines 189–193), OpenInAppButton hardcodes path to props.screen.file.root (the workspace root directory):

    export default function OpenInAppButton(props: { session: MountedSession; screen: SessionScreen }) {
      const ctx = useExtension()
      const directory = () => props.screen.file.root
      const state = useOpenInApp({ session: props.session, path: directory, request: useShared().request })

    It ignores the active file tab in the side panel (and the active file in ReviewPanel) and always passes props.screen.file.root to desktop.launch(target, openWith) (open -a Zed <workspace-root>).

  2. Missing context menu on the session.panel.sidebar file tree and file tabs:

    • packages/gui-extensions/src/file/sidebar.tsx (mounted at session.panel.sidebar in #file-tree-panel) renders <FileTree> from packages/gui-extensions/src/file/tree.tsx (lines 436–483), which does not wrap file nodes in OpenInAppContextMenuV2 (unlike FileTreeV2 in packages/gui-extensions/src/file/tree-v2.tsx line 312, which is only inside the collapsed inner sidebar of SessionFilePanelV2).
    • File tab triggers (PanelTrigger in packages/app/src/runtime/extension/panel-trigger.tsx) also have no context menu.

Expected behavior

  • When a file tab is active in the side panel (or a file is active in the review panel), clicking the Open in button (or Copy path) in the side-panel header should target the active file's resolved path (resolveOpenInAppPath(props.screen.file.root, activeFilePath)), falling back to props.screen.file.root only when no file tab is active.
  • Right-clicking files in FileSidebar (tree.tsx) and/or file tabs should also expose the OpenInAppContextMenuV2 menu.

Plugins

None

OpenCode version

2.0.28 (OpenCode Desktop v2)

Steps to reproduce

  1. Open a project/session in OpenCode Desktop v2 on macOS.
  2. Open any file in the right side panel (e.g. by clicking a file link in a chat message or opening a file from the file tree so it opens as a tab in the side panel).
  3. Select Zed (or another editor) in the Open in split button at the top-right of the side-panel tab strip and click the button.
  4. Observe that macOS switches focus to Zed (open -a Zed <workspace-root>), but the file currently open in the side-panel tab is not opened in Zed.
  5. Right-click the file tab or a file in the right-hand file tree sidebar (#file-tree-panel) — no context menu appears.

Screenshot and/or share link

No response

Operating System

macOS 26.6.2 (arm64)

Terminal

OpenCode Desktop App v2

Activity

  1. opencode-agent commented on Oct 15, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report! I couldn't run this end to end: it needs OpenCode Desktop on macOS with an external editor installed, and my sandbox can't provide that.

    The code does match what you describe. In both v2.0.28 and the latest dev (412b2b1), the side-panel header's OpenInAppButton (packages/gui-extensions/src/file/open-in-app.tsx) always passes the workspace root (screen.file.root) to the launcher and to Copy path. It never looks at the active file tab. The file tree and file list context menus use resolveOpenInAppPath for the selected file instead.

    A maintainer with a macOS Desktop setup will need to confirm this and decide whether the header button should follow the active tab. Until then, the file tree's context menu is a workaround for opening a specific file in your editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions