Skip to content

Markdown file preview: external links do nothing on click — MarkdownPreview gets no linkRouting.onOpenLink, so the target="_blank" default is swallowed #3395

Closed

Description

@gneyaskin-ai

Summary

Clicking an external link in a .md file preview does nothing at all — no system browser, no in-app browser, no error. The same links in the same files open fine from VS Code, and links in thread messages open correctly in bb's in-app browser. Expected: the preview opens the link the same way a thread message does.

Versions and environment

  • bb 0.42.1 (bb updates reports up to date)
  • macOS 26.6.2 / Darwin 25.6.0, arm64
  • Node v26.5.0
  • Claude Code 2.1.267
  • Base commit: 40ed14c (main, 2026-09-10)

Steps to reproduce

  1. Create a file with an external link:
SH
printf '[github.com](https://github.com/)\n' > [test.md]
  1. Open test.md in the file preview in bb.
  2. Click the link.

Expected vs actual

Expected: the link opens (in the in-app browser, per the "Open links in the in-app browser" setting).

Actual: nothing happens. Right click → "Copy link address" yields the correct URL, so the anchor and its href are present in the DOM; only navigation is dropped.

Reproduces for every link form: inline [text](https://…), bare URLs, autolinks <https://…>, reference links, mailto:, and relative file paths.

Evidence

The anchor is built by MarkdownAnchor in markdown-preview.tsx#L645-L655 with target="_blank" and an handleAnchorClick handler.

For an external link, that handler calls preventDefault() only when linkRouting.onOpenLink is set. When it is not set, the handler silently falls through and the target="_blank" default remains — a window.open that nothing handles in the desktop shell.

In the preview chain, onOpenLink is never provided:

  • ThreadSecondaryPanel.tsx does not reference the markdownLinkRouting prop at all.
  • ThreadSecondaryPanelTabContent.tsx only builds image routing (buildMarkdownFileImageRouting, buildMarkdownLeaseImageRouting).
  • FilePreview.tsx passes linkRouting={markdownLinkRouting} straight through to MarkdownPreview.

For thread messages the routing is built by buildMarkdownMessageLinkRouting, which does set onOpenLink — which is why messages work and previews do not.

What you ruled out

Note on reproduction
I did not reproduce this myself — GUI clicks are outside what I can drive. The repro steps come from the reporting user; the code analysis above is my own. Not claiming confirmed-repro; a screenshot from the user would strengthen the Expected vs actual section.

AGENT GENERATED

Suggested priority and effort (optional)

Medium priority, small effort: populate onOpenLink in the preview's link routing with the same handler already used for messages. Label: ui.

Checks

  • I reproduced this on the latest release or on main, or I say above that I could not.
  • I searched open and closed issues for the same problem.
  • If an agent wrote this, the body ends with > AGENT GENERATED and links the thread or report.

Activity

  1. added theissue type on Sep 10, 2026
  2. added
    ui
    partial-repro
    on Sep 10, 2026
  3. bb-slop-cop commented on Sep 10, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Classification: Bug · Priority: Medium · Effort: Low · Labels: ui, partial-repro.

    Reproduction report: PARTIALLY REPRODUCED · confidence: medium.

    Compose file previews omit the panel link callback. Two clean checkouts confirm two failing click cases and one passing explicitly routed control; 26 existing tests pass. Thread-detail previews already provide routing, and desktop code forwards popup URLs to the system browser.

    No PR: the reported complete desktop navigation failure remains unverified; fixing the narrower compose omission would not establish that this issue is resolved.

    AGENT GENERATED

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

    partial-reproui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions