@bobfrankston/rmfmail 1.1.88 → 1.1.89

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
@@ -1836,8 +1836,11 @@ function recordSearchHistory(query: string): void {
1836
1836
  const trimmed = query.trim();
1837
1837
  if (!trimmed) return;
1838
1838
  const cur = loadSearchHistory();
1839
- // Move-to-front dedup: if already there, pull it; then prepend.
1840
- const filtered = cur.filter(q => q !== trimmed);
1839
+ // Move-to-front dedup, AND drop any entry that is a prefix of this
1840
+ // query that collapses the in-progress typing ("Hod", "Hodd") into
1841
+ // the final "Hoddie", so a live search the user never pressed Enter on
1842
+ // still lands in history exactly once.
1843
+ const filtered = cur.filter(q => q !== trimmed && !trimmed.startsWith(q));
1841
1844
  filtered.unshift(trimmed);
1842
1845
  if (filtered.length > SEARCH_HISTORY_MAX) filtered.length = SEARCH_HISTORY_MAX;
1843
1846
  saveSearchHistory(filtered);
@@ -1950,9 +1953,11 @@ function doSearch(immediate = false): void {
1950
1953
  { kind: "search", query, scope: effectiveScope, accountId: currentAccountId, folderId: currentFolderId, includeTrash },
1951
1954
  `Search: ${query}`,
1952
1955
  );
1953
- // Only record on `immediate=true` (Enter / scope change) debounced
1954
- // typing would otherwise add every keystroke as its own entry.
1955
- if (immediate) recordSearchHistory(query);
1956
+ // Record every executed search Enter AND a settled debounced search
1957
+ // alike. The prefix-pruning in recordSearchHistory() collapses the
1958
+ // keystroke progression, so a search the user typed without pressing
1959
+ // Enter ("Hoddie") still shows up in history.
1960
+ recordSearchHistory(query);
1956
1961
  }
1957
1962
 
1958
1963
  // Track current folder for scoped search
@@ -2221,6 +2221,22 @@ function wireSpellcheck(editor2) {
2221
2221
  if (editor2.__mailxSpellWired)
2222
2222
  return;
2223
2223
  editor2.__mailxSpellWired = true;
2224
+ const killNativeSpellcheck = () => {
2225
+ try {
2226
+ const body = editor2.getBody?.();
2227
+ if (body && body.getAttribute("spellcheck") !== "false") {
2228
+ body.setAttribute("spellcheck", "false");
2229
+ }
2230
+ } catch {
2231
+ }
2232
+ };
2233
+ killNativeSpellcheck();
2234
+ try {
2235
+ const body = editor2.getBody?.();
2236
+ if (body)
2237
+ new MutationObserver(killNativeSpellcheck).observe(body, { attributes: true, attributeFilter: ["spellcheck"] });
2238
+ } catch {
2239
+ }
2224
2240
  let sp = null;
2225
2241
  let decorateTimer = null;
2226
2242
  const scheduleDecorate = () => {