From dde2d25804b58a4797b47e73ec6d02f6f8d6aede Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Thu, 11 Jun 2026 07:37:38 +0900 Subject: [PATCH] Email library bulk Done: animate-out + drop when filter='undone' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Repro: filter Undone → Select All → uncheck a few → Actions → Done → nothing visible happens. Reason: the bulk-Done branch only flipped em.is_answered on the in-memory entries; the cards stayed in state._libEmails so they kept rendering, but now with the done check ticked. From the user's POV — still 'undone' filter, cards still there — it looked like the action was a no-op. When the filter is 'undone' specifically, treat marking done as a view-removal (same animate-then-prune step archive/delete uses). --- static/js/emailLibrary.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/static/js/emailLibrary.js b/static/js/emailLibrary.js index 8fda6b898..b77e932a2 100644 --- a/static/js/emailLibrary.js +++ b/static/js/emailLibrary.js @@ -5046,6 +5046,14 @@ async function _bulkAction(action) { await _animateEmailCardRemoval(uids); const removed = new Set(uids.map(uid => String(uid))); state._libEmails = state._libEmails.filter(e => !removed.has(String(e.uid))); + } else if (action === 'done' && state._libFilter === 'undone') { + // The undone filter is a "show only not-done" view — after marking + // selected emails done, they no longer match. Animate them out and + // drop them from the local list so the view reflects the filter + // instead of leaving freshly-done cards sitting there. + await _animateEmailCardRemoval(uids); + const removed = new Set(uids.map(uid => String(uid))); + state._libEmails = state._libEmails.filter(e => !removed.has(String(e.uid))); } } finally { if (busySpinner) busySpinner.destroy();