From 2b7d6c8c7c0bc448e00d7d36e4f362aa67dd5bb9 Mon Sep 17 00:00:00 2001
From: Broque Thomas <26755000+Nezreka@users.noreply.github.com>
Date: Fri, 24 Apr 2026 08:34:03 -0700
Subject: [PATCH] Fix global search popover not scrolling when results overflow
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The source-picker refactor introduced a new stable DOM structure inside
`#gsearch-results`:
But the companion CSS never landed. `#gsearch-body` had default block
layout, so when results exceeded the 60vh cap, they clipped silently
instead of scrolling. The old structure had `.gsearch-results-body`
with `overflow-y: auto; flex: 1` directly inside the panel; that rule
still exists but its selector now matches a nested div with no flex
parent, so `flex: 1` is a no-op and overflow doesn't trigger.
Fix: give the three stable children the right flex behaviour so the
body fills remaining space and scrolls.
- `#gsearch-source-row` and `#gsearch-fallback-banner` stay at natural
height (flex-shrink: 0).
- `#gsearch-body` grows (flex: 1 1 auto), can shrink below content
height (min-height: 0 — this is the critical bit, otherwise flex
items won't shrink below their intrinsic size and overflow never
triggers), and scrolls vertically.
Styled scrollbar matches the rest of the panel (4px, translucent thumb).
---
webui/static/style.css | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/webui/static/style.css b/webui/static/style.css
index fedf54cd..7c7e781a 100644
--- a/webui/static/style.css
+++ b/webui/static/style.css
@@ -5466,6 +5466,22 @@ body.helper-mode-active #dashboard-activity-feed:hover {
}
.gsearch-results.visible { display: flex; animation: gsearchSlideUp 0.2s ease; }
+/* Stable results-panel structure built by downloads.js _doInit: the source
+ row and fallback banner keep their natural height; #gsearch-body grows
+ to fill what's left of the 60vh cap and scrolls when content overflows.
+ Without the flex:1 + overflow on #gsearch-body, content past the cap
+ was clipped with no scrollbar — the source-picker refactor introduced
+ the structure but not the accompanying CSS. */
+#gsearch-source-row { flex-shrink: 0; }
+#gsearch-fallback-banner { flex-shrink: 0; }
+#gsearch-body {
+ flex: 1 1 auto;
+ min-height: 0;
+ overflow-y: auto;
+}
+#gsearch-body::-webkit-scrollbar { width: 4px; }
+#gsearch-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
+
@keyframes gsearchSlideUp {
from { opacity: 0; transform: translateX(-50%) translateY(10px); }
to { opacity: 1; transform: translateX(-50%) translateY(0); }