Skip to content

Agent Zero AI framework

fix(sidebar): keep row action menus within the viewport

Alessandro1afc65438f96
diff --git a/tests/test_sidebar_row_actions.py b/tests/test_sidebar_row_actions.py
index 2ead70044..9c644a7f1 100644
--- a/tests/test_sidebar_row_actions.py
+++ b/tests/test_sidebar_row_actions.py
@@ -43,7 +43,8 @@ def test_sidebar_uses_one_fixed_row_menu_with_standard_close_behavior() -> None:
assert "z-index: 9999;" in html
assert "rowMenuOpenId" in store
assert "if (this.rowMenuOpenId === id)" in store
- assert "const openUp = spaceBelow < 96 && spaceAbove > spaceBelow;" in store
+ assert "const openUp = spaceAbove > spaceBelow;" in store
+ assert "maxHeight:" in store
def test_pin_plugin_contributes_the_menu_action_and_list_ordering() -> None:
diff --git a/webui/components/sidebar/AGENTS.md b/webui/components/sidebar/AGENTS.md
index b02426040..71bbcd9ec 100644
--- a/webui/components/sidebar/AGENTS.md
+++ b/webui/components/sidebar/AGENTS.md
@@ -23,6 +23,7 @@
- Running parent and child chats share the chat-list working-bubble animation; keep it scoped away from task and connection-status indicators.
- Chat and task lists reclaim the same part of the sidebar's left content inset so their project bubbles align, while their section headers retain the standard sidebar inset.
- Chat-row action buttons consume layout width only while a pointer row is hovered or while that row is selected on a touch device.
+- Row overflow menus choose the roomier side of their trigger and cap their height to the available viewport so plugin actions remain reachable.
- Built-in chat and task overflow menus follow the standard row actions; plugin controls remain direct row actions.
- `chats.saveChat(ctxid)` exports an explicit context without changing selection; omitted IDs retain current-chat behavior.
- Cancelling the Load Chat file chooser resolves without calling `chat_load` or showing a success/error notification.
diff --git a/webui/components/sidebar/sidebar-store.js b/webui/components/sidebar/sidebar-store.js
index 4d5319cb9..18b815175 100644
--- a/webui/components/sidebar/sidebar-store.js
+++ b/webui/components/sidebar/sidebar-store.js
@@ -189,7 +189,7 @@ const model = {
const menuWidth = 180;
const spaceBelow = window.innerHeight - rect.bottom - gap - padding;
const spaceAbove = rect.top - gap - padding;
- const openUp = spaceBelow < 96 && spaceAbove > spaceBelow;
+ const openUp = spaceAbove > spaceBelow;
const maxLeft = Math.max(padding, window.innerWidth - menuWidth - padding);
const left = Math.min(Math.max(rect.right - menuWidth, padding), maxLeft);
@@ -199,6 +199,7 @@ const model = {
top: openUp ? "auto" : `${Math.round(rect.bottom + gap)}px`,
bottom: openUp ? `${Math.round(window.innerHeight - rect.top + gap)}px` : "auto",
minWidth: `${menuWidth}px`,
+ maxHeight: `${Math.max(0, openUp ? spaceAbove : spaceBelow)}px`,
};
},
};