opencode
opencode copied to clipboard
fix(desktop): open external links in system browser instead of webview
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-linkanchors and opens them viaplatform.openLink()(which uses Tauri's shell plugin)
This keeps the fix isolated to the desktop package while reusing the existing openLink platform API.