From 6c9e04fa69c14f2bf4c640ec9c049fb7c5a5b692 Mon Sep 17 00:00:00 2001 From: Lukas Parsons Date: Tue, 7 Jul 2026 16:26:27 -0400 Subject: [PATCH] fix: zoom-aware clamping in cookbook task/serve dropdown positioning The initial positioning used zoom-divided rect coordinates but the visualViewport clamping block used raw rect.bottom/rect.top without dividing by zoom. At ui-scale-125 the clamp pushed dropdowns off-screen. Affected cookbook task menu-btn and serve-config dropdown menus. --- static/js/cookbookRunning.js | 4 ++-- static/js/cookbookServe.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/cookbookRunning.js b/static/js/cookbookRunning.js index 9f03fe2e..f9a40c1f 100644 --- a/static/js/cookbookRunning.js +++ b/static/js/cookbookRunning.js @@ -2544,9 +2544,9 @@ export function _renderRunningTab() { const viewBottom = vv ? vv.offsetTop + vv.height : window.innerHeight; const dh = dropdown.offsetHeight; const m = 8; - let top = rect.bottom + 2; + let top = rect.bottom / z + 2; if (top + dh > viewBottom - m) { - const above = rect.top - 2 - dh; + const above = rect.top / z - 2 - dh; top = above >= viewTop + m ? above : Math.max(viewTop + m, viewBottom - dh - m); } dropdown.style.top = top + 'px'; diff --git a/static/js/cookbookServe.js b/static/js/cookbookServe.js index 7c75e1c3..4b22904b 100644 --- a/static/js/cookbookServe.js +++ b/static/js/cookbookServe.js @@ -1090,9 +1090,9 @@ function _rerenderCachedModels() { const viewBottom = vv ? vv.offsetTop + vv.height : window.innerHeight; const dh = dropdown.offsetHeight; const mm = 8; - let top = rect.bottom + 2; + let top = rect.bottom / z + 2; if (top + dh > viewBottom - mm) { - const above = rect.top - 2 - dh; + const above = rect.top / z - 2 - dh; top = above >= viewTop + mm ? above : Math.max(viewTop + mm, viewBottom - dh - mm); } dropdown.style.top = top + 'px';