From 7eaee90798570cd9009f82ff45fff8c867215aa4 Mon Sep 17 00:00:00 2001 From: Kinneyzhang Date: Tue, 25 Aug 2026 22:45:40 +0800 Subject: [PATCH] perf: use document height for Research Shelf --- examples/research-shelf.el | 2 +- tests/etaf-playground-tests.el | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/research-shelf.el b/examples/research-shelf.el index 2794824..75c8c96 100644 --- a/examples/research-shelf.el +++ b/examples/research-shelf.el @@ -670,7 +670,7 @@ user's prior local additions cannot collide with the generated dataset." (lambda () (etaf-view (column :class "research-shelf-shell" :width '(viewport) - :height '(viewport-height) + :height 'auto :min-height '(viewport-height) :color (etaf-theme-token :ink) :bgcolor (etaf-theme-token :paper) (flex :class "research-shelf-header" :width 'stretch :min-width 0 diff --git a/tests/etaf-playground-tests.el b/tests/etaf-playground-tests.el index 45194f7..1da05d1 100644 --- a/tests/etaf-playground-tests.el +++ b/tests/etaf-playground-tests.el @@ -402,6 +402,18 @@ database and mounts a test buffer before running BODY." research-shelf-theme-toggle)) (should (etaf-runtime-handler-for runtime ref)))))) +(ert-deftest etaf-playground-research-shelf-uses-window-document-height () + "Research Shelf fills the viewport without creating a root scroll owner." + (etaf-playground-test--with-app (buffer database) + (etaf-playground-mount-example + buffer "research-shelf" nil + '(:viewport-width 900 :viewport-height 40)) + (let* ((state (ebox--buffer-render-state (get-buffer buffer))) + (root (plist-get state :root-node))) + (should (eq (plist-get root :height) 'auto)) + (should (equal (plist-get root :min-height) '(viewport-height))) + (should-not (plist-get state :scroll-region-ids))))) + (ert-deftest etaf-playground-fixture-supports-realistic-page-counts () "The Playground can mount a larger deterministic fixture for pressure runs." (etaf-playground-test--ensure-app-loaded)