@bobfrankston/rmfmail 1.2.259 → 1.2.261

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.js CHANGED
@@ -6,7 +6,7 @@ import { initFolderTree, refreshFolderTree, updateFolderCounts, setFolderSynced,
6
6
  import { initMessageList, loadMessages, loadUnifiedInbox, loadSearchResults, reloadCurrentFolder, clearSearchMode, getSelectedMessages, markBodiesCached, getCurrentFocused, releaseFocus, removeMessagesAndReconcile, setRowFlagged, scrollFocusedIntoView, refreshPriorityIndex, revealMessage, getCurrentView, selectAllVisible, exitMultiSelect, getDateBasis, setDateBasis } from "./components/message-list.js";
7
7
  import { seenOf, flaggedOf, draftOf, setSeen, setFlagged } from "@bobfrankston/mailx-types";
8
8
  import { initTabs, setActiveView as setActiveTabView, openTab } from "./components/tabs.js";
9
- import { getCurrentMessage, initViewer, popOutCurrentMessage, popOutToWindow, printCurrentMessage, toggleFullscreenPreview, showPreviewBodyMenu } from "./components/message-viewer.js";
9
+ import { getCurrentMessage, initViewer, popOutCurrentMessage, popOutToWindow, printCurrentMessage, toggleFullscreenPreview, showPreviewBodyMenu, setSearchHighlightTerms, parseHighlightTerms } from "./components/message-viewer.js";
10
10
  import { connectWebSocket, onWsEvent, triggerSync, syncAccount, reauthenticate, getAccounts, getFolders, deleteMessage, deleteMessages, undeleteMessage, restartServer, getSyncPending, getVersion, getSettings, saveSettings, getAutocompleteSettings, saveAutocompleteSettings, repairAccounts, updateFlags, markAsSpamMessages, logClientEvent, sendMessage as apiSendMessage, subscribeStore, cancelServerSearch, installConsoleCapture, getAttachment } from "./lib/api-client.js";
11
11
  import * as messageState from "./lib/message-state.js";
12
12
  import { editMenuItems } from "./components/edit-menu.js";
@@ -2772,6 +2772,12 @@ function renderSearchHighlight(settled) {
2772
2772
  }
2773
2773
  function updateSearchHighlight() {
2774
2774
  renderSearchHighlight(false);
2775
+ // The message-body marks track the same box. Doing it HERE rather than at
2776
+ // each caller means every path that touches the search input — typing,
2777
+ // clearing, folder switch, tab restore — keeps the viewer in step; there
2778
+ // is no way to add a fourth path that forgets. setSearchHighlightTerms
2779
+ // no-ops when the terms are unchanged, so this is free per keystroke.
2780
+ setSearchHighlightTerms(parseHighlightTerms(searchInput?.value || ""));
2775
2781
  if (searchRegexSettleTimer)
2776
2782
  clearTimeout(searchRegexSettleTimer);
2777
2783
  searchRegexSettleTimer = setTimeout(() => renderSearchHighlight(true), SEARCH_REGEX_SETTLE_MS);
@@ -2794,6 +2800,10 @@ const SERVER_SEARCH_DALLY_MS = 700;
2794
2800
  let serverSearchTimer = null;
2795
2801
  function doSearch(immediate = false) {
2796
2802
  const query = searchInput.value.trim();
2803
+ // Terms to mark in the open message. Set on EVERY doSearch — including the
2804
+ // empty-query exit below, which clears them (Bob 2026-08-15: "search should
2805
+ // highlight the matched text when I view a message").
2806
+ setSearchHighlightTerms(parseHighlightTerms(query));
2797
2807
  if (query.length === 0) {
2798
2808
  // Leaving search — ABORT any in-flight server sweep. A "Server" search is
2799
2809
  // a 90-folder IMAP run on the daemon; if it's still going when you clear