@bobfrankston/rmfmail 1.0.488 → 1.0.490

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
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { initFolderTree, refreshFolderTree, updateFolderCounts, setFolderSynced, getFolderSynced, setOutboxTotal } from "./components/folder-tree.js";
6
6
  import { initMessageList, loadMessages, loadUnifiedInbox, loadSearchResults, reloadCurrentFolder, clearSearchMode, getSelectedMessages, markBodiesCached, getCurrentFocused, releaseFocus, removeMessagesAndReconcile, setRowFlagged, scrollFocusedIntoView } from "./components/message-list.js";
7
- import { showMessage, getCurrentMessage, initViewer, popOutCurrentMessage } from "./components/message-viewer.js";
7
+ import { showMessage, getCurrentMessage, initViewer, popOutCurrentMessage, toggleFullscreenPreview } from "./components/message-viewer.js";
8
8
  import { connectWebSocket, onWsEvent, triggerSync, syncAccount, reauthenticate, getAccounts, getFolders, deleteMessages, undeleteMessage, restartServer, getSyncPending, getVersion, getSettings, saveSettings, getAutocompleteSettings, saveAutocompleteSettings, repairAccounts, updateFlags, markAsSpamMessages, logClientEvent, sendMessage as apiSendMessage } from "./lib/api-client.js";
9
9
  import * as messageState from "./lib/message-state.js";
10
10
  // ── New message badge (favicon + title) ──
@@ -2256,6 +2256,18 @@ document.addEventListener("keydown", (e) => {
2256
2256
  }
2257
2257
  }
2258
2258
  });
2259
+ // ── Double-click viewer chrome → fullscreen preview ──
2260
+ // The iframe's own contentDocument has its own dblclick handler (in
2261
+ // message-viewer.ts). This catches dblclicks on the headers / from row /
2262
+ // reply-to row of the viewer that aren't inside the iframe.
2263
+ document.getElementById("message-viewer")?.addEventListener("dblclick", (e) => {
2264
+ const target = e.target;
2265
+ // Don't toggle when double-clicking interactive controls (chips, buttons,
2266
+ // links, address widgets) — only on the chrome / empty space.
2267
+ if (target?.closest("a, button, input, select, textarea, [contenteditable]"))
2268
+ return;
2269
+ toggleFullscreenPreview();
2270
+ });
2259
2271
  // ── F6 pane cycling ──
2260
2272
  function cyclePaneFocus(reverse) {
2261
2273
  // Major panes in tab order. Skip ones not currently visible (folder
@@ -2977,6 +2989,50 @@ document.getElementById("btn-shortcuts")?.addEventListener("click", () => {
2977
2989
  settingsDropdown.hidden = true;
2978
2990
  openShortcutsDialog();
2979
2991
  });
2992
+ // ── Check for updates (Settings menu item) ──
2993
+ // On phone narrow tier the toolbar Update menu is collapsed away — give the
2994
+ // user an explicit, non-reloading path to trigger the update poll. The
2995
+ // AppUpdater banner appears at the bottom of the WebView if a newer version
2996
+ // is available; otherwise the status bar reports "up to date".
2997
+ document.getElementById("btn-settings-checkupdate")?.addEventListener("click", () => {
2998
+ const settingsDropdown = document.getElementById("settings-dropdown");
2999
+ if (settingsDropdown)
3000
+ settingsDropdown.hidden = true;
3001
+ const statusSync = document.getElementById("status-sync");
3002
+ if (statusSync)
3003
+ statusSync.textContent = "Checking for updates…";
3004
+ const isAndroid = window.mailxapi?.platform === "android";
3005
+ if (isAndroid) {
3006
+ // Bridge fires the C# AppUpdater.CheckForUpdate, which injects the
3007
+ // bottom banner if a newer version is on rmf39.aaz.lt/mailx.
3008
+ const f = document.createElement("iframe");
3009
+ f.style.display = "none";
3010
+ f.src = "mailxapi://checkUpdate";
3011
+ document.body.appendChild(f);
3012
+ setTimeout(() => f.remove(), 100);
3013
+ // Status hint resets after a few seconds in case nothing happens
3014
+ // (already up to date, or fetch failed silently).
3015
+ setTimeout(() => {
3016
+ if (statusSync && statusSync.textContent === "Checking for updates…") {
3017
+ statusSync.textContent = "Up to date or check pending — see banner if available";
3018
+ setTimeout(() => { if (statusSync.textContent?.startsWith("Up to date"))
3019
+ statusSync.textContent = ""; }, 6000);
3020
+ }
3021
+ }, 4000);
3022
+ }
3023
+ else {
3024
+ // Desktop: same path as the toolbar btn-update.
3025
+ const ipc = window.mailxapi || window.opener?.mailxapi;
3026
+ if (ipc?.performUpdate) {
3027
+ if (statusSync)
3028
+ statusSync.textContent = "Updating… mailx will restart when done";
3029
+ ipc.performUpdate();
3030
+ }
3031
+ else if (statusSync) {
3032
+ statusSync.textContent = "Update not available in this mode";
3033
+ }
3034
+ }
3035
+ });
2980
3036
  // ── About dialog ──
2981
3037
  document.getElementById("btn-about")?.addEventListener("click", () => {
2982
3038
  const settingsDropdown = document.getElementById("settings-dropdown");