From 635d80c149a1858829396b1d5e354fb6cb26bb99 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Mon, 9 Nov 2026 16:10:17 +0100 Subject: [PATCH] fix(app): close a plugin picker when its trigger moves to the overflow The measuring slot keeps toolbar plugin items mounted, so a picker that was open when the toolbar condensed lost its trigger but kept its popup, which portals to the overlay root. Mark the slot's items inactive while they are out of the row, the contract retained panels already use to close their popups. --- .../e2e/browser/plugin-composer-items.spec.ts | 12 +++ .../support/helpers/plugin-composer-items.ts | 77 ++++++++++++++++--- .../agent-controls/plugin-toolbar-slot.tsx | 7 +- 3 files changed, 83 insertions(+), 13 deletions(-) diff --git a/packages/app/e2e/browser/plugin-composer-items.spec.ts b/packages/app/e2e/browser/plugin-composer-items.spec.ts index 6cbb6d0244..2c669105ae 100644 --- a/packages/app/e2e/browser/plugin-composer-items.spec.ts +++ b/packages/app/e2e/browser/plugin-composer-items.spec.ts @@ -3,6 +3,7 @@ import { expectToolbarNeverCondensedOrClipped, recordToolbarFramesFromLoad, withComposerControlsExample, + withPickerComposerItem, withToggleAndWatcherComposerItems, } from "../support/helpers/plugin-composer-items"; @@ -43,6 +44,17 @@ test("a toolbar without room moves a plugin toggle to the overflow sheet and bac }); }); +test("an open plugin picker closes when its trigger moves to the overflow", async ({ page }) => { + test.setTimeout(120_000); + await withPickerComposerItem(page, async (composer) => { + await composer.setWindowWidth(1000); + await composer.openInlinePicker(); + await composer.setWindowWidth(880); + await composer.expectToolbarWidthBetween(300, 395); + await composer.expectPickerClosed(); + }); +}); + test("the toolbar settles on one density without flipping as the window widens", async ({ page, }) => { diff --git a/packages/app/e2e/support/helpers/plugin-composer-items.ts b/packages/app/e2e/support/helpers/plugin-composer-items.ts index f262c3a91b..678c9544da 100644 --- a/packages/app/e2e/support/helpers/plugin-composer-items.ts +++ b/packages/app/e2e/support/helpers/plugin-composer-items.ts @@ -90,6 +90,33 @@ export default function contribute(client) { return () => {}; }`; +const PICKER_NAME = "Review state"; +const PICKER_PLUGIN_SOURCE = `import { Select } from "@getpaseo/plugin/client/ui"; +import { useState } from "react"; + +const OPTIONS = [ + { value: "draft", label: "Draft" }, + { value: "ready", label: "Ready" }, +]; + +function ReviewState() { + const [value, setValue] = useState("draft"); + return ( +