@bobfrankston/rmfmail 1.1.83 → 1.1.85

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,5 +1,12 @@
1
- Viewer flag button: use a star glyph, matching the list star
1
+ Flag star: single named colour token; drop unneeded VS-15 churn
2
2
 
3
- The toolbar Flag button showed a while the message-list row uses
4
- ★/☆ for the same flag state. Changed the toolbar glyph to ★ so the
5
- two are visibly the same action.
3
+ v1.1.84 already rendered both flag stars the same gold, so the
4
+ variation-selector / font-variant-emoji changes were reverted they
5
+ fixed nothing and put invisible characters in source.
6
+
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 ★/☆.
@@ -7447,17 +7447,28 @@ document.addEventListener("mailx-moved", (e) => {
7447
7447
  document.getElementById("btn-delete")?.addEventListener("click", deleteSelection);
7448
7448
  document.getElementById("btn-tb-delete")?.addEventListener("click", deleteSelection);
7449
7449
  document.getElementById("btn-tb-spam")?.addEventListener("click", spamSelectedMessages);
7450
+ function updateFlagButton() {
7451
+ const btn = document.getElementById("btn-flag");
7452
+ if (!btn) return;
7453
+ const sel = getCurrentFocused();
7454
+ const yes = !!sel && flaggedOf(sel);
7455
+ btn.classList.toggle("flagged", yes);
7456
+ btn.textContent = yes ? "\u2605" : "\u2606";
7457
+ }
7458
+ document.addEventListener("mailx-message-shown", updateFlagButton);
7450
7459
  document.getElementById("btn-flag")?.addEventListener("click", async () => {
7451
7460
  const sel = getCurrentFocused();
7452
7461
  if (!sel) return;
7453
7462
  const wasFlagged = flaggedOf(sel);
7454
7463
  setFlagged(sel, !wasFlagged);
7464
+ updateFlagButton();
7455
7465
  try {
7456
7466
  await updateFlags(sel.accountId, sel.uid, sel.flags);
7457
7467
  updateMessageFlags(sel.accountId, sel.uid, sel.flags);
7458
7468
  setRowFlagged(sel.accountId, sel.uid, !wasFlagged);
7459
7469
  } catch (e) {
7460
7470
  setFlagged(sel, wasFlagged);
7471
+ updateFlagButton();
7461
7472
  console.error(`Flag toggle failed: ${e.message}`);
7462
7473
  }
7463
7474
  });