Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(ui): let a section's overlay cover the nav column

Harald053c30aa39d2
diff --git a/jarvis/ui/web/frontend/src/App.tsx b/jarvis/ui/web/frontend/src/App.tsx
index a44893e996..696fbcb3a5 100644
--- a/jarvis/ui/web/frontend/src/App.tsx
+++ b/jarvis/ui/web/frontend/src/App.tsx
@@ -298,7 +298,8 @@ export default function App() {
<div className="relative isolate flex h-screen w-screen overflow-hidden bg-background text-foreground">
<DesktopWallpaper hideMascot={hideMascot} />
{brokerMounted && <SubscriptionRealtimeTransportBroker />}
- <main className="relative z-10 flex min-w-0 flex-1 flex-col">
+ {/* No z-index on the stage column — see the shell below. */}
+ <main className="relative flex min-w-0 flex-1 flex-col">
<SectionStage visualization={visualizationActive}>
<MainView />
</SectionStage>
@@ -334,7 +335,23 @@ export default function App() {
</>
)}
- <main className="relative z-10 flex min-w-0 flex-1 flex-col">
+ {/*
+ The stage column carries NO z-index, and must not get one back.
+
+ A positive z-index here makes <main> its own stacking context, and
+ then every full-screen overlay a section renders inside it — the
+ wallpaper preview, the view dialogs, their scrims — is trapped at
+ THAT level however high its own z-index climbs. The nav column
+ beside it (z-20) then paints over the overlay: the sidebar logo,
+ the assistant name and the voice state landed on top of the
+ wallpaper preview's own header, one line of text over the other.
+
+ `relative` alone is all the column needs: it stays above the
+ wallpaper layer because that one is negative (-z-10), and the
+ overlays inside reach the app's real dialog levels. Guarded by
+ components/layout/overlay-stacking.test.ts.
+ */}
+ <main className="relative flex min-w-0 flex-1 flex-col">
{/* App-wide macOS permission alert — topmost so a missing grant is
impossible to miss on any view. No-op on other platforms. */}
<PermissionsAlertBanner />
diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
index 5ac73423cc..51a1c775c4 100644
--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
@@ -187,9 +187,12 @@ export function Sidebar({
return (
// No right border: the draggable seam beside it draws that line now, and
// two 1px lines three pixels apart read as a rendering fault.
- // z-20: above the main area (z-10). The rail's hover label flies out past
- // the sidebar's edge, and it must paint over the page rather than under it;
- // the app-wide layers (toasts, docks, dialogs) all sit at z-40 and above.
+ // z-20: above the stage column, which carries no z-index of its own so
+ // that the overlays inside it are not trapped below this one (App.tsx).
+ // The rail's hover label flies out past the sidebar's edge, and it must
+ // paint over the page rather than under it; the app-wide layers (toasts,
+ // docks, dialogs) all sit at z-40 and above and now really do cover this
+ // column.
<aside
style={{ width: railed ? SIDEBAR_RAIL_WIDTH : width }}
data-testid="sidebar"
diff --git a/jarvis/ui/web/frontend/src/components/layout/overlay-stacking.test.ts b/jarvis/ui/web/frontend/src/components/layout/overlay-stacking.test.ts
new file mode 100644
index 0000000000..66ce794ed5
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/layout/overlay-stacking.test.ts
@@ -0,0 +1,111 @@
+import { readFileSync } from "node:fs";
+import { join } from "node:path";
+import * as ts from "typescript";
+import { describe, expect, it } from "vitest";
+
+/**
+ * The shell must not build a stacking context around the section stage.
+ *
+ * A full-screen overlay inside a view (the wallpaper preview, a view's own
+ * dialog and its scrim) is `position: fixed` and climbs to z-40/z-50/z-70 to
+ * cover the app. All of that is void the moment an ANCESTOR between it and the
+ * shell root carries a z-index of its own: the overlay is then trapped at the
+ * ancestor's level, and the nav column beside it (z-20) paints straight over
+ * it — which is how the sidebar logo, the assistant name and the voice state
+ * ended up printed on top of the wallpaper preview's own header.
+ *
+ * The chain guarded here is the whole path from the shell root down to a
+ * section: <main> in App.tsx, the SectionStage it wraps the section in, and
+ * MainView's per-section wrappers.
+ */
+
+const SOURCE_ROOT = join(process.cwd(), "src");
+
+/** A Tailwind z-index utility that would open a stacking context (z-0 does). */
+const STACKING_Z = /(?:^|[\s"'`])z-(?:\d+|\[[^\]]*\])/;
+
+function read(relativePath: string): string {
+ return readFileSync(join(SOURCE_ROOT, relativePath), "utf8");
+}
+
+/**
+ * Every className text a JSX element in `path` is given, tag by tag.
+ *
+ * `within` narrows the walk to one function — App.tsx also renders layers that
+ * live BESIDE the section stage rather than above it, and their z-index is
+ * none of this guard's business.
+ */
+function classNamesByTag(
+ path: string,
+ within?: string,
+): Array<{ tag: string; line: number; text: string }> {
+ const source = ts.createSourceFile(
+ path,
+ read(path),
+ ts.ScriptTarget.Latest,
+ true,
+ ts.ScriptKind.TSX,
+ );
+ const found: Array<{ tag: string; line: number; text: string }> = [];
+
+ function visit(node: ts.Node): void {
+ if (
+ within &&
+ ts.isFunctionDeclaration(node) &&
+ node.name?.getText(source) !== within
+ ) {
+ return;
+ }
+ if (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) {
+ for (const attribute of node.attributes.properties) {
+ if (!ts.isJsxAttribute(attribute)) continue;
+ if (attribute.name.getText(source) !== "className") continue;
+ found.push({
+ tag: node.tagName.getText(source),
+ line: source.getLineAndCharacterOfPosition(node.getStart(source)).line + 1,
+ text: attribute.initializer?.getText(source) ?? "",
+ });
+ }
+ }
+ ts.forEachChild(node, visit);
+ }
+
+ visit(source);
+ return found;
+}
+
+describe("overlay stacking guard", () => {
+ it("keeps the stage column out of its own stacking context", () => {
+ const offenders = classNamesByTag("App.tsx")
+ .filter((entry) => entry.tag === "main" && STACKING_Z.test(entry.text))
+ .map((entry) => `App.tsx:${entry.line}`);
+
+ expect(
+ offenders,
+ "`relative` alone: a z-index on <main> traps every full-screen overlay a " +
+ "section renders under the nav column (z-20).",
+ ).toEqual([]);
+ });
+
+ it("keeps the section wrappers out of their own stacking context", () => {
+ const onThePath: Array<[string, string | undefined]> = [
+ ["App.tsx", "SectionStage"],
+ ["components/layout/MainView.tsx", undefined],
+ ];
+ const offenders: string[] = [];
+
+ for (const [path, within] of onThePath) {
+ for (const entry of classNamesByTag(path, within)) {
+ if (!STACKING_Z.test(entry.text)) continue;
+ offenders.push(`${path}:${entry.line} <${entry.tag}>`);
+ }
+ }
+
+ expect(
+ offenders,
+ "Anything on the path from the shell root to a section must stay " +
+ "z-index-free, or the section's overlays cannot reach the app's " +
+ "dialog levels.",
+ ).toEqual([]);
+ });
+});