@bobfrankston/rmfmail 1.1.245 → 1.1.246
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/app.bundle.js +16 -4
- package/client/app.bundle.js.map +2 -2
- package/client/app.js +34 -17
- package/client/app.js.map +1 -1
- package/client/app.ts +31 -16
- package/package.json +3 -3
package/client/app.js
CHANGED
|
@@ -1490,14 +1490,25 @@ async function deleteSelectedMessages() {
|
|
|
1490
1490
|
return;
|
|
1491
1491
|
selected.push({ accountId: current.accountId, uid: current.message.uid, folderId: current.message.folderId });
|
|
1492
1492
|
}
|
|
1493
|
-
//
|
|
1494
|
-
//
|
|
1495
|
-
//
|
|
1496
|
-
//
|
|
1497
|
-
|
|
1498
|
-
//
|
|
1499
|
-
|
|
1500
|
-
|
|
1493
|
+
// Deleting a message that is ALREADY in Trash is a PERMANENT expunge, not
|
|
1494
|
+
// a move — the service's trashMessage returns "expunged" in that case. So
|
|
1495
|
+
// the prompt and the undo promise must change: permanent delete always
|
|
1496
|
+
// confirms (even a single message) and can't be undone (Bob 2026-06-12).
|
|
1497
|
+
const inTrash = currentFolderSpecialUse === "trash";
|
|
1498
|
+
// SAFETY GATE.
|
|
1499
|
+
// - In Trash: any delete is permanent → always confirm, warn it's final.
|
|
1500
|
+
// - Elsewhere: a single delete is instant (quick triage); a BULK delete
|
|
1501
|
+
// confirms, because `Ctrl+A` selects every visible row and in All
|
|
1502
|
+
// Inboxes that's a scattered screenful — exactly what silently trashed
|
|
1503
|
+
// 114 of Bob's messages on 2026-06-12.
|
|
1504
|
+
const n = selected.length;
|
|
1505
|
+
if (inTrash) {
|
|
1506
|
+
if (!confirm(`Permanently delete ${n} message${n === 1 ? "" : "s"} from Trash?\n\nThis cannot be undone.`)) {
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
else if (n > 1) {
|
|
1511
|
+
if (!confirm(`Move ${n} messages to Trash?\n\n(Ctrl+Z restores them if this was a mistake.)`)) {
|
|
1501
1512
|
return;
|
|
1502
1513
|
}
|
|
1503
1514
|
}
|
|
@@ -1510,15 +1521,21 @@ async function deleteSelectedMessages() {
|
|
|
1510
1521
|
// re-populates the row and the catch block surfaces the error.
|
|
1511
1522
|
const snapshot = [...selected];
|
|
1512
1523
|
removeMessagesAndReconcile(selected);
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1524
|
+
if (inTrash) {
|
|
1525
|
+
// Permanent — no undo entry (there's nothing to restore to).
|
|
1526
|
+
if (statusSync)
|
|
1527
|
+
statusSync.textContent = `Permanently deleted ${n} message${n === 1 ? "" : "s"}`;
|
|
1528
|
+
}
|
|
1529
|
+
else {
|
|
1530
|
+
// Undo restores the WHOLE batch, not just the first message — a bulk
|
|
1531
|
+
// delete must be fully recoverable via Ctrl+Z (the old single-slot undo
|
|
1532
|
+
// left the other N-1 unrecoverable; Bob 2026-06-12).
|
|
1533
|
+
pushUndo({ kind: "delete", at: Date.now(), payload: snapshot.map(m => ({ ...m, subject: "" })) });
|
|
1534
|
+
if (statusSync)
|
|
1535
|
+
statusSync.textContent = n === 1
|
|
1536
|
+
? `Trashed 1 message (syncing) — Ctrl+Z to undo`
|
|
1537
|
+
: `Trashed ${n} messages (syncing) — Ctrl+Z to undo`;
|
|
1538
|
+
}
|
|
1522
1539
|
// Fire-and-forget per local-first: optimistic remove above already
|
|
1523
1540
|
// updated the UI; the daemon-side trash is sync DB + queued IMAP.
|
|
1524
1541
|
// An IPC 120s timeout doesn't mean the trash failed — surfacing it
|