@bobfrankston/rmfmail 1.1.85 → 1.1.87

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/.commitmsg CHANGED
@@ -1,12 +1,15 @@
1
- Flag star: single named colour token; drop unneeded VS-15 churn
1
+ Compose autocomplete at caret; instant discard; visible attachments
2
2
 
3
- v1.1.84 already rendered both flag stars the same gold, so the
4
- variation-selector / font-variant-emoji changes were revertedthey
5
- fixed nothing and put invisible characters in source.
3
+ - Recipient autocomplete now matches the token the cursor is in, via
4
+ tokenSpanAtCaret(), instead of always the last token typing a name
5
+ before an existing comma matched the wrong recipient. replaceCaretToken
6
+ replaces only that token and leaves following recipients intact.
6
7
 
7
- Instead the gold/amber flag colour is now a documented token,
8
- --color-flag-star (oklch hue 60), in variables.css. Both the
9
- message-list row star (.ml-row.flagged .ml-flag) and the viewer toolbar
10
- Flag button (#btn-flag.flagged) reference it, so they can't drift, and
11
- the colour is named rather than a duplicated magic number. Star glyphs
12
- restored to plain literal ★/☆.
8
+ - Compose Discard / X: the IMAP draft delete is now fire-and-forget so
9
+ the window closes instantly. It used to await the server round-trip,
10
+ leaving the window up for seconds ("eventually it did").
11
+
12
+ - Attachment chip: clearly tinted background + accent border so it's not
13
+ easy to miss; clicking shows "Opening…" for >=600ms and ignores
14
+ re-clicks while in flight (the open hands off to the OS viewer with no
15
+ visible change in mailx, so it was being clicked repeatedly).
@@ -1665,6 +1665,19 @@ async function showMessage(accountId, uid, folderId, specialUse, isRetry = false
1665
1665
  chip.title = `${att.filename} (${att.mimeType})`;
1666
1666
  chip.addEventListener("click", async (e) => {
1667
1667
  e.preventDefault();
1668
+ if (chip.dataset.opening === "1")
1669
+ return;
1670
+ chip.dataset.opening = "1";
1671
+ const chipLabel = chip.textContent || "";
1672
+ chip.textContent = "\u23F3 Opening\u2026";
1673
+ const tStart = Date.now();
1674
+ const restoreChip = () => {
1675
+ const wait = Math.max(0, 600 - (Date.now() - tStart));
1676
+ setTimeout(() => {
1677
+ chip.textContent = chipLabel;
1678
+ chip.dataset.opening = "";
1679
+ }, wait);
1680
+ };
1668
1681
  try {
1669
1682
  const bridge = window._nativeBridge;
1670
1683
  if (bridge?.openAttachment) {
@@ -1693,6 +1706,8 @@ async function showMessage(accountId, uid, folderId, specialUse, isRetry = false
1693
1706
  const m = `Couldn't open "${att.filename}": ${err?.message || err}`;
1694
1707
  console.error(m);
1695
1708
  window.dispatchEvent(new CustomEvent("mailx-alert", { detail: { message: m, key: "attachment-open" } }));
1709
+ } finally {
1710
+ restoreChip();
1696
1711
  }
1697
1712
  });
1698
1713
  chip.draggable = true;
@@ -6682,14 +6697,15 @@ window.addEventListener("mailx-alert", (e) => {
6682
6697
  const d = e.detail || {};
6683
6698
  if (d.message) showAlert(String(d.message), d.key);
6684
6699
  });
6685
- function hideAlert() {
6700
+ function hideAlert(opts) {
6686
6701
  if (alertBanner) {
6702
+ if (!opts?.force && alertBanner.dataset.key === "update-available") return;
6687
6703
  const key = alertBanner.dataset.key;
6688
6704
  if (key) dismissedAlerts.add(key);
6689
6705
  alertBanner.hidden = true;
6690
6706
  }
6691
6707
  }
6692
- alertDismiss?.addEventListener("click", hideAlert);
6708
+ alertDismiss?.addEventListener("click", () => hideAlert({ force: true }));
6693
6709
  function showRestartForConfigBanner() {
6694
6710
  if (!alertBanner || !alertText) return;
6695
6711
  const ts = (/* @__PURE__ */ new Date()).toLocaleTimeString([], { hour12: false });
@@ -8314,6 +8330,7 @@ onWsEvent((event) => {
8314
8330
  const text = document.getElementById("alert-text");
8315
8331
  if (banner && text) {
8316
8332
  banner.hidden = false;
8333
+ banner.dataset.key = "update-available";
8317
8334
  banner.style.background = "oklch(0.52 0.14 150)";
8318
8335
  const restoreHtml = `${APP_NAME} ${event.latest} available (you have ${event.current}) \u2014 <button id="btn-do-update" style="background:none;border:1px solid #fff;color:#fff;padding:0.15em 0.5em;border-radius:3px;cursor:pointer;margin-left:0.5em">Update now</button>`;
8319
8336
  window.__mailxUpdateBannerHtml = restoreHtml;
@@ -8333,6 +8350,7 @@ onWsEvent((event) => {
8333
8350
  const restoreHtml = window.__mailxUpdateBannerHtml;
8334
8351
  const prefix = event.offline ? "No connection \u2014 update postponed. " : "Update failed \u2014 ";
8335
8352
  banner.hidden = false;
8353
+ banner.dataset.key = "update-available";
8336
8354
  banner.style.background = event.offline ? "oklch(0.42 0.06 70)" : "oklch(0.45 0.12 25)";
8337
8355
  text.innerHTML = `${prefix}${restoreHtml ?? ""}`;
8338
8356
  document.getElementById("btn-do-update")?.addEventListener("click", () => {