Skip to content

Hide native browser tabs while plugin dialogs are open - #4444

Closed
ariofrio wants to merge 2 commits into
get-bb:mainfrom
ariofrio:ariofrio/hide-browser-tabs-for-plugin-dialogs
Closed

ariofrio wants to merge 2 commits into
get-bb:mainfrom
ariofrio:ariofrio/hide-browser-tabs-for-plugin-dialogs

Conversation

@ariofrio

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

A Browser tab's native view paints above all renderer DOM, so bb hides it while useIsBrowserDimmingModalOpen() is true. Only host overlays raise that counter: the app build swaps in the real useBrowserDimmingModal, but plugins vendor the registry's no-op flavor, so a plugin Dialog never hides the view and sits under the page. Reported in #3812; this implements the host-side observer VKirill proposed there on 2026-09-23.

What changed

useIsBrowserDimmingModalOpen in apps/app/src/hooks/useBrowserDimmingModal.ts now also reports true while an open plugin dialog portal ([data-bb-plugin-root][data-bb-portaled-overlay][role="dialog"][data-state="open"]) is in the document. One shared MutationObserver, read through useSyncExternalStore, tracks those portals, and notifies subscribers only for mutations that touch a plugin portal. The existing browser-view coordinator does the hiding and restoring. Already-shipped plugins benefit without a rebuild, and the host counter is unchanged. No wire, CLI, or SDK change.

Deviation from the proposal in #3812: this matches only plugin-rooted, portaled dialogs, not every role="dialog", menu, or listbox, and adds no data-bb-browser-dimming marker. That keeps host menus and any unrelated DOM from toggling the view. Plugin menus still overlap the page; an SDK hook would be the better route for those.

How you verified

A new plugin-dialog case in apps/app/src/components/ui/dialog.browser-dimming.test.tsx failed before the change and passes after. pnpm exec turbo run test --filter=@bb/app -- --run src/components/ui/dialog.browser-dimming.test.tsx, pnpm exec turbo run typecheck --filter=@bb/app, and oxfmt --check pass. Motivating plugin: Ribbon's dialogs, e.g. the action editor in ariofrio/ribbon#121.

Fixes #3812

Written by Claude and Codex

🤖 Generated with Claude Code

AGENT GENERATED

@github-actions

Copy link
Copy Markdown
Contributor

Thanks @ariofrio for the PR. This repo needs approval before a PR. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ) and explain what you want to open a PR for and why. A maintainer then adds you to the allow list. This PR now closes on its own. Reopen it or open a new one after approval.

@github-actions github-actions Bot closed this Sep 28, 2026
SawyerHood added a commit that referenced this pull request Sep 29, 2026
## Human comments

## What was wrong

`ariofrio` was absent from the contributor allowlist, so the PR gate
closed their PRs (#4440, #4444). Their earlier PR #2784 was merged.

## What changed

Added `ariofrio` to `.github/APPROVED_CONTRIBUTORS`, allowing the PR
gate to accept their PRs after merge.

## How you verified

Verified the canonical GitHub login, confirmed the diff adds only that
login exactly once case-insensitively, and ran `git diff --check`. CI
and SlopCop review are skipped for this data-only change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

Plugin overlays render under the native Browser tab view; plugins cannot use the browser-dimming hook

1 participant