@bobfrankston/rmfmail 1.2.13 → 1.2.14

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
@@ -3429,16 +3429,33 @@ document.addEventListener("keydown", (e) => {
3429
3429
  // Bare R yields to text inputs; Ctrl+Q overrides them so it's reachable
3430
3430
  // from the search box or compose draft list.
3431
3431
  if (!e.ctrlKey && inText) return;
3432
+ e.preventDefault();
3433
+ const applySeen = (m: NonNullable<ReturnType<typeof getCurrentFocused>>, seen: boolean): void => {
3434
+ setSeen(m, seen);
3435
+ updateFlags(m.accountId, m.uid, m.flags).then(() => {
3436
+ messageState.updateMessageFlags(m.accountId, m.uid, m.flags);
3437
+ const row = document.querySelector(`.ml-row[data-uid="${m.uid}"][data-account-id="${CSS.escape(m.accountId)}"]`) as HTMLElement | null;
3438
+ if (row) row.classList.toggle("unread", !seen);
3439
+ }).catch(() => { setSeen(m, !seen); });
3440
+ };
3441
+ // getSelectedMessages returns only id tuples — resolve to the full
3442
+ // message objects (with flags) from the list state.
3443
+ const selectedIds = getSelectedMessages();
3444
+ if (selectedIds.length > 1) {
3445
+ // Multi-select → mark every selected message READ (not a toggle):
3446
+ // a triage sweep is "I've dealt with these," not "flip each one"
3447
+ // (Bob 2026-06-15). Skip those already read.
3448
+ const all = messageState.getMessages();
3449
+ for (const id of selectedIds) {
3450
+ const m = all.find(x => x.accountId === id.accountId && x.uid === id.uid && x.folderId === id.folderId);
3451
+ if (m && !seenOf(m)) applySeen(m, true);
3452
+ }
3453
+ return;
3454
+ }
3455
+ // Single → toggle read/unread.
3432
3456
  const sel = getCurrentFocused();
3433
3457
  if (!sel) return;
3434
- e.preventDefault();
3435
- const wasSeen = seenOf(sel);
3436
- setSeen(sel, !wasSeen);
3437
- updateFlags(sel.accountId, sel.uid, sel.flags).then(() => {
3438
- messageState.updateMessageFlags(sel.accountId, sel.uid, sel.flags);
3439
- const row = document.querySelector(`.ml-row[data-uid="${sel.uid}"][data-account-id="${sel.accountId}"]`) as HTMLElement;
3440
- if (row) row.classList.toggle("unread", wasSeen);
3441
- }).catch(() => { setSeen(sel, wasSeen); });
3458
+ applySeen(sel, !seenOf(sel));
3442
3459
  }
3443
3460
  // Z = locate the focused row in the list (scroll-to-selected). After
3444
3461
  // scrolling the list out of sync with the preview, this snaps back.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/rmfmail",
3
- "version": "1.2.13",
3
+ "version": "1.2.14",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",