From e46c752aecb1f7bda7f34c4190c74fbaf6fbe2d8 Mon Sep 17 00:00:00 2001 From: tyler Date: Tue, 19 May 2026 00:02:29 -0400 Subject: [PATCH] Maybe working divider --- ollama_answers.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/ollama_answers.py b/ollama_answers.py index 3cba87b..e0e288a 100644 --- a/ollama_answers.py +++ b/ollama_answers.py @@ -877,17 +877,27 @@ FRONTEND_JS_TEMPLATE = r""" const box = document.getElementById('sxng-stream-box'); const data = document.getElementById('sxng-stream-data'); - // Hide native SearXNG answer entries that are siblings of our box setTimeout(() => { - const parent = box ? box.parentElement : null; - if (parent) { - Array.from(parent.children).forEach(el => { - if (el !== box && el.classList.contains('answer')) { - el.style.display = 'none'; - } - }); + const ourWrapper = box ? box.closest('.answer') : null; + const answersDiv = document.getElementById('answers'); + if (!ourWrapper || !answersDiv) return; + + let hasVisibleAbove = false; + let found = false; + Array.from(answersDiv.children).forEach(el => { + if (el === ourWrapper) { found = true; return; } + if (!found && el.classList.contains('answer')) { + // This is a native answer sibling above us + hasVisibleAbove = true; + } + }); + + if (hasVisibleAbove) { + box.style.borderTop = '1px solid var(--color-result-border, #4c566a)'; + box.style.paddingTop = '1rem'; + box.style.marginTop = '0.75rem'; } - }, 0); + }, 50); let restored = false; let isStreaming = false; @@ -2040,7 +2050,7 @@ class SXNGPlugin(Plugin): .replace("__JS_Q__", js_q) html_payload = f''' -