@bobfrankston/mailx 1.0.226 → 1.0.227

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.
Files changed (2) hide show
  1. package/client/app.js +34 -0
  2. package/package.json +5 -5
package/client/app.js CHANGED
@@ -67,12 +67,46 @@ async function updateNewMessageCount() {
67
67
  updateBadge(0);
68
68
  return;
69
69
  }
70
+ const previousBadge = badgeCount;
70
71
  // New messages = increase since last seen
71
72
  const newCount = Math.max(0, totalUnread - lastSeenCount);
72
73
  updateBadge(newCount);
74
+ // Flash the title when new mail arrives and the window isn't focused.
75
+ // Windows' taskbar mirrors document.title so this acts as a taskbar flash.
76
+ if (newCount > previousBadge && document.visibilityState !== "visible") {
77
+ startTitleFlash();
78
+ }
73
79
  }
74
80
  catch { /* offline */ }
75
81
  }
82
+ // ── Taskbar flash via title alternation ──
83
+ let titleFlashTimer = null;
84
+ let titleFlashPhase = false;
85
+ function startTitleFlash() {
86
+ stopTitleFlash();
87
+ titleFlashPhase = true;
88
+ titleFlashTimer = setInterval(() => {
89
+ titleFlashPhase = !titleFlashPhase;
90
+ if (titleFlashPhase) {
91
+ document.title = `✉ NEW MAIL (${badgeCount})`;
92
+ }
93
+ else {
94
+ document.title = badgeCount > 0 ? `(${badgeCount}) ${baseTitle}` : baseTitle;
95
+ }
96
+ }, 1000);
97
+ }
98
+ function stopTitleFlash() {
99
+ if (titleFlashTimer) {
100
+ clearInterval(titleFlashTimer);
101
+ titleFlashTimer = null;
102
+ }
103
+ document.title = badgeCount > 0 ? `(${badgeCount}) ${baseTitle}` : baseTitle;
104
+ }
105
+ document.addEventListener("visibilitychange", () => {
106
+ if (document.visibilityState === "visible")
107
+ stopTitleFlash();
108
+ });
109
+ window.addEventListener("focus", stopTitleFlash);
76
110
  /** Call when user actively views messages — resets the badge */
77
111
  function markAsSeen() {
78
112
  getAccounts().then(async (accounts) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx",
3
- "version": "1.0.226",
3
+ "version": "1.0.227",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",
@@ -20,11 +20,11 @@
20
20
  "postinstall": "node bin/postinstall.js"
21
21
  },
22
22
  "dependencies": {
23
- "@bobfrankston/iflow-direct": "^0.1.10",
23
+ "@bobfrankston/iflow-direct": "^0.1.11",
24
24
  "@bobfrankston/iflow-node": "^0.1.2",
25
25
  "@bobfrankston/miscinfo": "^1.0.8",
26
26
  "@bobfrankston/oauthsupport": "^1.0.22",
27
- "@bobfrankston/msger": "^0.1.288",
27
+ "@bobfrankston/msger": "^0.1.289",
28
28
  "@capacitor/android": "^8.3.0",
29
29
  "@capacitor/cli": "^8.3.0",
30
30
  "@capacitor/core": "^8.3.0",
@@ -74,11 +74,11 @@
74
74
  },
75
75
  ".transformedSnapshot": {
76
76
  "dependencies": {
77
- "@bobfrankston/iflow-direct": "^0.1.10",
77
+ "@bobfrankston/iflow-direct": "^0.1.11",
78
78
  "@bobfrankston/iflow-node": "^0.1.2",
79
79
  "@bobfrankston/miscinfo": "^1.0.8",
80
80
  "@bobfrankston/oauthsupport": "^1.0.22",
81
- "@bobfrankston/msger": "^0.1.288",
81
+ "@bobfrankston/msger": "^0.1.289",
82
82
  "@capacitor/android": "^8.3.0",
83
83
  "@capacitor/cli": "^8.3.0",
84
84
  "@capacitor/core": "^8.3.0",