Skip to content

Plugin backdrop contract: let plugins show a background through bb's panes without targeting private DOM #4167

Description

@brsbl

The workflow

I'm building a plugin (Ambient, brsbl/bb-plugins#150) that draws a live WebGL scene behind bb's whole UI and lets it show through the app's surfaces, like a wallpaper that reacts to running agents. The drawing part works: experimental_appOverlay mounts the canvas behind everything (app-contract.ts#L1981).

Making it show through is the problem. No API says which bb surfaces are base panes that may be translucent, and which are occluders that must stay opaque because they sit over other content. The only option is to override theme tokens and target bb's private DOM from plugin CSS.

What happens today

The plugin injects a stylesheet that mixes --background and --sidebar toward transparent under #root. Everything else is found by trial and error against internal markup, and each fix below broke something before it worked:

  1. Stacked tint. The sidebar nests several bg-sidebar layers, so a 78%-opaque token compounds to about 99% over the thread list. Fix: nested .bg-sidebar .bg-sidebar goes transparent.
  2. Sticky covers. The sticky stack and tiers paint var(--sidebar) shields in ::before/::after (theme.css#L189-L230), which show up as tinted strips. Fix: target [data-sidebar-sticky-stack] / [data-sidebar-sticky-tier] with a backdrop blur.
  3. Occluders turned see-through. Sticky headers inside panes, such as the file preview header (FilePreview.tsx#L619), and the page header's bg-surface-scrim (AppPageHeader.tsx#L30) exist to hide content scrolling beneath them. Translucent tokens make that content readable through them. Fix: special-case .sticky and header.bg-surface-scrim.
  4. Mobile shelf bleed. On compact viewports the inset (data-sidebar="inset", sidebar.tsx#L1581-L1582) slides over the drawer, which stays mounted underneath (data-vaul-drawer-direction, sidebar.tsx#L952). A translucent inset therefore shows the thread list through every thread. Fix: hide [data-sidebar="panel"][data-vaul-drawer-direction][data-state="closed"]:not([data-vaul-animate]).
  5. Portaled panes. The compact right panel is portaled outside #root (CompactSecondaryPanelShelf.tsx#L171), so it needs its own selector ([data-testid="secondary-panel-shelf"]).

Every one of those selectors is private: data attributes, Tailwind class names, a data-testid. Any sidebar, shelf, or thread-list refactor (the thread list is now a forkable bundled plugin) silently brings these bugs back. No build or test catches it.

What you would expect

A host-owned backdrop contract, so plugins state intent and bb decides which surfaces participate. For example:

  • A backdrop mode: an SDK call (sketch: app.experimental_backdrop({ showThrough: 0.3 }), or an option on experimental_appOverlay) that turns on a "backdrop mode" bb owns.
  • What bb does in that mode:
    • Base panes (sidebar panel, inset, right panel, including the portaled compact shelf) render their fill at the requested opacity, exactly once, with no compounding.
    • Occluders (sticky headers, sticky sidebar tiers, header scrims, anything drawn over scrolling content) keep hiding what's beneath them, whether through a frosted blur or an opaque fill.
    • Overlapping pane layouts, such as the compact shelf over a mounted drawer, never let one pane show through another.
  • Surface roles in bb's own code: for example data-bb-surface="pane" | "occluder", so new surfaces opt in once, and the contract survives refactors and forked thread lists.

Theme authors would benefit too: #2037 asks for window-level translucency, which runs into the same "which layers may be see-through" question one level up.

Context and alternatives

  • Workaround: the plugin's veil CSS in brsbl/bb-plugins#150 (plugins/ambient/app.tsx, veilCss). It works on bb 0.43.4 on desktop and mobile, but it's pinned to today's markup.

  • Ruled out:

    • A theme-only fix: themes can't tell a pane from an occluder any better than plugins can.
    • Blurring every translucent surface: that costs a blur pass per sticky row per frame over an animated backdrop.
    • Keeping the mobile inset opaque: it hides the backdrop behind every thread on phones.
  • Not a duplicate of Theme-driven native window translucency (macOS vibrancy; complement #1916) #2037: that issue is about native window translucency, where the OS desktop shows behind the Electron window. This one is about in-page plugin backdrops on web, desktop, and mobile.

  • Tested against: bb 0.43.4 (a production build and nightly) and main @ 740311169d, in Chrome for Testing through the Browser Automation plugin, at desktop 1280×800 and mobile 393×852.

  • Origin: bb thread thr_7awwywsg2c.

  • I searched open and closed issues for the same request.

  • If an agent wrote this, the body ends with > AGENT GENERATED.

AGENT GENERATED

Activity

  1. added
    plugins
    on Sep 23, 2026
  2. added
    ui
    on Sep 23, 2026
  3. bb-slop-cop commented on Sep 23, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied Type: Feature, Priority: Medium, Effort: High. Added ui; preserved plugins.

    This requests a new host-owned backdrop API and surface contract. A workaround exists, but implementation requires API and cross-layout design. Final Type verified as Feature; bug reproduction and fix steps skipped. No pull request opened because this requires product and architecture decisions.

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

    pluginsui

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions