From 78fb4064227424638f46d7926a3e1bdf266b1096 Mon Sep 17 00:00:00 2001 From: StyxX65 <150797939+StyxX65@users.noreply.github.com> Date: Wed, 29 Apr 2026 15:18:58 +0200 Subject: [PATCH] Fixed two bugs: selected cards staying visible after preview opens, and stale history results showing when a new scan starts. --- CHANGELOG.md | 10 ++++++++++ static/js/history.js | 4 ++++ static/js/results.js | 1 + static/js/users.js | 2 +- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc498a1..92cc24a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ Version numbers follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html --- +## [1.6.26] — 2026-04-29 + +### Fixed + +- **Previous scan results visible when a new scan starts** — two async functions (`loadHistorySession` and `loadLastScanSummary`) could resolve after `startScan` had already cleared the grid. `loadHistorySession` would re-populate the grid with old history items; `loadLastScanSummary` would re-show the last-scan summary card. Both functions now bail early after each `await` if any of the three scan-running flags (`S._m365ScanRunning`, `S._googleScanRunning`, `S._fileScanRunning`) is set — those flags are written synchronously by `startScan` before any awaits, so the check is race-free. + +- **Selected card scrolls out of view when preview panel opens** — clicking a card in grid view opens the 420 px preview panel, which shrinks the grid area and reflows the card columns. The selected card was no longer visible. `openPreview()` now schedules a `requestAnimationFrame` after removing `.hidden` from the panel so the card is scrolled back into view (`scrollIntoView block: nearest`) once the layout has settled. + +--- + ## [1.6.25] — 2026-04-25 ### Added diff --git a/static/js/history.js b/static/js/history.js index 0408506..5b001f6 100644 --- a/static/js/history.js +++ b/static/js/history.js @@ -43,6 +43,8 @@ async function loadHistorySession(refScanId) { let resolvedRef = refScanId; if (resolvedRef === null) { const sessions = _sessions !== null ? _sessions : await _fetchSessions(); + // Bail if a scan started while we were fetching sessions + if (S._m365ScanRunning || S._googleScanRunning || S._fileScanRunning) return; if (!sessions.length) { // No scans in DB — nothing to show window.loadLastScanSummary?.(); @@ -54,6 +56,8 @@ async function loadHistorySession(refScanId) { try { const r = await fetch('/api/db/flagged?ref=' + resolvedRef); const items = await r.json(); + // Bail if a scan started while we were fetching flagged items + if (S._m365ScanRunning || S._googleScanRunning || S._fileScanRunning) return; closeHistoryPicker(); if (!Array.isArray(items) || items.length === 0) { diff --git a/static/js/results.js b/static/js/results.js index 9e683e4..6940022 100644 --- a/static/js/results.js +++ b/static/js/results.js @@ -93,6 +93,7 @@ async function openPreview(f) { panel.classList.remove('hidden'); const _savedW = sessionStorage.getItem('gdpr_preview_width'); if (_savedW) panel.style.width = _savedW + 'px'; + if (cardEl) requestAnimationFrame(() => cardEl.scrollIntoView({ behavior: 'smooth', block: 'nearest' })); title.textContent = f.name; frame.style.display = 'none'; loading.style.display = 'flex'; diff --git a/static/js/users.js b/static/js/users.js index c124a9c..2b54a6d 100644 --- a/static/js/users.js +++ b/static/js/users.js @@ -176,7 +176,7 @@ async function loadLastScanSummary() { try { const r = await fetch('/api/db/stats'); const d = await r.json(); - if (!d.scan_id || S.flaggedData.length > 0) return; + if (!d.scan_id || S.flaggedData.length > 0 || S._m365ScanRunning || S._googleScanRunning || S._fileScanRunning) return; const panel = document.getElementById('lastScanSummary'); const empty = document.getElementById('emptyState'); if (!panel || !empty) return;