Agent Zero AI framework
Fix transient UI layering over modals
Alessandro4f80ded53181
diff --git a/tests/test_browser_agent_regressions.py b/tests/test_browser_agent_regressions.pyindex 2a42f4b55..ce921faa9 100644--- a/tests/test_browser_agent_regressions.py+++ b/tests/test_browser_agent_regressions.py@@ -969,6 +969,29 @@ def test_surface_buttons_keep_modal_and_canvas_entry_points_separate():assert "/plugins/_desktop/webui/main.html" in surfaces_js+def test_transient_ui_layers_above_modals_below_confirm_dialogs():+ index_css = (PROJECT_ROOT / "webui" / "index.css").read_text(encoding="utf-8")+ modals_js = (PROJECT_ROOT / "webui" / "js" / "modals.js").read_text(encoding="utf-8")+ modals_css = (PROJECT_ROOT / "webui" / "css" / "modals.css").read_text(encoding="utf-8")+ toast_html = (+ PROJECT_ROOT / "webui" / "components" / "notifications" / "notification-toast-stack.html"+ ).read_text(encoding="utf-8")++ modal_base_z = int(re.search(r"const baseZIndex = (\d+);", modals_js).group(1))+ legacy_overlay_z = int(re.search(r"\.modal-overlay \{[^}]*z-index: (\d+);", modals_css, re.S).group(1))+ confirm_z = int(re.search(r"\.confirm-dialog-backdrop \{[^}]*z-index: (\d+);", modals_css, re.S).group(1))+ toast_z = int(re.search(r"\.toast-stack-container \{[^}]*z-index: (\d+);", toast_html, re.S).group(1))+ tooltip_z_indexes = [+ int(z)+ for z in re.findall(r"\.tooltip \{[^}]*z-index: (\d+);", index_css, re.S)+ ]++ assert tooltip_z_indexes+ assert toast_z > max(modal_base_z + 20, legacy_overlay_z)+ assert all(z > toast_z for z in tooltip_z_indexes)+ assert all(z < confirm_z for z in [toast_z, *tooltip_z_indexes])++def test_browser_tool_does_not_auto_open_canvas_policy_is_documented():prompt = (PROJECT_ROOT / "plugins" / "_browser" / "prompts" / "agent.system.tool.browser.md"diff --git a/webui/AGENTS.md b/webui/AGENTS.mdindex 628a3a17b..63c4fa40e 100644--- a/webui/AGENTS.md+++ b/webui/AGENTS.md@@ -28,6 +28,7 @@- Startup scripts in `index.html` must be local and non-parser-blocking: use ES modules, `defer`, or `async` for every script with `src`.- Rubik (`--font-family-main`) is the default WebUI text and control font; use the code/mono font tokens only for code, logs, paths, and fixed-width data.- Hover, focus, and active border treatments should follow existing neutral border/background patterns; avoid hard-coded blue border highlights unless matching an established specialized surface.+- Keep transient UI affordances such as Bootstrap tooltips and notification toasts above normal and legacy modal layers while confirmation dialogs remain on top.## Work Guidancediff --git a/webui/components/notifications/AGENTS.md b/webui/components/notifications/AGENTS.mdindex 071bf076f..4e958d3c1 100644--- a/webui/components/notifications/AGENTS.md+++ b/webui/components/notifications/AGENTS.md@@ -15,6 +15,7 @@- Use the notification system for user-facing success, warning, info, and error feedback.- Keep public helper names stable for core and plugin callers.+- Keep the toast stack visible above normal and legacy modal overlays while staying below confirmation dialogs.- Avoid exposing secrets or raw auth payloads in notification text.## Work Guidancediff --git a/webui/components/notifications/notification-toast-stack.html b/webui/components/notifications/notification-toast-stack.htmlindex 502dabdb9..3a9fc29c1 100644--- a/webui/components/notifications/notification-toast-stack.html+++ b/webui/components/notifications/notification-toast-stack.html@@ -58,7 +58,7 @@position: absolute;bottom: 5px; /* Spacing from the bottom of the zero-height container */padding-right: 5px;- z-index: 4000;+ z-index: 8900;display: flex;flex-direction: column-reverse; /* Stack toasts upwards */gap: 8px;diff --git a/webui/index.css b/webui/index.cssindex 3a408a7ef..5b1362c6f 100644--- a/webui/index.css+++ b/webui/index.css@@ -189,114 +189,8 @@ body,/* Bootstrap-like tooltips */.tooltip {position: absolute;- /* Above custom modals (base z-index: 3000 in `webui/js/modals.js`) */- z-index: 5000;- display: block;- margin: 0;- font-family: var(--font-family-main);- font-style: normal;- font-weight: 400;- line-height: 1.2;- text-align: left;- text-decoration: none;- text-shadow: none;- text-transform: none;- letter-spacing: normal;- word-break: normal;- white-space: normal;- opacity: 0;- pointer-events: none;- transition: opacity 0.08s ease-in-out;-}--.tooltip.show {- opacity: 1;-}--.tooltip .tooltip-inner {- max-width: 240px;- padding: 0.35rem 0.6rem;- color: var(--color-text);- background-color: var(--color-secondary);- border-radius: 0.375rem;- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);- font-size: 0.75rem;-}--.tooltip .tooltip-arrow {- position: absolute;- width: 0.8rem;- height: 0.4rem;-}--.tooltip .tooltip-arrow::before {- content: "";- position: absolute;- border-color: transparent;- border-style: solid;-}--.bs-tooltip-top .tooltip-arrow {- bottom: 0;- left: 50%;- transform: translateX(-50%);-}--.bs-tooltip-top .tooltip-arrow::before {- border-width: 0.4rem 0.4rem 0;- border-top-color: var(--color-secondary);- top: 0;-}--.bs-tooltip-bottom .tooltip-arrow {- top: 0;- left: 50%;- transform: translateX(-50%);-}--.bs-tooltip-bottom .tooltip-arrow::before {- border-width: 0 0.4rem 0.4rem;- border-bottom-color: var(--color-secondary);- top: 0;-}--.bs-tooltip-start .tooltip-arrow,-.bs-tooltip-left .tooltip-arrow {- right: 0;- top: 50%;- width: 0.4rem;- height: 0.8rem;- transform: translateY(-50%);-}--.bs-tooltip-start .tooltip-arrow::before,-.bs-tooltip-left .tooltip-arrow::before {- border-width: 0.4rem 0 0.4rem 0.4rem;- border-left-color: var(--color-secondary);- left: 0;-}--.bs-tooltip-end .tooltip-arrow,-.bs-tooltip-right .tooltip-arrow {- left: 0;- top: 50%;- width: 0.4rem;- height: 0.8rem;- transform: translateY(-50%);-}--.bs-tooltip-end .tooltip-arrow::before,-.bs-tooltip-right .tooltip-arrow::before {- border-width: 0.4rem 0.4rem 0.4rem 0;- border-right-color: var(--color-secondary);- right: 0;-}--/* Bootstrap-like tooltips */-.tooltip {- position: absolute;- /* Above custom modals (base z-index: 3000 in `webui/js/modals.js`) */- z-index: 5000;+ /* Above custom modals and toasts, below confirm dialogs. */+ z-index: 9000;display: block;margin: 0;font-family: var(--font-family-main);