From eac6e5aed300832480d3a69074f89c7ee2e3a6d6 Mon Sep 17 00:00:00 2001 From: bruno Date: Tue, 21 Jul 2026 11:25:36 -0400 Subject: [PATCH] fix: 2 context menu width fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - base.html showContextMenu: edge detection (menu never overflows right/bottom) - app.css .more-menu: min-width:200px → unset + width:max-content - 143 tests passent --- app/templates/base.html | 14 ++++++++++++-- static/css/app.css | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/templates/base.html b/app/templates/base.html index cdd0ee6..693da48 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -1071,10 +1071,20 @@ }, showContextMenu(event, pageId, pageName) { + var x = event.clientX, y = event.clientY; + // Prevent menu from overflowing right edge + var viewW = window.innerWidth; + var viewH = window.innerHeight; + var menuW = 210; // max-width ~240, safe estimate + var menuH = 360; // approximate max height + if (x + menuW > viewW) x = viewW - menuW - 8; + if (y + menuH > viewH) y = viewH - menuH - 8; + if (x < 0) x = 8; + if (y < 0) y = 8; this.contextMenu = { visible: true, - x: event.clientX, - y: event.clientY, + x: x, + y: y, pageId: pageId, pageName: pageName }; diff --git a/static/css/app.css b/static/css/app.css index 73ea146..cc98843 100644 --- a/static/css/app.css +++ b/static/css/app.css @@ -2782,7 +2782,7 @@ button.breadcrumb-current { max-width: 260px; } position: absolute; top: calc(100% + 4px); right: 0; background: var(--bg-modal); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); - min-width: 200px; z-index: 100; padding: 4px 0; + min-width: unset; width: max-content; z-index: 100; padding: 4px 0; } .more-menu-item { padding: 8px 14px; font-size: 13px; color: var(--text-primary);