@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.ts CHANGED
@@ -1466,14 +1466,25 @@ async function deleteSelectedMessages(): Promise<void> {
1466
1466
  selected.push({ accountId: current.accountId, uid: current.message.uid, folderId: current.message.folderId });
1467
1467
  }
1468
1468
 
1469
- // SAFETY GATE: confirm before a BULK delete. `Ctrl+A` selects every
1470
- // visible row, and in the "All Inboxes" view that's a scattered screenful
1471
- // across accounts so a single Ctrl+A then Delete could silently trash
1472
- // dozens of messages with no prompt. That is exactly what trashed 114 of
1473
- // Bob's messages on 2026-06-12. A single-message delete (the common quick-
1474
- // triage case) stays instant; anything larger must be confirmed.
1475
- if (selected.length > 1) {
1476
- if (!confirm(`Move ${selected.length} messages to Trash?\n\n(Ctrl+Z restores them if this was a mistake.)`)) {
1469
+ // Deleting a message that is ALREADY in Trash is a PERMANENT expunge, not
1470
+ // a move the service's trashMessage returns "expunged" in that case. So
1471
+ // the prompt and the undo promise must change: permanent delete always
1472
+ // confirms (even a single message) and can't be undone (Bob 2026-06-12).
1473
+ const inTrash = currentFolderSpecialUse === "trash";
1474
+
1475
+ // SAFETY GATE.
1476
+ // - In Trash: any delete is permanent always confirm, warn it's final.
1477
+ // - Elsewhere: a single delete is instant (quick triage); a BULK delete
1478
+ // confirms, because `Ctrl+A` selects every visible row and in All
1479
+ // Inboxes that's a scattered screenful — exactly what silently trashed
1480
+ // 114 of Bob's messages on 2026-06-12.
1481
+ const n = selected.length;
1482
+ if (inTrash) {
1483
+ if (!confirm(`Permanently delete ${n} message${n === 1 ? "" : "s"} from Trash?\n\nThis cannot be undone.`)) {
1484
+ return;
1485
+ }
1486
+ } else if (n > 1) {
1487
+ if (!confirm(`Move ${n} messages to Trash?\n\n(Ctrl+Z restores them if this was a mistake.)`)) {
1477
1488
  return;
1478
1489
  }
1479
1490
  }
@@ -1489,14 +1500,18 @@ async function deleteSelectedMessages(): Promise<void> {
1489
1500
  const snapshot = [...selected];
1490
1501
  removeMessagesAndReconcile(selected);
1491
1502
 
1492
- // Undo restores the WHOLE batch, not just the first message — a bulk
1493
- // delete must be fully recoverable via Ctrl+Z (the old single-slot undo
1494
- // left the other N-1 unrecoverable, which made an accidental mass-delete
1495
- // unrecoverable; Bob 2026-06-12).
1496
- pushUndo({ kind: "delete", at: Date.now(), payload: snapshot.map(m => ({ ...m, subject: "" })) });
1497
- if (statusSync) statusSync.textContent = snapshot.length === 1
1498
- ? `Trashed 1 message (syncing) Ctrl+Z to undo`
1499
- : `Trashed ${snapshot.length} messages (syncing) Ctrl+Z to undo`;
1503
+ if (inTrash) {
1504
+ // Permanent no undo entry (there's nothing to restore to).
1505
+ if (statusSync) statusSync.textContent = `Permanently deleted ${n} message${n === 1 ? "" : "s"}`;
1506
+ } else {
1507
+ // Undo restores the WHOLE batch, not just the first message a bulk
1508
+ // delete must be fully recoverable via Ctrl+Z (the old single-slot undo
1509
+ // left the other N-1 unrecoverable; Bob 2026-06-12).
1510
+ pushUndo({ kind: "delete", at: Date.now(), payload: snapshot.map(m => ({ ...m, subject: "" })) });
1511
+ if (statusSync) statusSync.textContent = n === 1
1512
+ ? `Trashed 1 message (syncing) — Ctrl+Z to undo`
1513
+ : `Trashed ${n} messages (syncing) — Ctrl+Z to undo`;
1514
+ }
1500
1515
 
1501
1516
  // Fire-and-forget per local-first: optimistic remove above already
1502
1517
  // updated the UI; the daemon-side trash is sync DB + queued IMAP.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/rmfmail",
3
- "version": "1.1.245",
3
+ "version": "1.1.246",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@bobfrankston/iflow-direct": "^0.1.53",
40
40
  "@bobfrankston/mailx-host": "^0.1.13",
41
- "@bobfrankston/mailx-imap": "^0.1.89",
41
+ "@bobfrankston/mailx-imap": "^0.1.90",
42
42
  "@bobfrankston/mailx-store-web": "^0.1.27",
43
43
  "@bobfrankston/mailx-sync": "^0.1.22",
44
44
  "@bobfrankston/miscinfo": "^1.0.13",
@@ -118,7 +118,7 @@
118
118
  "dependencies": {
119
119
  "@bobfrankston/iflow-direct": "^0.1.53",
120
120
  "@bobfrankston/mailx-host": "^0.1.13",
121
- "@bobfrankston/mailx-imap": "^0.1.89",
121
+ "@bobfrankston/mailx-imap": "^0.1.90",
122
122
  "@bobfrankston/mailx-store-web": "^0.1.27",
123
123
  "@bobfrankston/mailx-sync": "^0.1.22",
124
124
  "@bobfrankston/miscinfo": "^1.0.13",