desktop(v2): "Open in" button in side panel header opens workspace root directory instead of the active file tab · Issue #55858 · anomalyco/opencode · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
desktop(v2): "Open in" button in side panel header opens workspace root directory instead of the active file tab #55858
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
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):
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>).
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
Open a project/session in OpenCode Desktop v2 on macOS.
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).
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.
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.
Right-click the file tab or a file in the right-hand file tree sidebar (#file-tree-panel) — no context menu appears.
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.
Activity
opencode-agent commentedon Oct 15, 2026
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'sOpenInAppButton(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 useresolveOpenInAppPathfor 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.