Skip to content

Open inline visualizations in the browser with a modifier click - #4634

Merged
ymichael merged 2 commits into
mainfrom
bb/open-artifacts-in-a-new-page-from-inline-viz-thr_kwye8warxx
Oct 1, 2026
Merged

ymichael merged 2 commits into
mainfrom
bb/open-artifacts-in-a-new-page-from-inline-viz-thr_kwye8warxx

Conversation

@ymichael

@ymichael ymichael commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Opening an inline visualization as its own page took two clicks. The card's open icon was a <button> that only opened the right panel, and "Open in external browser" (#1638) lives only in the panel's toolbar. The card had no way to reach the rendered page directly. Requested in Discord #feature-requests ("Would you be open to adding a link to open artifacts on new page from inline viz?").

What changed

  • plugins/inline-vis/app.tsx: on HTML previews the existing open icon is now a real link (<a href={rawFileUrl} target="_blank">) to the same raw-file URL the iframe and the panel's globe action already use.
    • A plain click (or Enter) is prevented and still opens the right panel, unchanged.
    • Cmd/Ctrl/Shift-click and middle-click fall through to the platform: a new tab on the web; in desktop bb the existing setWindowOpenHandler sends them to shell.openExternal, i.e. the default browser.
    • The tooltip names the gesture: "Open in sidebar / ⌘-click to open in the browser" ("Ctrl-click" off macOS).
  • Markdown previews keep the sidebar-only button, matching the panel, which has no external action for Markdown.
  • No new chrome on the card, no SDK, server, or wire changes. Raw file responses already carry Content-Security-Policy: sandbox allow-scripts, so the opened page has an opaque origin.
  • README and PLUGIN_OVERVIEW describe the gesture.

Out of scope, same gap: file links in messages (Cmd-click still opens the panel; the href is file://), ExperimentalFileLink (its href is ./<path>, so Cmd-click opens a meaningless page), and file mention pills and attachment chips (buttons, no href). See #2288 for the web-link variant.

How you verified

  • pnpm exec turbo run typecheck test lint --filter=bb-plugin-inline-vis --filter=@bb/bundled-plugins: pass. The one lint warning was already there.
    • New test: Cmd/Ctrl/Shift clicks are not prevented and do not open the panel; a plain click is prevented and calls experimental_openFilePreview.
  • pnpm start:worktree on a fresh store, with a real agent turn emitting ::inline-vis{file="report.html"} and a Markdown directive, driven by real mouse and touch input in Chromium:
    • Plain click opened the right panel; no tab, and the app URL was unchanged.
    • Cmd-click and middle-click each opened /api/v1/environments/<id>/files/report.html as a rendered page in a new tab, without opening the panel.
    • Keyboard focus and Enter open the panel.
    • At 390px with touch, a tap opens the full-screen panel.
  • Desktop, using a minimal harness on the repo's Electron 44.3.0 with the same window-open handler as desktop-window-factory.ts (not the packaged app):
    • Plain click stays in-page.
    • Cmd-click and middle-click reach the handler with the absolute URL (disposition: background-tab), which the real app passes to shell.openExternal.
    • Ctrl-click on macOS is a secondary click, as expected.
  • Not run: native iOS long-press, Windows/Linux Ctrl-click.

AGENT GENERATED

🤖 Generated with Claude Code

ymichael and others added 2 commits October 1, 2026 09:45
The inline-vis open action on HTML previews is now a link to the rendered
page. A plain click still opens the sidebar preview; Cmd-click, Ctrl-click,
and middle-click fall through to the platform, which opens a new browser tab
on the web and the default browser in desktop bb. The tooltip names the
modifier. Markdown previews keep the sidebar-only button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit 4241262 into main Oct 1, 2026
20 checks passed
@ymichael
ymichael deleted the bb/open-artifacts-in-a-new-page-from-inline-viz-thr_kwye8warxx branch October 1, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant