@bobfrankston/rmfmail 1.1.87 → 1.1.88

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,15 +1,11 @@
1
- Compose autocomplete at caret; instant discard; visible attachments
1
+ Fix: highlighted row with an empty viewer (selection/preview desync)
2
2
 
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.
3
+ A list row could stay highlighted while the viewer showed "Select a
4
+ message to read". releaseFocus() only un-selected the tracked focusedRow,
5
+ so a stray .selected (multi-select remnant, or a row that kept the class
6
+ through an incremental rerender) was left highlighted after the viewer
7
+ had been cleared.
7
8
 
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).
9
+ releaseFocus() now strips every .selected row. focusRow() also sweeps
10
+ stray .selected in single-select mode before highlighting its row, so
11
+ the list can never show a highlight that doesn't match the viewer.
@@ -2522,6 +2522,13 @@ function rowKey(accountId, uid) {
2522
2522
  return `${accountId}:${uid}`;
2523
2523
  }
2524
2524
  function focusRow(row, opts = {}) {
2525
+ const body = row.el.parentElement;
2526
+ if (!body?.classList.contains("multi-select-on")) {
2527
+ body?.querySelectorAll(".ml-row.selected").forEach((r) => {
2528
+ if (r !== row.el)
2529
+ r.classList.remove("selected");
2530
+ });
2531
+ }
2525
2532
  if (focusedRow && focusedRow !== row)
2526
2533
  focusedRow.setSelected(false);
2527
2534
  row.setSelected(true);
@@ -2559,9 +2566,9 @@ function scrollFocusedIntoView() {
2559
2566
  focusedRow.el.scrollIntoView({ block: "center" });
2560
2567
  }
2561
2568
  function releaseFocus() {
2562
- if (focusedRow)
2563
- focusedRow.setSelected(false);
2564
2569
  focusedRow = null;
2570
+ const body = document.getElementById("ml-body");
2571
+ body?.querySelectorAll(".ml-row.selected").forEach((r) => r.classList.remove("selected"));
2565
2572
  clearViewer();
2566
2573
  document.dispatchEvent(new CustomEvent("mailx-focus-changed", { detail: null }));
2567
2574
  }