From b89141679fbf7304c03e0df52e64b19a21623142 Mon Sep 17 00:00:00 2001 From: Zarl-prog Date: Tue, 2 Jun 2026 19:51:35 +0530 Subject: [PATCH] fix(cookbook): scroll serve panel into view when expanded (#1180) (#1191) --- static/js/cookbookServe.js | 3 ++- static/style.css | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/cookbookServe.js b/static/js/cookbookServe.js index 666d947..189c4ae 100644 --- a/static/js/cookbookServe.js +++ b/static/js/cookbookServe.js @@ -650,9 +650,10 @@ function _rerenderCachedModels() { item.classList.add('doclib-card-expanded'); item.style.flexDirection = 'column'; item.style.alignItems = 'stretch'; - if (list) list.scrollTop = 0; item.insertAdjacentHTML('beforeend', panelHtml); const panel = item.querySelector('.hwfit-serve-panel'); + // Scroll the serve panel into view within its nearest scrollable ancestor + requestAnimationFrame(() => panel.scrollIntoView({ block: 'nearest', behavior: 'smooth' })); // Build command preview function updateCmd() { diff --git a/static/style.css b/static/style.css index e77c84b..4c0813d 100644 --- a/static/style.css +++ b/static/style.css @@ -14873,6 +14873,7 @@ body.left-dock-active { /* Cookbook's cached-model list should scale with viewport height, not be capped at 400px */ .hwfit-cached-list { max-height: min(75vh, 900px) !important; + overflow-y: auto; } /* Drag-and-drop visual hint for the email compose pane. Subtle accent outline + tinted overlay so it's obvious files will attach if dropped. */