Skip to content

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

fix(overlays): wait out the route entrance before measuring coverage

vastsa1780d6e46d55
diff --git a/apps/desktop/src/features/plugins/PluginDialogs.tsx b/apps/desktop/src/features/plugins/PluginDialogs.tsx
index 8851b10dc..efecd0b77 100644
--- a/apps/desktop/src/features/plugins/PluginDialogs.tsx
+++ b/apps/desktop/src/features/plugins/PluginDialogs.tsx
@@ -237,6 +237,7 @@ export function PluginDialogs({
<div className="plugins-modal-actions">
<Button
variant="secondary"
+ data-action="cancel"
disabled={creating}
onClick={() => setTemplatePick(null)}
>
diff --git a/apps/desktop/src/styles/plugins.css b/apps/desktop/src/styles/plugins.css
index 81e5a08f8..c68facdb2 100644
--- a/apps/desktop/src/styles/plugins.css
+++ b/apps/desktop/src/styles/plugins.css
@@ -1296,11 +1296,10 @@
app-region: no-drag;
}
-/* The route surface keeps a transform after its entry animation, so this
- fixed layer stacks inside it and the opaque titlebar band still paints over
- the top of the sheet. Reserve the band on every platform: on macOS it would
- otherwise clip the title row, and on Windows/Linux the conversation pane owns
- the band's top-right 120px — exactly where the close button lands. */
+/* The sheet keeps `--ds-toolbar-height` at the top on every platform: on
+ Windows/Linux the renderer-drawn window controls own that corner at
+ z-index 200 and stay above any overlay; on macOS the same reserve keeps
+ the title row out of the native traffic-light cluster. */
.plugins-sheet {
padding-top: var(--ds-toolbar-height);
}
diff --git a/apps/desktop/test/settings-dialog-overlay.test.mjs b/apps/desktop/test/settings-dialog-overlay.test.mjs
index 27c052235..4bba71b45 100644
--- a/apps/desktop/test/settings-dialog-overlay.test.mjs
+++ b/apps/desktop/test/settings-dialog-overlay.test.mjs
@@ -90,6 +90,6 @@ test("leaf popups and toasts keep painting above the route overlays", async () =
]) {
assert.ok(value <= 40, `${name} must sit on z-dialog (40), not ${value}`);
}
- assert.ok(selectMenu > veil && selectMenu > sheet);
- assert.ok(toast > veil && toast > sheet);
+ assert.ok(selectMenu > veil && selectMenu > sheet && selectMenu > notes);
+ assert.ok(toast > veil && toast > sheet && toast > notes);
});
diff --git a/scripts/e2e-three-column-layout.mjs b/scripts/e2e-three-column-layout.mjs
index 15e5bc60d..6b8546007 100644
--- a/scripts/e2e-three-column-layout.mjs
+++ b/scripts/e2e-three-column-layout.mjs
@@ -831,16 +831,35 @@ async function main() {
// leaves the modal's veil underneath it — that is what put the band over
// the install consent. The viewport-fixed work-panel toggle sits inside the
// band and used to paint over the veil too; it must not any more.
- const modalCoverage = await cdp.evaluate(`(async () => {
- document.querySelector(".plugins-header-menu")?.click?.();
- for (let i = 0; i < 20; i += 1) {
- if (document.querySelector('[role="menuitem"][data-action="newFromTemplate"]')) break;
- await new Promise((r) => setTimeout(r, 100));
- }
- document
- .querySelector('[role="menuitem"][data-action="newFromTemplate"]')
- ?.click?.();
- await new Promise((r) => setTimeout(r, 400));
+ // Measure after the entrance: opacity animation still creates a stacking
+ // context while it is in effect, even without a fill.
+ await waitFor(
+ () =>
+ cdp.evaluate(`(() => {
+ const surface = document.querySelector(".route-surface");
+ if (!surface) return false;
+ const animations = surface.getAnimations();
+ return animations.length === 0
+ || animations.every((animation) => animation.playState === "finished");
+ })()`),
+ "plugin route entrance finished",
+ );
+ await cdp.evaluate(`document.querySelector(".plugins-header-menu")?.click?.()`);
+ await waitFor(
+ () =>
+ cdp.evaluate(
+ `!!document.querySelector('[role="menuitem"][data-action="newFromTemplate"]')`,
+ ),
+ "plugins overflow newFromTemplate item",
+ );
+ await cdp.evaluate(
+ `document.querySelector('[role="menuitem"][data-action="newFromTemplate"]')?.click?.()`,
+ );
+ await waitFor(
+ () => cdp.evaluate(`!!document.querySelector(".plugins-modal-backdrop")`),
+ "plugin template modal",
+ );
+ const modalCoverage = await cdp.evaluate(`(() => {
const veil = document.querySelector(".plugins-modal-backdrop");
if (!veil) return { opened: false };
const toggle = document.querySelector(".app-work-panel-toggle");
@@ -867,6 +886,7 @@ async function main() {
return {
opened: true,
veilIsTopmostAtToggle: toggleStack[0] === veil,
+ toggleTopmost: (toggleStack[0]?.className ?? toggleStack[0]?.tagName ?? "").toString().slice(0, 40),
bandIsTopmost: bandStack[0] === band,
bandTopmost: (bandStack[0]?.className ?? bandStack[0]?.tagName ?? "").toString().slice(0, 40),
};
@@ -886,14 +906,14 @@ async function main() {
"the titlebar band does not paint over the modal veil",
JSON.stringify(modalCoverage),
);
- const modalClosed = await cdp.evaluate(`(async () => {
- document
- .querySelector(".plugins-modal-backdrop .plugins-modal-actions button")
- ?.click?.();
- await new Promise((r) => setTimeout(r, 300));
- return !document.querySelector(".plugins-modal-backdrop");
- })()`);
- check(modalClosed === true, "the plugin modal closes and leaves the route clean");
+ await cdp.evaluate(
+ `document.querySelector('.plugins-modal-backdrop .plugins-modal-actions [data-action="cancel"]')?.click?.()`,
+ );
+ await waitFor(
+ () => cdp.evaluate(`!document.querySelector(".plugins-modal-backdrop")`),
+ "plugin modal closed",
+ );
+ check(true, "the plugin modal closes and leaves the route clean");
// Once Extensions is active the footer Plugins button reuses the existing
// Back action, so a second activation returns to the previous destination
// (E2E-NAV-plugins-button-goes-back).