@bobfrankston/rmfmail 1.2.220 → 1.2.222

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/bin/mailx.js CHANGED
@@ -178,6 +178,34 @@ const isDaemon = hasFlag("daemon"); // internal: re-spawned detached process
178
178
  process.exit(0);
179
179
  }
180
180
  }
181
+ /** App entries appended to the NATIVE right-click menu inside compose. msger
182
+ * keeps the WebView2 default menu (that is the only place spellcheck
183
+ * suggestions live) and gates these to editable targets, so they never show
184
+ * on the read-only list or message preview.
185
+ *
186
+ * Clipboard entries are ours rather than the browser's on purpose: Chromium
187
+ * OMITS Cut/Copy from the default menu when the caret is collapsed, and a
188
+ * right-click on a word is a collapsed caret — so the menu the user actually
189
+ * sees while editing has no Cut or Copy (Bob 2026-08-07). Ours expand to the
190
+ * word under the caret first, exactly like the formatting entries below
191
+ * already do, so "right-click a word → Copy" means what it looks like.
192
+ *
193
+ * Ids are dispatched to compose.ts via window.__msgerContextCommand — one
194
+ * list, both windows (in-window compose overlay + popout compose), because
195
+ * drift between the two is what produced "right mouse isn't showing any
196
+ * formatting options" in the first place (Bob 2026-07-18). */
197
+ const COMPOSE_CONTEXT_MENU_ITEMS = [
198
+ { id: "cut", label: "Cut" },
199
+ { id: "copy", label: "Copy" },
200
+ { id: "paste", label: "Paste" },
201
+ { id: "bold", label: "Bold" },
202
+ { id: "italic", label: "Italic" },
203
+ { id: "underline", label: "Underline" },
204
+ { id: "strike", label: "Strikethrough" },
205
+ { id: "link", label: "Link…" },
206
+ { id: "clear", label: "Clear formatting" },
207
+ { id: "source", label: "View HTML source…" },
208
+ ];
181
209
  /** Windows mailto: registration — registry keys via reg.exe. Shared by the
182
210
  * `-register-mailto` CLI flag and the Settings → "Make default email app"
183
211
  * menu action (injected into MailxService; the registry work stays HERE in
@@ -2509,15 +2537,7 @@ RFC 5322 with CRLF line endings. Bodies are quoted-printable encoded (readable i
2509
2537
  // App entries on the NATIVE right-click menu (native stays
2510
2538
  // so spellcheck suggestions survive). compose.ts maps ids
2511
2539
  // to editor commands via window.__msgerContextCommand.
2512
- contextMenuItems: [
2513
- { id: "bold", label: "Bold" },
2514
- { id: "italic", label: "Italic" },
2515
- { id: "underline", label: "Underline" },
2516
- { id: "strike", label: "Strikethrough" },
2517
- { id: "link", label: "Link…" },
2518
- { id: "clear", label: "Clear formatting" },
2519
- { id: "source", label: "View HTML source…" },
2520
- ],
2540
+ contextMenuItems: COMPOSE_CONTEXT_MENU_ITEMS,
2521
2541
  });
2522
2542
  popoutWindows.set(key, h);
2523
2543
  if (typeof h.pid === "number")
@@ -2653,15 +2673,7 @@ RFC 5322 with CRLF line endings. Bodies are quoted-printable encoded (readable i
2653
2673
  // "right mouse isn't showing any formatting options let alone source").
2654
2674
  // msger gates these to editable targets, so they DON'T appear on
2655
2675
  // right-clicks in the read-only list / message preview.
2656
- contextMenuItems: [
2657
- { id: "bold", label: "Bold" },
2658
- { id: "italic", label: "Italic" },
2659
- { id: "underline", label: "Underline" },
2660
- { id: "strike", label: "Strikethrough" },
2661
- { id: "link", label: "Link…" },
2662
- { id: "clear", label: "Clear formatting" },
2663
- { id: "source", label: "View HTML source…" },
2664
- ],
2676
+ contextMenuItems: COMPOSE_CONTEXT_MENU_ITEMS,
2665
2677
  });
2666
2678
  // Late-bind the popout-action forwarder now that the main window's
2667
2679
  // service channel exists.
@@ -2905,10 +2917,22 @@ RFC 5322 with CRLF line endings. Bodies are quoted-printable encoded (readable i
2905
2917
  // and emits this when Word writes; compose.ts listens and reloads Quill.
2906
2918
  imapManager.on("wordEditUpdated", (payload) => {
2907
2919
  handle.send({ _event: "wordEditUpdated", type: "wordEditUpdated", ...payload });
2908
- // Bring compose back to the front after a Word save — the service's
2909
- // old mailx-host focusMainWindow call was a silent no-op (the helper
2910
- // never existed); this native msger command is the real mechanism.
2911
- handle.send({ _msgerWindow: "focus" });
2920
+ // Deliberately NO { _msgerWindow: "focus" } here. The autosave sidecar
2921
+ // saves every ~2s while the user types, and each save lands in this
2922
+ // handler so this line pulled the foreground off Word mid-sentence,
2923
+ // every couple of seconds, for the whole editing session (Bob
2924
+ // 2026-08-06: "keeps flipping back to rmfmail on any change"). The
2925
+ // focus now happens once, on wordEditClosed, below.
2926
+ });
2927
+ // Word (or the document) closed — the external edit is over. THIS is the
2928
+ // moment to bring rmfmail forward, replacing the old per-save focus grab.
2929
+ imapManager.on("wordEditClosed", (payload) => {
2930
+ handle.send({ _event: "wordEditClosed", type: "wordEditClosed", ...payload });
2931
+ // Only raise the MAIN window when the compose lives IN it. A popout
2932
+ // compose is a separate window with no service channel, so focusing
2933
+ // main would just cover it up.
2934
+ if (!payload.fromPopout)
2935
+ handle.send({ _msgerWindow: "focus" });
2912
2936
  });
2913
2937
  // Cloud-write/read failures from mailx-settings → push to UI as a banner so
2914
2938
  // silent fall-back-to-local can no longer swallow Drive errors.