From 8a446509c62fa0ff6b2713035e11700e9b48d88c Mon Sep 17 00:00:00 2001 From: StyxX65 <150797939+StyxX65@users.noreply.github.com> Date: Mon, 22 Jun 2026 14:45:50 +0200 Subject: [PATCH] Hide landing/last-scan card whenever results render The live scan_file_flagged handler showed the grid but never hid #emptyState / #lastScanSummary, so when a scan ran with the landing card visible, results appeared underneath it until a manual refresh (which re-ran loadOpenItems and cleared it). Hide both panels in renderGrid whenever files are present, covering every render path (live SSE, open-items load, history, filters). Co-Authored-By: Claude Opus 4.8 --- static/js/results.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/static/js/results.js b/static/js/results.js index 069313e..b13d0de 100644 --- a/static/js/results.js +++ b/static/js/results.js @@ -122,6 +122,17 @@ function renderGrid(files) { const grid = document.getElementById('grid'); grid.innerHTML = ''; files.forEach(f => appendCard(f)); + // Whenever results are rendered, the landing/last-scan cards must be hidden — + // the live scan_file_flagged path shows the grid but does not clear them, so + // results would otherwise appear underneath the still-visible landing page + // until a manual refresh. Centralised here so every render path is covered. + if (files && files.length) { + const es = document.getElementById('emptyState'); + if (es) es.style.display = 'none'; + const ls = document.getElementById('lastScanSummary'); + if (ls) ls.style.display = 'none'; + if (grid) grid.style.display = S.isListView ? 'block' : 'grid'; + } _updateBulkBar(); updateDispositionStats(); }