@bobfrankston/rmfmail 1.2.324 → 1.2.326

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
@@ -3532,8 +3532,20 @@ onWsEvent((event) => {
3532
3532
  if (statusSync.textContent === `${event.filename} updated`) statusSync.textContent = "";
3533
3533
  }, 8000);
3534
3534
  }
3535
+ // 2026-09-13 17:20 EDT — Claude Code (Fable 5.1), at Bob's direction.
3536
+ // The daemon now reconciles accounts.jsonc itself (new accounts are
3537
+ // added live) and says whether a restart is still needed. The
3538
+ // Restart banner was firing for the daemon's own repair of a
3539
+ // crash-zeroed cache from the cloud copy, seconds after launch.
3535
3540
  if (event.filename && /accounts\.jsonc/i.test(String(event.filename))) {
3536
- showRestartForConfigBanner();
3541
+ if (event.restartNeeded) {
3542
+ showRestartForConfigBanner();
3543
+ } else if (event.detail && statusSync) {
3544
+ statusSync.textContent = String(event.detail);
3545
+ setTimeout(() => {
3546
+ if (statusSync.textContent === String(event.detail)) statusSync.textContent = "";
3547
+ }, 8000);
3548
+ }
3537
3549
  }
3538
3550
  break;
3539
3551
  case "cloudError":
@@ -5324,32 +5324,43 @@ async function createTinyMceEditor2(container2, opts = {}) {
5324
5324
  const body = native?.getBody?.();
5325
5325
  if (native && body) {
5326
5326
  wireMarkdownPaste(body, (html) => native.insertContent(html));
5327
- stepCaretOutOfPastedLink(native);
5327
+ keepTypingOutsideLinks(native);
5328
5328
  }
5329
5329
  } catch {
5330
5330
  }
5331
5331
  return ed;
5332
5332
  }
5333
- function stepCaretOutOfPastedLink(native) {
5334
- native.on("paste", () => {
5335
- setTimeout(() => {
5336
- try {
5337
- const rng = native.selection.getRng();
5338
- if (!rng || !rng.collapsed)
5339
- return;
5340
- const node = native.selection.getNode();
5341
- const a = node?.closest?.("a[href]");
5342
- if (!a)
5343
- return;
5344
- const rest = rng.cloneRange();
5345
- rest.setEnd(a, a.childNodes.length);
5346
- if (rest.toString().trim())
5347
- return;
5333
+ function keepTypingOutsideLinks(native) {
5334
+ const isBlank = (s) => !s.replace(/\uFEFF/g, "").trim();
5335
+ const stepOutOfLinkEdge = () => {
5336
+ try {
5337
+ const rng = native.selection.getRng();
5338
+ if (!rng || !rng.collapsed)
5339
+ return;
5340
+ const node = native.selection.getNode();
5341
+ const a = node?.closest?.("a[href]");
5342
+ if (!a)
5343
+ return;
5344
+ const toEnd = rng.cloneRange();
5345
+ toEnd.setEnd(a, a.childNodes.length);
5346
+ const fromStart = rng.cloneRange();
5347
+ fromStart.setStart(a, 0);
5348
+ if (isBlank(toEnd.toString())) {
5348
5349
  native.selection.setCursorLocation(a.parentNode, native.dom.nodeIndex(a) + 1);
5349
- } catch (e) {
5350
- console.warn("[editor] could not move the caret past the pasted link:", e?.message || e);
5350
+ } else if (isBlank(fromStart.toString())) {
5351
+ native.selection.setCursorLocation(a.parentNode, native.dom.nodeIndex(a));
5351
5352
  }
5352
- }, 0);
5353
+ } catch (e) {
5354
+ console.warn("[editor] could not move the caret off the link edge:", e?.message || e);
5355
+ }
5356
+ };
5357
+ native.on("paste", () => {
5358
+ setTimeout(stepOutOfLinkEdge, 0);
5359
+ });
5360
+ native.on("keydown", (e) => {
5361
+ if (e.ctrlKey || e.metaKey || e.altKey || e.key.length !== 1)
5362
+ return;
5363
+ stepOutOfLinkEdge();
5353
5364
  });
5354
5365
  }
5355
5366