Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(work-panel): integrate native tab menu PR

vastsa7ab8b2c8a85d
diff --cc docs/spec/04-ux/08-component-spec.md
index 2699f7ff4,9900a1f36..4951cd640
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@@ -1243,7 -1242,7 +1243,7 @@@ entirely inside the plugin's isolated p
| Open with no resource | `Cmd/Ctrl + J` reveals the panel without creating a tab, so the body renders the New launcher. Clicking `+` creates an explicit, closable New tab with the same launcher rows. Activating a row from that tab replaces it with or selects the singleton view. Closing the final tab leaves the panel open in the no-resource state. |
| Constrained work area | The panel is capped by the shared three-column budget inside the existing client area; MainChat never drops below its 450px floor and the expanded sidebar yields at the threshold |
| New launcher active | The body hosts concise Review and plugin-view buttons. Each row replaces the launcher tab with its destination or activates the existing singleton; the page is independently closeable. |
- | Plugin view active | The body hosts the plugin's own isolated page as a native `WebContentsView`, positioned from the measured surface rect. It remains visible at its full rect while the divider is being resized or a New launcher tab is created; creating a page never pushes the plugin body down or changes its bounds. Embedded plugin documents start with zero root/body margin and border and a transparent background, so the host panel and plugin theme own the visible surface edge. It is hidden whenever the tab is inactive, the panel is animating, or a panel-wide blocking overlay is open. When the active plugin tab's context menu opens, Main shows a native popup above the `WebContentsView`, keeping the page visible at unchanged bounds. A full main-frame navigation of the host renderer, including reload, detaches the visible native view without closing its cached page; opening the tab again reattaches the same page. Same-document and child-frame navigations keep it attached. A view whose plugin is disabled, uninstalled, reloaded, or crashed is destroyed; the tab stays and re-opens the page on the next lifecycle event (ADR 0104) |
-| Plugin view active | The body hosts the plugin's own isolated page as a native `WebContentsView`, positioned from the measured surface rect. It remains visible at its full rect while the divider is being resized or a New launcher tab is created; creating a page never pushes the plugin body down or changes its bounds. Embedded plugin documents start with zero root/body margin and border and a transparent background, so the host panel and plugin theme own the visible surface edge. It is hidden whenever the tab is inactive, the panel is animating, or a panel-wide blocking overlay is open. When the active plugin tab's context menu opens, Main shows a native popup above the `WebContentsView`, keeping the page visible at unchanged bounds. A view whose plugin is disabled, uninstalled, reloaded, or crashed is destroyed; the tab stays and re-opens the page on the next lifecycle event (ADR 0104) |
++| Plugin view active | The body hosts the plugin's own isolated page as a native `WebContentsView`, positioned from the measured surface rect. It remains visible at its full rect while the divider is being resized or a New launcher tab is created; creating a page never pushes the plugin body down or changes its bounds. Embedded plugin documents start with zero root/body margin and border and a transparent background, so the host panel and plugin theme own the visible surface edge. It is hidden whenever the tab is inactive, the panel is animating, or a panel-wide blocking overlay is open. While any plugin view is active, a tab context menu uses a native popup above the `WebContentsView`; this platform styling is required by native-view z-order, while labels, ordering, and enabled actions match the renderer menu. The menu anchor follows the pointer at the current app zoom. A full main-frame navigation of the host renderer, including reload, detaches the visible native view without closing its cached page; opening the tab again reattaches the same page. Same-document and child-frame navigations keep it attached. A view whose plugin is disabled, uninstalled, reloaded, or crashed is destroyed; the tab stays and re-opens the page on the next lifecycle event (ADR 0104) |
| Plugin out of scope | A view contributed by a plugin that is not active in the current project disappears from the New launcher when the project changes. Unlike contributed themes, which are one global setting and stay unfiltered, a view is scoped work |
### 5.4 Interactions
diff --cc docs/spec/06-delivery/04-e2e-test-plan.md
index 0fda0bb47,77655d7af..44eb3cc12
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@@ -4810,8 -4793,8 +4810,11 @@@ window; opening a normal panel afterwar
launcher tab. Confirm its body lists Review and each in-scope plugin view
exactly once. Open Browser and confirm its native surface opens at unchanged
bounds. Open its context menu and verify the native popup appears above Browser
-- chrome while the page remains visible. Escape closes it without hiding the page
-- or changing bounds. 5) Close active middle/edge tabs, verify neighbor selection,
++ chrome while the page remains visible. With Browser active, right-click another
++ tab and confirm it still uses the native menu. Repeat at 50% and 150% app zoom;
++ the menu must remain anchored to the pointer. Escape closes it without hiding
++ the page or changing bounds. Close the window while a native menu is open and
++ confirm the pending request settles. 5) Close active middle/edge tabs, verify neighbor selection,
then close the final tab and confirm New remains. 6) Collapse/reopen the panel
and trigger an artifact. In session A, leave Browser open; switch to B and
create another tab set, then switch repeatedly between sessions and select a
@@@ -4859,7 -4838,7 +4862,11 @@@
retains and activates its target and is disabled for one tab; Close All Tabs
closes Browser resources and leaves the panel open on New. For an active
Browser/plugin view, the tab context menu is a Main-owned native popup above
-- Browser chrome; the page stays visible and its bounds do not change.
++ Browser chrome; the page stays visible and its bounds do not change. When
++ Browser is active, right-clicking another tab also selects this native path.
++ Native menu labels, order, and enabled states match the renderer menu, while
++ platform styling preserves the native-view z-order. Its position follows the
++ pointer at the current app zoom, and closing the window settles the request.
New launcher tabs expose Review and plugin views as body buttons, with no
overlapping popup. Dragging a tab shows a before/after insertion indicator;
edge-holding scrolls toward hidden tabs, and reordering leaves the active
@@@ -4900,8 -4876,7 +4907,9 @@@
- **Status**: Unit-covered (`work-panel-resize.test.mjs`,
`work-panel-window.test.mjs`, `work-panel-presentation.test.mjs`,
`work-panel-tabs.test.mjs`, `browser-tab-restore.test.mjs`,
- `work-panel.test.mjs`, `plugin-work-panel-views.test.mjs`); isolated Electron
+ `work-panel.test.mjs`, `plugin-work-panel-views.test.mjs`,
- `plugin-view-navigation.test.mjs`); isolated Electron
++ `plugin-view-navigation.test.mjs`, `work-panel-tab-menu.test.mjs`);
++ isolated Electron
tab-menu, Browser native-menu page visibility, and close geometry in
`scripts/e2e-work-panel-tab-close.mjs`; full UI scenario Draft