Skip to content

Cmd+click on a thread link should open the macOS default browser instead of the in-app browser #2288

Closed

Description

@dhiyaancnirmal

Summary

On macOS desktop, holding Cmd (or Cmd+Shift) while clicking an http(s) link in a thread opens bb's built-in browser, identical to a plain click. macOS convention is that modifier-clicks hand the URL to the OS default browser; plain click can keep the in-app browser.

Versions and environment

  • Surface: markdown links rendered inside thread messages
  • Client: bb 0.39.0 desktop on macOS 26.5.1
  • Setting state: Settings → General → "Open links in the in-app browser" ON (default)

Steps to reproduce

  1. Run bb 0.39.0 desktop on macOS with the default link setting ("Open links in the in-app browser" ON).
  2. Open any thread whose messages contain an http(s) link.
  3. Hold Cmd and click the link.

Expected vs actual

Expected: Cmd+click (and Cmd+Shift+click) opens the link in the macOS default browser via shell.openExternal; plain click keeps following the in-app-browser preference.

Actual: Cmd+click opens the link in bb's built-in browser exactly like a plain click.

Evidence from source

  • handleAnchorClick in apps/app/src/components/ui/markdown-preview.tsx (the thread MarkdownLink) routes every non-route web link through linkRouting.onOpenLink(...) and calls event.preventDefault() without inspecting event.metaKey / event.ctrlKey / event.shiftKey / event.altKey, so modified clicks cannot fall through to platform-default handling.
  • By contrast, useUrlAnchorClickHandler in apps/app/src/lib/url-open-routing.tsx deliberately ignores clicks carrying alt/ctrl/meta/shift (returns without preventDefault), so surfaces using that hook already let modified clicks reach Electron's window-open path. The two paths disagree today.
  • The external-open plumbing already exists and is reachable: openUrlInExternalBrowser(url) in url-open-routing.tsx dispatches to desktopInfo.openExternalUrl.

Suggested shape: in handleAnchorClick, treat meta/ctrl (+optional shift) clicks on http(s) hrefs as external-browser intents before consulting linkRouting.onOpenLink.

Interim workaround

Turn OFF "Open links in the in-app browser" in Settings → General — but this is all-or-nothing (every http(s) link goes external), losing the Cmd+click distinction requested here.

Activity

  1. added theissue type on Aug 23, 2026
  2. added
    desktop
    on Aug 23, 2026
  3. SawyerHood commented on Aug 24, 2026

    @SawyerHood
    Collaborator

    ---Auto-Generated---

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/2288.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): MarkdownAnchor.handleAnchorClick in apps/app/src/components/ui/markdown-preview.tsx routes every http(s) link through linkRouting.onOpenLink (in-app browser) and calls preventDefault() without checking metaKey/ctrlKey/shiftKey/altKey, unlike useUrlAnchorClickHandler, RouteAnchor and PluginUrlLink which all bail on modified clicks, so Cmd+click never falls through to the anchor's target=_blank default that Electron's setWindowOpenHandler would hand to shell.openExternal.
    • Proposed fix: In MarkdownAnchor.handleAnchorClick (apps/app/src/components/ui/markdown-preview.tsx), after the local-file and app-route branches and before consulting linkRouting.onOpenLink, return early when event.defaultPrevented || event.button !== 0 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey. Falling through is sufficient: the anchor has target="_blank", so on desktop the main window's setWindowOpenHandler already calls shell.openExternal and denies the popup, and on web the browser opens its own tab. Verified: the repro test goes 3 failed -> 5 passed, typecheck clean, and live …
    • Caveats: Live repro drove the Electron dev shell via CDP Input.dispatchMouseEvent with the Meta modifier bit rather than a physical trackpad Cmd+click; the in-app browser opening was observed via the CDP target list plus DOM probe and screenshots (the browser WebContentsView body is blank in host-page screenshots). After the fixed Cmd+click I could not directly confirm the OS browser received the URL: Safa…

    The report is self-contained: copy-paste repro steps with the test or script inline, expected vs actual output, screenshots where the bug is visual, and code permalinks at the base commit. It was independently re-executed by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Code

  4. added
    confirmed-repro
    on Aug 24, 2026
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

    confirmed-reprodesktop

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions