Repository navigation
Description
The workflow
A plugin app renders its own side pane for a thread (a "pane inside the plugin view"). With the pane open, the operator presses Cmd-W / Ctrl-W — the same gesture bb's menu binds to "Close Window or Side Tab" — expecting the innermost focused surface to close, falling back outward (pane → plugin tab → window).
What happens today — observed
With bb desktop 0.44.0 (macOS), a plugin app view open, the plugin's inner thread pane open, and the caret in the pane's composer: pressing Cmd-W closed the entire bb desktop window. The plugin never got a chance to claim the chord.
Why, from the code at 0baa605b32a00619c1d7e3f32be6553ebcf8244a (= tag desktop-v0.44.0): panel.close is registered in the application menu with CommandOrControl+W (desktop-menu-shortcuts.ts L16–18, resolved from user keybindings at L92); its click path goes to requestRendererWindowClose (main.ts L696, wired at L917, which asks the renderer and force-closes the window if nobody claims it. Built-in hosts claim it via useAppCommandHandler("panel.close", …) / desktopInfo.onCloseWindowRequest (RootComposePanelCommandHandlers.tsx L21–29, exposed by preload.ts L437/L497) — but the plugin SDK does not: packages/plugin-sdk/src/app-contract.ts at the same commit exposes neither onCloseWindowRequest nor a panel.close registration. So a plugin page with an open inner surface leaves the close-request unclaimed, and the window closes. A DOM-level Cmd-W listener in the plugin is not a workaround: the menu accelerator consumes the key before the page sees it (also confirmed by the window closing while the plugin's listener was armed).
Steps to reproduce
- bb desktop 0.44.0, macOS.
- Open a plugin app view that renders its own inner side pane (e.g. focus-board's thread pane).
- Open the inner pane.
- Focus the pane (caret in its composer).
- Press Cmd-W.
- Actual: the whole bb window closes. Expected: the inner pane closes.
What we would expect
Plugins join the close arbitration the built-in hosts have: expose onCloseWindowRequest (or a panel.close handler registration) to plugin frontends through the SDK, so a plugin's focused inner surface can claim the chord via the existing close-request/response handshake, falling through to the plugin tab or window when it reports unhandled.
Context and alternatives
Affects every plugin that renders its own closeable sub-surface inside a plugin view: today one accidental Cmd-W discards the entire session window (all panes, all surfaces), not just the focused surface. No SDK workaround exists. Partial mitigation (DOM keydown listener) is inert in the desktop shell for the reason above. Related, different root cause: #3184 (embedded-browser focus). Not a duplicate: searched open+closed issues for plugin Cmd-W, panel.close from plugins, onCloseWindowRequest. Suggested priority: medium (one chord throws away the whole window's state; hit on every plugin with an inner pane); effort: SDK surface + preload plumbing.
Evidence trail / discussion thread: bb thread thr_iiikw3hdpb.
AGENT GENERATED
Activity
bb-slop-cop commentedon Oct 1, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotplugins,desktop,partial-repro.handled: falsewith the plugin callback untouched; the built-in listener control passes. Eight existing focused desktop tests also pass.