Skip to content

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

fix(styles): keep route overlays above the window chrome

vastsab23f45e3a119
diff --git a/apps/desktop/src/styles/base.css b/apps/desktop/src/styles/base.css
index 5d7c2f25b..a95c08f47 100644
--- a/apps/desktop/src/styles/base.css
+++ b/apps/desktop/src/styles/base.css
@@ -170,10 +170,6 @@ html {
color: var(--ds-text-primary);
}
-.app-shell > :not(.app-scenic-backdrop) {
- z-index: 1;
-}
-
.app-scenic-backdrop {
position: fixed;
inset: 0;
diff --git a/apps/desktop/test/plugin-themes.test.mjs b/apps/desktop/test/plugin-themes.test.mjs
index c92b4a2cf..691605bcf 100644
--- a/apps/desktop/test/plugin-themes.test.mjs
+++ b/apps/desktop/test/plugin-themes.test.mjs
@@ -94,7 +94,10 @@ test("scenic plugins use the normal full-window shell for compositing", () => {
const settingsSrc = readFileSync(join(desktopRoot, "src/styles/settings.css"), "utf8");
assert.match(baseSrc, /\.app-shell\s*\{[^}]*position:\s*relative;[^}]*isolation:\s*isolate/s);
assert.match(baseSrc, /\.app-scenic-backdrop\s*\{[^}]*position:\s*fixed;[^}]*inset:\s*0/s);
- assert.match(baseSrc, /\.app-shell\s*>\s*:not\(\.app-scenic-backdrop\)[^}]*z-index:\s*1/s);
+ // The backdrop is the shell's first child with `position: fixed`, so it needs
+ // no z-index sibling rule; such a rule would turn `.main-pane` into a stacking
+ // context and pin route overlays underneath the window chrome.
+ assert.doesNotMatch(baseSrc, /\.app-shell\s*>\s*:not\(\.app-scenic-backdrop\)/);
assert.match(settingsSrc, /data-plugin-theme\^="plugin:io\.github\.akshayxkill\.nexus-scenic-themes:/);
assert.match(settingsSrc, /\.app-shell\.settings-mode[^}]*background:\s*transparent\s*!important/s);
assert.match(settingsSrc, /\.settings-content[^}]*background:\s*transparent\s*!important/s);
@@ -112,7 +115,10 @@ test("scenic plugin themes expose a full-window settings compositing hook", () =
test("scenic background is a host root layer, not an app-shell pseudo-element", () => {
assert.match(appSrc, /className=\"app-scenic-backdrop\"/);
assert.match(readFileSync(join(desktopRoot, "src/styles/base.css"), "utf8"), /\.app-scenic-backdrop\s*\{[^}]*position:\s*fixed/s);
- assert.match(readFileSync(join(desktopRoot, "src/styles/base.css"), "utf8"), /\.app-shell\s*>\s*:\s*not\(\.app-scenic-backdrop\)/);
+ assert.doesNotMatch(
+ readFileSync(join(desktopRoot, "src/styles/base.css"), "utf8"),
+ /\.app-shell\s*>\s*:\s*not\(/,
+ );
});
test("core Settings navigation dismisses an active plugin destination", () => {
diff --git a/apps/desktop/test/settings-dialog-overlay.test.mjs b/apps/desktop/test/settings-dialog-overlay.test.mjs
index 4bba71b45..ec27b51f2 100644
--- a/apps/desktop/test/settings-dialog-overlay.test.mjs
+++ b/apps/desktop/test/settings-dialog-overlay.test.mjs
@@ -93,3 +93,20 @@ test("leaf popups and toasts keep painting above the route overlays", async () =
assert.ok(selectMenu > veil && selectMenu > sheet && selectMenu > notes);
assert.ok(toast > veil && toast > sheet && toast > notes);
});
+
+// The scenic backdrop stays the app shell's only layered child. A z-index on
+// any shell sibling that contains a route overlay (`.main-pane`, `.sidebar`)
+// re-creates the stacking context the entrance rule above exists to avoid, and
+// the overlay sinks below the window chrome again.
+test("app shell children never trap a route overlay in a stacking context", async () => {
+ const baseSrc = await read("../src/styles/base.css");
+ assert.doesNotMatch(baseSrc, /\.app-shell\s*>\s*:\s*not\(/);
+ for (const selector of [".main-pane", ".sidebar", ".work-panel"]) {
+ const escaped = selector.replace(".", "\\.");
+ const block = baseSrc.match(new RegExp(`(?:^|\\n)${escaped} \\{[^}]*\\}`));
+ assert.ok(
+ !block || !/z-index:/.test(block[0]),
+ `${selector} must not state a z-index in base.css`,
+ );
+ }
+});