Files
orca/src
d538549bb5 Fix markdown preview links routing to system browser instead of Orca (#5265)
* Fix markdown preview links opening in system browser instead of Orca

In the markdown preview, a plain (or Cmd/Ctrl) click on an http/https link
called window.api.shell.openUrl() directly, which always routes to
shell.openExternal (the OS default browser). It bypassed openHttpLink, so a
plain click could never open in the Orca built-in browser, regressing the
behavior from #987. The Cmd/Ctrl+Shift escape hatch was already correct.

Route both http click paths through openHttpLink via a new
resolveMarkdownPreviewHttpOpenOptions helper that centralizes the
cross-platform modifier decision (Cmd on Mac, Ctrl on Linux/Windows):
- plain / Cmd-click -> { worktreeId } -> Orca browser (per openLinksInApp),
  falling back to the system browser when the setting is off, no worktree is
  known, or a remote runtime is active.
- Cmd/Ctrl+Shift-click -> { forceSystemBrowser: true } -> system browser.

The remote/SSH case is handled inside openHttpLink (http stays on the client
system browser; file:// blocking is unchanged).

Adds a happy-dom interaction test that renders the real component and fires
real modifier clicks, plus full modifier-matrix coverage for the helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* review: share markdown preview link modifier logic

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-06-12 15:20:51 -07:00
..