Skip to content

fix(desktop): hide docked native views under the extension prompt - #1380

Merged
vastsa merged 1 commit into
mainfrom
fix/extension-prompt-blocking-overlay
Oct 4, 2026
Merged

vastsa merged 1 commit into
mainfrom
fix/extension-prompt-blocking-overlay

Conversation

@vastsa

@vastsa vastsa commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Same occlusion as #879 (fixed for the project dialogs in #1378), still present for the
prompt a trusted extension raises.

Symptom

With a docked native view in the work panel (work-panel browser, file manager, …),
ui.confirm / ui.select / ui.input prompts from a trusted extension rendered
under the WebContentsView: the modal and its backdrop were covered on the right
side and the panel kept taking input.

Root cause

ExtensionPromptDialog declared only useHostSafetySurface(), which makes the
renderer-side plugin layers step aside. It never registered useBlockingOverlay(),
the only mechanism that hides a native view (WorkPanel → PluginViewTab blocked →
pluginViewSetVisible(false)).

Change

  • Register useBlockingOverlay() in ExtensionPromptDialog. The dialog mounts only
    while a prompt is queued, so mounting is exactly the window that must block the
    panel — no wrapper split or prop needed.
  • Extend host-safety-layer.test.mjs with a source assertion for the registration.
  • Extend the mounted dialog fixture (dialog-overflow) to assert the native preview is
    suppressed while the prompt is up and released after it closes.

Why only this dialog

I audited every other surface that renders role="dialog" / aria-modal without the
hook:

  • Settings/plugins/scheduled dialogs (ProviderSetupDialog, VendorAccountDialog,
    OAuthLoginDialog, SkillEditorSheet, SubagentEditorSheet, McpEditorSheet,
    McpMarketPanel, SkillMarketPanel, prompt-enhancement-card, ReleaseNotesDialog):
    those pages hide the work panel (useAppShellRuntime → pageHidesWorkPanel), so the
    dock and its native view are unmounted before the modal opens.
  • SearchDialog: already equivalent — AppShell passes panelBlocked={searchOpen} to
    WorkPanel, which hides the same native view.
  • NotificationCenter, SessionHoverCard, ContextUsageInspector, ScopeControl,
    ScheduledWeekdaySelect, LiveVoiceControls, LiveVoiceDetails: anchored popovers
    that do not overlay the dock (ContextUsageInspector even clamps to .main-pane).
  • StartupRecovery: only up before the shell mounts.

Verification

  • node --test test/*.test.mjs: 3488 pass, 0 fail.
  • node scripts/test-dialog-overflow.mjs (real Electron + Chromium, mounted production
    dialogs): 41/41 pass, including the two new checks.
  • Negative control: commenting out the registration makes
    extension prompt suppresses native preview while open fail (40/41), so the new
    check really guards the fix.
  • tsc -p apps/desktop/tsconfig.json --noEmit: clean.

The prompt a trusted extension raises (`ui.confirm` / `ui.select` / `ui.input`)
is a centered modal over the whole shell, but it only stepped the plugin layers
aside (`useHostSafetySurface`). A docked WebContentsView kept compositing above
it, which is the same occlusion #879 reported for the project dialogs and #1378
fixed there. Register `useBlockingOverlay` while the prompt is mounted: the
dialog is mounted exactly while a prompt is queued, so that window is the one
that must block the panel.

The mounted dialog fixture now asserts the native preview is suppressed while
the prompt is up and released once it closes; without the registration the new
suppression check fails.
Copilot AI balanced review requested due to automatic review settings October 4, 2026 05:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vastsa
vastsa merged commit abc4e40 into main Oct 4, 2026
4 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 143113bd Deployed Oct 4, 2026 by vercel[bot]
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.

2 participants