Skip to content

feat: open HTML files in bb's rendered preview by default - #5426

Merged
SawyerHood merged 1 commit into
get-bb:mainfrom
MayankBansal12:fix/html-preview-default
Oct 13, 2026
Merged

SawyerHood merged 1 commit into
get-bb:mainfrom
MayankBansal12:fix/html-preview-default

Conversation

@MayankBansal12

@MayankBansal12 MayankBansal12 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Human comments

when i try to open an HTML link, it shows the HTML code, which is annoying sometimes...the PR fixes this to show the rendered preview by default, following the same pattern as for markdown files.

html-preview-bb.mp4

What was wrong

With File Editor enabled, HTML links opened in Monaco because it claimed .html and .htm. BB already has a sandboxed HTML viewer with Preview/Raw controls. The viewer also did not recognize .htm, and project file previews on the New thread screen did not supply an HTML content URL.

What changed

Leave .html and .htm to BB's built-in preview, following the existing Markdown exclusion. Recognize .htm case-insensitively and pass the existing project file content URL to the shared preview surface. Reuse the existing HTML iframe and Preview/Raw controls without introducing UI components or styling. Update the File Editor documentation.

As with Markdown, Monaco is no longer offered for .html and .htm in Settings → File openers or the Open with menus. Existing HTML-to-Monaco preferences fall back to BB's preview. HTML remains editable from Monaco's own file tree; the built-in Raw view is read-only.

This follows #5054 — Leave Markdown files to BB’s preview in the Monaco plugin: extend the same default-opener behavior to HTML while reusing the existing viewer.

Existing SDK and CLI file-opening paths continue through the shared opener routing; no new API, CLI flag, or daemon wire changes.

How you verified

Regression cases failed before the corresponding fixes and pass after:

  • Monaco's claimed extensions leave HTML/HTM to BB.
  • A .HTM document renders and switches through the existing Preview/Raw controls.
  • Project HTML uses the selected host's existing file content route.

Checks:

  • pnpm exec turbo run lint typecheck test --filter=bb-plugin-monaco-editor — 47 tests passed.
  • pnpm exec turbo run test --filter=@bb/app -- src/components/secondary-panel/FilePreview.test.tsx src/components/secondary-panel/ThreadSecondaryPanelTabContent.markdown-images.test.tsx — 40 tests passed.
  • pnpm exec turbo run lint typecheck --filter=@bb/app --filter=@bb/client-core — passed, app lint has existing warnings and no errors.
  • pnpm exec turbo run test --filter=@bb/client-core -- test/file-preview.test.ts — 13 tests passed.
  • git diff --check — passed.

Live Chromium verification in an isolated source app with File Editor enabled: opened HTML and HTM through the project file picker, clicked the page's JavaScript button, switched Raw → Preview and confirmed its counter state survived, checked Markdown still renders and TypeScript still opens Monaco, and reloaded the HTML preview. HTML responses retained Content-Security-Policy: sandbox allow-scripts. No native iOS run.

The TypeScript control emitted a Monaco disposal TypeError when switching away; no editor runtime code changed and that separate path was not investigated here.

Independent read-only reviews by GPT-6-Astra (xhigh) and Opus 5.5 (high) found no blocking defects. They inspected the source and existing verification evidence; they did not rerun the test suites or browser checks.

AGENT GENERATED

@MayankBansal12 MayankBansal12 changed the title Open HTML files in BB's rendered preview by default feat: open HTML files in bb's rendered preview by default Oct 13, 2026
@SawyerHood
SawyerHood merged commit aec9f30 into get-bb:main Oct 13, 2026
44 checks passed
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.

[Feature] Open HTML pages in preview like mardown

2 participants