@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.
package/client/app.js CHANGED
@@ -7,7 +7,7 @@ import { initMessageList, loadMessages, loadUnifiedInbox, loadSearchResults, rel
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
9
  import { getCurrentMessage, initViewer, popOutCurrentMessage, toggleFullscreenPreview, showPreviewBodyMenu, wrapHtmlBody } from "./components/message-viewer.js";
10
- import { connectWebSocket, onWsEvent, triggerSync, syncAccount, reauthenticate, getAccounts, getFolders, deleteMessages, undeleteMessage, restartServer, getSyncPending, getVersion, getSettings, saveSettings, getAutocompleteSettings, saveAutocompleteSettings, repairAccounts, updateFlags, markAsSpamMessages, logClientEvent, sendMessage as apiSendMessage, subscribeStore } from "./lib/api-client.js";
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 } from "./lib/api-client.js";
11
11
  import * as messageState from "./lib/message-state.js";
12
12
  // ── New message badge (favicon + title) ──
13
13
  /** The user-visible app name. Single point of change for the rename;
@@ -784,9 +784,14 @@ document.getElementById("btn-factory-reset")?.addEventListener("click", async ()
784
784
  location.reload();
785
785
  }
786
786
  });
787
- async function openCompose(mode) {
787
+ async function openCompose(mode, overrideMsg, overrideAccountId) {
788
788
  logClientEvent("openCompose-entry", { mode });
789
- const current = getCurrentMessage();
789
+ // `overrideMsg` lets a detached surface (the message pop-out) compose a
790
+ // reply/forward for ITS message rather than whatever the main viewer has
791
+ // selected. Same `{ message, accountId }` shape getCurrentMessage returns.
792
+ const current = overrideMsg
793
+ ? { message: overrideMsg, accountId: overrideAccountId || currentAccountId }
794
+ : getCurrentMessage();
790
795
  // Local-first: if the row is selected we already have its headers in the
791
796
  // local DB. Populate the compose form unconditionally; the user can edit
792
797
  // anything missing. Don't show "still loading" alerts — the message IS
@@ -4592,6 +4597,21 @@ function renderDiagnosticsBadge(snapshot) {
4592
4597
  host.title = `Connection issues — ${summary}\n\n${detail}`;
4593
4598
  }
4594
4599
  // Q64: pop-out a message into a floating overlay (real-OS-window pending C44).
4600
+ // Action buttons on the message pop-out window — Reply / Reply All / Forward
4601
+ // act on the popped-out message specifically (not the main viewer's), Delete
4602
+ // removes it. The pop-out lives in message-viewer.ts and can't import
4603
+ // openCompose directly, so it fires this event.
4604
+ document.addEventListener("mailx-popout-action", ((e) => {
4605
+ const { action, msg, accountId } = e.detail || {};
4606
+ if (!msg)
4607
+ return;
4608
+ if (action === "reply" || action === "replyAll" || action === "forward") {
4609
+ openCompose(action, msg, accountId);
4610
+ }
4611
+ else if (action === "delete") {
4612
+ deleteMessage(accountId, msg.uid).catch((err) => console.error(`[popout] delete failed: ${err?.message || err}`));
4613
+ }
4614
+ }));
4595
4615
  document.addEventListener("mailx-popout-message", (async (e) => {
4596
4616
  const { accountId, uid, folderId, subject } = e.detail || {};
4597
4617
  if (!accountId || !uid)