@bobfrankston/rmfmail 1.2.296 → 1.2.297

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
@@ -2217,7 +2217,7 @@ document.getElementById("btn-flag")?.addEventListener("click", async () => {
2217
2217
  try {
2218
2218
  await updateFlags(sel.accountId, sel.uid, sel.flags, sel.folderId);
2219
2219
  messageState.updateMessageFlags(sel.accountId, sel.uid, sel.flags, sel.folderId);
2220
- // Row owns its own DOM \u2014 go through the row object so class + star
2220
+ // Row owns its own DOM go through the row object so class + star
2221
2221
  // update atomically and the list/preview stay in sync.
2222
2222
  setRowFlagged(sel.accountId, sel.uid, !wasFlagged, sel.folderId);
2223
2223
  }
@@ -5895,6 +5895,29 @@ function syncFilterFlaggedButton() {
5895
5895
  btn.classList.toggle("active", !!optFlagged?.checked);
5896
5896
  btn.setAttribute("aria-pressed", optFlagged?.checked ? "true" : "false");
5897
5897
  }
5898
+ /** Name the active list filter above the list, and make the name the way out
5899
+ * of it. The filter used to announce itself by tinting every row — which is
5900
+ * how the list says "selected", so a filtered list read as a selected one
5901
+ * (Bob 2026-08-29: "if I press * on search it shouldn't automatically select
5902
+ * those letters, just show them"). Names which filter, not "a filter is on". */
5903
+ function syncFilterChip() {
5904
+ const chip = document.getElementById("ml-filter-chip");
5905
+ if (!chip)
5906
+ return;
5907
+ const flagged = !!document.getElementById("opt-flagged")?.checked;
5908
+ const priority = !!document.getElementById("opt-priority-only")?.checked;
5909
+ const names = [flagged ? "flagged (★) messages" : "", priority ? "priority senders" : ""].filter(Boolean);
5910
+ if (!names.length) {
5911
+ chip.hidden = true;
5912
+ return;
5913
+ }
5914
+ chip.hidden = false;
5915
+ chip.textContent = "Showing " + names.join(" and ") + " only — click to show everything";
5916
+ chip.title = "Clear the list filter";
5917
+ }
5918
+ document.getElementById("ml-filter-chip")?.addEventListener("click", () => {
5919
+ document.dispatchEvent(new CustomEvent("mailx-clear-list-filters"));
5920
+ });
5898
5921
  function applyFlaggedFilter(on) {
5899
5922
  try {
5900
5923
  logClientEvent("applyFlaggedFilter", { on, caller: new Error().stack?.split("\n").slice(2, 5).join(" | ") });
@@ -5909,6 +5932,7 @@ function applyFlaggedFilter(on) {
5909
5932
  body?.classList.remove("flagged-only");
5910
5933
  localStorage.setItem("mailx-flagged", String(on));
5911
5934
  syncFilterFlaggedButton();
5935
+ syncFilterChip();
5912
5936
  reloadCurrentFolder();
5913
5937
  }
5914
5938
  optFlagged?.addEventListener("change", () => {
@@ -5920,6 +5944,7 @@ document.getElementById("btn-filter-flagged")?.addEventListener("click", () => {
5920
5944
  // Initial paint of the button's pressed state (covers the localStorage-restored
5921
5945
  // value loaded earlier in this file).
5922
5946
  syncFilterFlaggedButton();
5947
+ syncFilterChip();
5923
5948
  // Priority-senders-only filter — same pattern as flagged-only. Adds
5924
5949
  // .priority-only to the list body; CSS hides any row without .priority.
5925
5950
  const optPriorityOnly = document.getElementById("opt-priority-only");
@@ -5935,6 +5960,7 @@ if (optPriorityOnly) {
5935
5960
  else
5936
5961
  body?.classList.remove("priority-only");
5937
5962
  localStorage.setItem("mailx-priority-only", String(optPriorityOnly.checked));
5963
+ syncFilterChip();
5938
5964
  });
5939
5965
  }
5940
5966
  // "Show all messages" escape from a list that's empty only because a