opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(desktop): open external links in system browser instead of webview

Open turculaurentiu91 opened this issue 1 week ago • 1 comments

Summary

  • External links in markdown content (AI responses) now open in the system's default browser instead of inside the Tauri webview

Problem

When clicking links in AI-generated markdown output in the desktop app, such as GitHub PR links, they were opening inside the Tauri webview rather than in the system's default browser. This happened because target="_blank" links bypass Tauri's on_navigation handler.

Solution

  • Changed the markdown link renderer to use class="external-link"
  • Added a global click listener in the desktop entry point that intercepts clicks on .external-link anchors and opens them via platform.openLink() (which uses Tauri's shell plugin)

This keeps the fix isolated to the desktop package while reusing the existing openLink platform API.

turculaurentiu91 avatar Jan 08 '26 18:01 turculaurentiu91