@bobfrankston/rmfmail 1.2.335 → 1.2.337

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.
@@ -4809,6 +4809,7 @@ __export(message_list_exports, {
4809
4809
  removeMessagesAndReconcile: () => removeMessagesAndReconcile,
4810
4810
  revealMessage: () => revealMessage,
4811
4811
  scrollFocusedIntoView: () => scrollFocusedIntoView,
4812
+ selectAllMessages: () => selectAllMessages,
4812
4813
  selectAllVisible: () => selectAllVisible,
4813
4814
  setDateBasis: () => setDateBasis,
4814
4815
  setLiveFilter: () => setLiveFilter,
@@ -4834,6 +4835,11 @@ function applyLiveFilter(body) {
4834
4835
  row.classList.toggle("filter-hidden", !text.includes(liveFilterText));
4835
4836
  }
4836
4837
  }
4838
+ function currentSearchPagingScope() {
4839
+ if (currentSearchScope !== "server")
4840
+ return currentSearchScope;
4841
+ return currentSearchFolderId ? "current" : "all";
4842
+ }
4837
4843
  function emptyListMessage() {
4838
4844
  if (searchMode && currentSearchQuery) {
4839
4845
  return `No messages found by "${escapeHtmlText(currentSearchQuery)}"`;
@@ -5245,6 +5251,29 @@ function selectAllVisible() {
5245
5251
  body.querySelectorAll(".ml-row:not(.filter-hidden)").forEach((r) => r.classList.add("selected"));
5246
5252
  updateBulkBar();
5247
5253
  }
5254
+ async function selectAllMessages() {
5255
+ const body = document.getElementById("ml-body");
5256
+ if (!body)
5257
+ return;
5258
+ const status = document.getElementById("status-sync");
5259
+ let guard = 0;
5260
+ while (currentPage * 50 < totalMessages && guard++ < 1e4) {
5261
+ if (loading) {
5262
+ await new Promise((r) => setTimeout(r, 50));
5263
+ continue;
5264
+ }
5265
+ const before = body.querySelectorAll(".ml-row").length;
5266
+ if (status)
5267
+ status.textContent = `Loading all ${totalMessages} messages to select them\u2026 ${before} so far`;
5268
+ await loadMoreMessages();
5269
+ if (body.querySelectorAll(".ml-row").length === before)
5270
+ break;
5271
+ }
5272
+ selectAllVisible();
5273
+ const n = body.querySelectorAll(".ml-row.selected").length;
5274
+ if (status)
5275
+ status.textContent = `Selected ${n} message${n === 1 ? "" : "s"}`;
5276
+ }
5248
5277
  function selectRange(from, to) {
5249
5278
  const body = document.getElementById("ml-body");
5250
5279
  if (!body)
@@ -5495,6 +5524,10 @@ async function loadSearchResults(query, scope = "all", accountId = "", folderId
5495
5524
  liveFilterText = "";
5496
5525
  unifiedMode = false;
5497
5526
  currentSearchQuery = query;
5527
+ currentSearchScope = scope;
5528
+ currentSearchAccountId = accountId;
5529
+ currentSearchFolderId = folderId;
5530
+ currentSearchIncludeTrash = includeTrashSpam;
5498
5531
  currentPage = 1;
5499
5532
  totalMessages = 0;
5500
5533
  const body = document.getElementById("ml-body");
@@ -5719,7 +5752,7 @@ async function loadMoreMessages() {
5719
5752
  const rowsBefore = body.querySelectorAll(".ml-row").length;
5720
5753
  try {
5721
5754
  const flaggedOnly = body.classList.contains("flagged-only");
5722
- const result = searchMode ? await searchMessages(currentSearchQuery, currentPage) : unifiedMode ? await getUnifiedInbox(currentPage, 50, flaggedOnly, dateBasis) : await getMessages(currentAccountId2, currentFolderId, currentPage, 50, flaggedOnly, currentSort, currentSortDir, dateBasis);
5755
+ const result = searchMode ? await searchMessages(currentSearchQuery, currentPage, 50, currentSearchPagingScope(), currentSearchAccountId, currentSearchFolderId, currentSearchIncludeTrash) : unifiedMode ? await getUnifiedInbox(currentPage, 50, flaggedOnly, dateBasis) : await getMessages(currentAccountId2, currentFolderId, currentPage, 50, flaggedOnly, currentSort, currentSortDir, dateBasis);
5723
5756
  const current = getMessages2();
5724
5757
  setMessages([...current, ...result.items]);
5725
5758
  appendMessages(body, unifiedMode ? "" : currentAccountId2, result.items);
@@ -5958,7 +5991,7 @@ function escapeHtml4(s) {
5958
5991
  div.textContent = s;
5959
5992
  return div.innerHTML;
5960
5993
  }
5961
- var onMessageSelect, currentAccountId2, currentFolderId, currentSpecialUse, lastClickedRow, currentPage, totalMessages, loading, MAX_REFRESH_PAGES, unifiedMode, searchMode, liveFilterText, currentSearchQuery, wasUnifiedBeforeSearch, showToInsteadOfFrom, touchWasScroll, lastPointerWasTouch, currentSort, currentSortDir, dateBasis, loadGen, listCache, CACHE_KEY_UNIFIED, positionMemory, POSITION_STORAGE_KEY, focusedRow, rowByKey, prioritySenders, priorityDomains, timeFmt, dateFmt, dateFmtSameYear, MessageRow;
5994
+ var onMessageSelect, currentAccountId2, currentFolderId, currentSpecialUse, lastClickedRow, currentPage, totalMessages, loading, MAX_REFRESH_PAGES, unifiedMode, searchMode, liveFilterText, currentSearchQuery, currentSearchScope, currentSearchAccountId, currentSearchFolderId, currentSearchIncludeTrash, wasUnifiedBeforeSearch, showToInsteadOfFrom, touchWasScroll, lastPointerWasTouch, currentSort, currentSortDir, dateBasis, loadGen, listCache, CACHE_KEY_UNIFIED, positionMemory, POSITION_STORAGE_KEY, focusedRow, rowByKey, prioritySenders, priorityDomains, timeFmt, dateFmt, dateFmtSameYear, MessageRow;
5962
5995
  var init_message_list = __esm({
5963
5996
  "client/components/message-list.js"() {
5964
5997
  "use strict";
@@ -5978,6 +6011,10 @@ var init_message_list = __esm({
5978
6011
  searchMode = false;
5979
6012
  liveFilterText = "";
5980
6013
  currentSearchQuery = "";
6014
+ currentSearchScope = "all";
6015
+ currentSearchAccountId = "";
6016
+ currentSearchFolderId = 0;
6017
+ currentSearchIncludeTrash = false;
5981
6018
  wasUnifiedBeforeSearch = false;
5982
6019
  showToInsteadOfFrom = false;
5983
6020
  touchWasScroll = false;
@@ -6262,15 +6299,10 @@ var init_message_list = __esm({
6262
6299
  const selectedCount = body ? body.querySelectorAll(".ml-row.selected").length : 0;
6263
6300
  showMenu(e.clientX, e.clientY, [
6264
6301
  {
6265
- label: `Select all (${visibleRows.length})`,
6302
+ // Total in the view, not rows loaded so far (2026-09-16).
6303
+ label: `Select all (${Math.max(totalMessages || 0, visibleRows.length)})`,
6266
6304
  action: () => {
6267
- if (!body)
6268
- return;
6269
- body.classList.add("multi-select-on");
6270
- for (const r of visibleRows)
6271
- r.classList.add("selected");
6272
- lastClickedRow = visibleRows[visibleRows.length - 1] || null;
6273
- updateBulkBar();
6305
+ void selectAllMessages();
6274
6306
  },
6275
6307
  disabled: visibleRows.length === 0
6276
6308
  },
@@ -8900,8 +8932,11 @@ function renderNode(node, container, depth, forceExpand) {
8900
8932
  const treeContainer = document.getElementById("folder-tree");
8901
8933
  if (treeContainer)
8902
8934
  loadFolderTree(treeContainer);
8935
+ const status = document.getElementById("status-sync");
8936
+ if (status)
8937
+ status.textContent = `Emptied ${node.name} locally \u2014 deleting on the server in the background`;
8903
8938
  } catch (err) {
8904
- alert(`Failed: ${err.message}`);
8939
+ alert(`Failed to empty ${node.name}: ${err.message}`);
8905
8940
  }
8906
8941
  } });
8907
8942
  }
@@ -11621,7 +11656,8 @@ function doSearch(immediate = false) {
11621
11656
  if (serverOn) {
11622
11657
  serverSearchTimer = setTimeout(() => {
11623
11658
  serverSearchTimer = null;
11624
- loadSearchResults(query, "server", currentAccountId3, currentFolderId2, includeTrash);
11659
+ const serverFolderId = localScopeEff === "current" ? currentFolderId2 : 0;
11660
+ loadSearchResults(query, "server", currentAccountId3, serverFolderId, includeTrash);
11625
11661
  }, SERVER_SEARCH_DALLY_MS);
11626
11662
  }
11627
11663
  }
@@ -12436,7 +12472,7 @@ document.addEventListener("keydown", (e) => {
12436
12472
  const mlBody = document.getElementById("ml-body");
12437
12473
  if (mlBody) {
12438
12474
  e.preventDefault();
12439
- selectAllVisible();
12475
+ void selectAllMessages();
12440
12476
  }
12441
12477
  }
12442
12478
  if (e.ctrlKey && e.key === "d" || e.key === "Delete") {