diff --git a/CHANGELOG.md b/CHANGELOG.md index eac930d..6b937ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ Version numbers follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html ### Changed -- **Redacted and deleted cards stay in the grid until the next scan** — previously redacting (✏) or deleting (🗑) a card — or running a bulk delete — removed the affected cards from the grid and from `S.flaggedData`/`S.filteredData` immediately. Now each item is kept and marked: the card is greyed (`card-resolved` styling), shows a `✏ Redacted` (green) or `🗑 Deleted` (red) badge, and its action buttons are hidden so it can't be re-processed. The operator can see what was handled during the session; the grid is rebuilt on the next scan run, which clears the markers. Implemented with `_redacted` / `_deleted` flags in `results.js` (`appendCard`, `redactItem`, `deleteItem`, `executeBulkDelete`); handled items are also excluded from the bulk-delete match set. `POST /api/delete_bulk` now returns `deleted_ids` so the grid marks exactly the items the server actually deleted (partial failures stay active). +- **Redacted and deleted cards stay in the grid until the next scan** — previously redacting (✏) or deleting (🗑) a card — or running a bulk delete — removed the affected cards from the grid and from `S.flaggedData`/`S.filteredData` immediately. Now each item is kept and marked: the card is greyed (`card-resolved` styling), shows a `✏ Redacted` (green) or `🗑 Deleted` (red) badge, and its action buttons are hidden so it can't be re-processed. The operator can see what was handled during the session; the grid is rebuilt on the next scan run, which clears the markers. Implemented with `_redacted` / `_deleted` flags in `results.js` (`appendCard`, `redactItem`, `deleteItem`, `executeBulkDelete`, `deleteSubjectItems`); handled items are also excluded from the bulk-delete match set. `POST /api/delete_bulk` now returns `deleted_ids` so the grid marks exactly the items the server actually deleted (partial failures stay active). Also fixes a latent bug in the data-subject delete flow where `renderGrid()` was called with no argument and threw, falsely reporting "Delete failed" after a successful erasure. ### Fixed diff --git a/static/js/results.js b/static/js/results.js index 0729c32..ba38676 100644 --- a/static/js/results.js +++ b/static/js/results.js @@ -399,10 +399,13 @@ async function deleteSubjectItems() { document.getElementById("dsubDeleteBtn").style.display = "none"; document.getElementById("dsubResults").innerHTML = ""; _dsubItems = []; - // Refresh grid - S.flaggedData = S.flaggedData.filter(f => !ids.includes(f.id)); - S.filteredData = S.filteredData.filter(f => !ids.includes(f.id)); - renderGrid(); + // Keep the deleted items in the grid (marked, greyed, buttons hidden) + // until the next scan run — only those the server actually deleted. + const deletedSet = new Set(d.deleted_ids || ids); + const _mark = (x) => { if (deletedSet.has(x.id)) x._deleted = true; }; + S.flaggedData.forEach(_mark); + S.filteredData.forEach(_mark); + renderGrid(S.filteredData.length ? S.filteredData : S.flaggedData); updateStats(); } catch(e) { statusEl.textContent = "Delete failed: " + e.message;