@bobfrankston/rmfmail 1.1.44 → 1.1.45

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.
@@ -2151,9 +2151,29 @@ function spawnDesktopPopout(msg, accountId) {
2151
2151
  wrapper.style.top = `${60 + existing * 28}px`;
2152
2152
  wrapper.style.right = `${20 + existing * 28}px`;
2153
2153
  }
2154
- void accountId;
2154
+ const toolbar = document.createElement("div");
2155
+ toolbar.style.cssText = "display:flex;gap:6px;padding:6px 12px;border-bottom:1px solid var(--color-border, #ddd);flex-shrink:0;";
2156
+ const mkPopoutBtn = (label, title, onClick) => {
2157
+ const b = document.createElement("button");
2158
+ b.textContent = label;
2159
+ b.title = title;
2160
+ b.style.cssText = "padding:4px 10px;font-size:13px;cursor:pointer;border:1px solid var(--color-border, #ccc);border-radius:4px;background:var(--color-bg, #fff);color:var(--color-text, #000);";
2161
+ b.addEventListener("click", onClick);
2162
+ return b;
2163
+ };
2164
+ const firePopoutAction = (action) => {
2165
+ document.dispatchEvent(new CustomEvent("mailx-popout-action", { detail: { action, msg, accountId } }));
2166
+ };
2167
+ toolbar.appendChild(mkPopoutBtn("Reply", "Reply", () => firePopoutAction("reply")));
2168
+ toolbar.appendChild(mkPopoutBtn("Reply All", "Reply to all", () => firePopoutAction("replyAll")));
2169
+ toolbar.appendChild(mkPopoutBtn("Forward", "Forward", () => firePopoutAction("forward")));
2170
+ toolbar.appendChild(mkPopoutBtn("Delete", "Delete this message", () => {
2171
+ firePopoutAction("delete");
2172
+ wrapper.remove();
2173
+ }));
2155
2174
  wrapper.appendChild(titleBar);
2156
2175
  wrapper.appendChild(headerInfo);
2176
+ wrapper.appendChild(toolbar);
2157
2177
  wrapper.appendChild(bodyContainer);
2158
2178
  document.body.appendChild(wrapper);
2159
2179
  }
@@ -6768,9 +6788,9 @@ document.getElementById("btn-factory-reset")?.addEventListener("click", async ()
6768
6788
  location.reload();
6769
6789
  }
6770
6790
  });
6771
- async function openCompose(mode) {
6791
+ async function openCompose(mode, overrideMsg, overrideAccountId) {
6772
6792
  logClientEvent("openCompose-entry", { mode });
6773
- const current = getCurrentMessage();
6793
+ const current = overrideMsg ? { message: overrideMsg, accountId: overrideAccountId || currentAccountId3 } : getCurrentMessage();
6774
6794
  if ((mode === "reply" || mode === "replyAll" || mode === "forward") && !current) {
6775
6795
  console.warn(`[compose] ${mode} \u2014 no message selected`);
6776
6796
  return;
@@ -9661,6 +9681,15 @@ function renderDiagnosticsBadge(snapshot) {
9661
9681
 
9662
9682
  ${detail}`;
9663
9683
  }
9684
+ document.addEventListener("mailx-popout-action", ((e) => {
9685
+ const { action, msg, accountId } = e.detail || {};
9686
+ if (!msg) return;
9687
+ if (action === "reply" || action === "replyAll" || action === "forward") {
9688
+ openCompose(action, msg, accountId);
9689
+ } else if (action === "delete") {
9690
+ deleteMessage(accountId, msg.uid).catch((err) => console.error(`[popout] delete failed: ${err?.message || err}`));
9691
+ }
9692
+ }));
9664
9693
  document.addEventListener("mailx-popout-message", (async (e) => {
9665
9694
  const { accountId, uid, folderId, subject } = e.detail || {};
9666
9695
  if (!accountId || !uid) return;