dsh-notify-me 1.10.5 → 1.10.6
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/CHANGELOG.md +14 -0
- package/README.en.md +2 -0
- package/README.md +2 -0
- package/lib/client.js +35 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to **dsh-notify-me** are documented here.
|
|
4
4
|
|
|
5
|
+
## [1.10.6] — 2026-10-21
|
|
6
|
+
|
|
7
|
+
### 修复
|
|
8
|
+
|
|
9
|
+
- **提醒方式选「页面浮层」时,窗口在后台就等于没有提醒**:浮层卡片画在页面里,窗口被别的应用挡住(或最小化)时它既看不见、又会在 12 秒后自己收起,于是只剩下提示音,屏幕上什么都没有。现在浮层通道在页面离开前台时会额外发一条系统通知——那是唯一能追到「人在别处」的手段;窗口回到前台则不加,屏幕上还是一张卡片,不重复。系统通知仍受通知权限约束,未授权时保持原样(只有卡片)。
|
|
10
|
+
|
|
11
|
+
### 新增
|
|
12
|
+
|
|
13
|
+
- 设置页「通知类型」下方新增「窗口在后台时补发系统通知」开关(默认开),关掉后浮层严格留在页面内。
|
|
14
|
+
|
|
15
|
+
### 测试
|
|
16
|
+
|
|
17
|
+
- 冒烟新增断言:浮层通道在页面隐藏时发出系统通知且仍画卡片;开关关闭后不再发;页面可见时行为不变。
|
|
18
|
+
|
|
5
19
|
## [1.10.5] — 2026-10-21
|
|
6
20
|
|
|
7
21
|
### 修复
|
package/README.en.md
CHANGED
|
@@ -138,6 +138,7 @@ The **in-page overlay** skips the notification center and draws the card inside
|
|
|
138
138
|
- **Approval cards carry Approve / Reject** — the same decision as Allow once / Reject on the approval card, and they work on the Desktop too (no Service Worker involved). Clicking the card body opens its conversation;
|
|
139
139
|
- **Lifetime** — "needs you" and "reply finished" cards retire after 5s each, an approval card with buttons after 12s (system toasts use the same two numbers); a card or its close button retires one earlier. At most 4 cards stack at once;
|
|
140
140
|
- **Relation to system notifications** — it is one or the other. Both used to be switchable at once, which meant every alert arrived twice and the pair covered each other; 1.10.0 made it a single choice, and 1.10.2 turns that into one segmented row. An old config with the overlay on migrates to it.
|
|
141
|
+
- **System notification while the window is in the background** (on by default, since 1.10.6) — the card is drawn inside the page, so a window behind another app or minimized shows nothing and leaves only the sound. With this on, an alert arriving while the page is away is also raised as a system notification; back in front, the card is the only copy again. Turn it off to keep the overlay strictly in-page.
|
|
141
142
|
|
|
142
143
|
The overlay only knows which screen the window is on, not which screen you are looking at. If the window stays on the primary display while you watch another one, it stays invisible — same as a toast.
|
|
143
144
|
|
|
@@ -261,6 +262,7 @@ window.__dshNotifyMe.setConfig({
|
|
|
261
262
|
quickActions: true, // Approve / Reject buttons on approval toasts
|
|
262
263
|
overlay: false, // legacy mirror kept in sync with channel (old configs migrate through it)
|
|
263
264
|
overlayCorner: "bottom-right", // overlay anchor: 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left'
|
|
265
|
+
overlayAwayToast: true, // overlay channel: also raise a system notification while the page is away (the only cross-channel exception)
|
|
264
266
|
externalEnabled: false, // external-notification forwarding master switch (default off: no endpoint, nothing is sent)
|
|
265
267
|
externalAttention: true, // forward "needs you" (exactly the same trigger rules as local alerts)
|
|
266
268
|
externalDone: true, // forward "reply finished"
|
package/README.md
CHANGED
|
@@ -134,6 +134,7 @@ Windows 的系统通知横幅固定画在主屏上,系统没有设置项、浏
|
|
|
134
134
|
- **审批卡片带「同意 / 拒绝」**:与审批卡片的「允许一次 / 拒绝」等价,桌面端也能用(不依赖 Service Worker);点卡片正文则切回对应对话;
|
|
135
135
|
- **停留时间**:普通提醒 5 秒自动收起,带「同意 / 拒绝」的审批卡片 12 秒(系统通知用同一套数字);也可以点卡片或右上角叉提前关掉。最多同时叠 4 张;
|
|
136
136
|
- **与系统通知的关系**:二选一。以前两个开关可以同开,结果同一条提醒弹两遍、还互相挡住;1.10.0 起改成单选,1.10.2 起做成一行分段选择器。老配置里开着浮层的,升级后自动落到浮层。
|
|
137
|
+
- **窗口在后台时补发系统通知**(默认开,1.10.6 起):浮层画在页面里,窗口被别的应用挡住或最小化时看不见,等于只剩声音;开着这一项,页面离开前台时额外发一条系统通知,窗口回到前台还是只有卡片。不需要这份兜底就关掉它。
|
|
137
138
|
|
|
138
139
|
浮层只知道窗口在哪块屏,不知道你人在看哪块屏。窗口留在主屏、人却盯着副屏时,它同样看不见。
|
|
139
140
|
|
|
@@ -257,6 +258,7 @@ window.__dshNotifyMe.setConfig({
|
|
|
257
258
|
quickActions: true, // 审批通知上的「同意 / 拒绝」按钮
|
|
258
259
|
overlay: false, // 兼容字段,跟随 channel 同步(老配置靠它迁移)
|
|
259
260
|
overlayCorner: "bottom-right", // 浮层位置:'top-right' | 'bottom-right' | 'top-left' | 'bottom-left'
|
|
261
|
+
overlayAwayToast: true, // 浮层通道下,页面在后台时额外发一条系统通知(唯一跨通道例外)
|
|
260
262
|
externalEnabled: false, // 外部通知转发主开关(默认关:不填端点就什么都不发)
|
|
261
263
|
externalAttention: true, // 转发「需要你」(触发规则跟本地提醒完全一致)
|
|
262
264
|
externalDone: true, // 转发「回复完成」
|
package/lib/client.js
CHANGED
|
@@ -270,6 +270,12 @@
|
|
|
270
270
|
// config written by an older build, or a console poke at one of them,
|
|
271
271
|
// still means what it used to.
|
|
272
272
|
overlay: false,
|
|
273
|
+
// The overlay draws inside the page, so a window sitting behind another
|
|
274
|
+
// app shows nothing at all. An alert that lands while the page is away
|
|
275
|
+
// therefore also raises a system notification — the only thing that
|
|
276
|
+
// reaches a user who is elsewhere. Off keeps the overlay strictly
|
|
277
|
+
// in-page, at the price of silence while the window is behind.
|
|
278
|
+
overlayAwayToast: true,
|
|
273
279
|
// Which corner of this window the overlay cards stack in. The screen
|
|
274
280
|
// follows the window — the page cannot aim it anywhere else either.
|
|
275
281
|
overlayCorner: "bottom-right", // bottom-right | bottom-left | top-right | top-left
|
|
@@ -473,6 +479,17 @@
|
|
|
473
479
|
return "Notification" in window && Notification.permission === "granted";
|
|
474
480
|
} catch (e) { return false; } // a policy-disabled Notification must not break delivery
|
|
475
481
|
}
|
|
482
|
+
// The overlay is the chosen channel, but a card inside a window the user is
|
|
483
|
+
// not looking at cannot be seen; the system notification is the only thing
|
|
484
|
+
// that reaches them. Permission still decides — without it the in-page card
|
|
485
|
+
// is all there is, waiting for them when they come back.
|
|
486
|
+
function awayToastAllowed() {
|
|
487
|
+
if (config.channel !== "overlay" || !config.overlayAwayToast) return false;
|
|
488
|
+
if (!away()) return false;
|
|
489
|
+
try {
|
|
490
|
+
return "Notification" in window && Notification.permission === "granted";
|
|
491
|
+
} catch (e) { return false; }
|
|
492
|
+
}
|
|
476
493
|
// True on the packaged desktop shell, where the app page lives under
|
|
477
494
|
// dsh-app://app inside Electron. The desktop needs its own raise path
|
|
478
495
|
// (raiseWindow below) and cannot carry quick-decision buttons at all.
|
|
@@ -758,8 +775,8 @@
|
|
|
758
775
|
return "dsh-notify-me-" + kind + "-" + toastSeq + "-" + Date.now();
|
|
759
776
|
}
|
|
760
777
|
|
|
761
|
-
function showToast(kind, title, body, sessionId, quick) {
|
|
762
|
-
if (!canToast()) return;
|
|
778
|
+
function showToast(kind, title, body, sessionId, quick, forced) {
|
|
779
|
+
if (!forced && !canToast()) return;
|
|
763
780
|
try {
|
|
764
781
|
var tag = quick ? quick.tag : uniqueToastTag(kind);
|
|
765
782
|
if (quick && bridgeActive()) {
|
|
@@ -1424,7 +1441,12 @@
|
|
|
1424
1441
|
}
|
|
1425
1442
|
function deliver(kind, title, body, sessionId, quick) {
|
|
1426
1443
|
if (!config.enabled) return;
|
|
1427
|
-
|
|
1444
|
+
// One visible path per alert: the toast channel owns system notifications,
|
|
1445
|
+
// the overlay channel owns the in-page card. The single exception is the
|
|
1446
|
+
// overlay channel while the page is away — that card is unseeable then,
|
|
1447
|
+
// so the alert also goes out as a system notification (see
|
|
1448
|
+
// awayToastAllowed).
|
|
1449
|
+
showToast(kind, title, body, sessionId, quick, awayToastAllowed());
|
|
1428
1450
|
showOverlay(kind, title, body, sessionId, quick);
|
|
1429
1451
|
showFallbackApprovalCard(kind, title, body, sessionId, quick);
|
|
1430
1452
|
if (kind === "attention") {
|
|
@@ -2066,7 +2088,7 @@
|
|
|
2066
2088
|
});
|
|
2067
2089
|
} catch (e) {}
|
|
2068
2090
|
// keep in sync with package.json "version" on every release
|
|
2069
|
-
api.version = "1.10.
|
|
2091
|
+
api.version = "1.10.6";
|
|
2070
2092
|
api.setConfig = function (patch) { return setConfigLocal(patch); };
|
|
2071
2093
|
api.resetConfig = function () {
|
|
2072
2094
|
try {
|
|
@@ -2287,7 +2309,7 @@
|
|
|
2287
2309
|
bridgeOffTail: "):系统通知没有按钮,按钮改画在窗口角落的卡片上。",
|
|
2288
2310
|
bridgeOffDesktop: "系统通知本身没有「同意 / 拒绝」按钮:桌面端页面(dsh-app://)注册不了 Service Worker(宿主少给 allowServiceWorkers 特权)。审批类提醒会同时在窗口角落弹一张卡片,按钮就在卡片上;想只留卡片、不弹系统通知,把「提醒方式」切到「页面浮层」。",
|
|
2289
2311
|
overlay: "页面浮层提醒",
|
|
2290
|
-
overlayHint: "在窗口角落画提醒卡片:窗口在哪块屏,它就在哪块屏;系统通知只会出现在主屏,主屏不看时用它。不需要通知权限,卡片上能直接「同意 /
|
|
2312
|
+
overlayHint: "在窗口角落画提醒卡片:窗口在哪块屏,它就在哪块屏;系统通知只会出现在主屏,主屏不看时用它。不需要通知权限,卡片上能直接「同意 / 拒绝」。与系统通知二选一;唯一例外是窗口不在前台时,会补发一条系统通知(下一行可关掉)。",
|
|
2291
2313
|
channelLabel: "通知类型",
|
|
2292
2314
|
overlaySeg: "浮层提醒",
|
|
2293
2315
|
channelHint: "系统通知只会出现在主屏,进通知中心要权限,桌面端的通知本身没有「同意 / 拒绝」按钮(审批会额外在窗口角落弹一张可点击的卡片);页面浮层画在 DSH 窗口所在的那块屏,不需要权限,卡片上能直接裁决。两个只能选一个。",
|
|
@@ -2298,6 +2320,8 @@
|
|
|
2298
2320
|
overlayPosTL: "左上",
|
|
2299
2321
|
overlayPosBL: "左下",
|
|
2300
2322
|
overlayQuickNote: "浮层上的「同意」同样等价于审批卡片上的「允许一次」,与通知按钮一致。",
|
|
2323
|
+
overlayAwayToast: "窗口在后台时补发系统通知",
|
|
2324
|
+
overlayAwayToastHint: "浮层画在页面里,窗口被别的应用挡住时看不见,等于没有提醒。打开后,窗口不在前台时仍会补发一条系统通知(需要通知权限)。",
|
|
2301
2325
|
testApprovalNoBridge: "已发测试提醒:系统通知没有按钮,快捷裁决按钮画在窗口角落的卡片上。",
|
|
2302
2326
|
testNeedsQuick: "先打开上面的「审批通知上直接裁决」才能测按钮。",
|
|
2303
2327
|
volume: "音量",
|
|
@@ -2417,7 +2441,7 @@
|
|
|
2417
2441
|
bridgeOffTail: "); system notifications carry no buttons, so they are drawn on a card in the window corner instead.",
|
|
2418
2442
|
bridgeOffDesktop: "System notifications carry no Approve / Reject buttons: dsh-app:// pages cannot register a Service Worker (the shell does not grant the allowServiceWorkers privilege). An approval therefore also drops a clickable card in the window corner, buttons and all; switch the alert channel to the in-page overlay to keep only the card and skip the system notification.",
|
|
2419
2443
|
overlay: "In-page overlay",
|
|
2420
|
-
overlayHint: "Draw a card in the window corner, on whatever display the window sits on. System notifications only ever show on the primary display. No permission needed, and the card carries Approve / Reject directly. It replaces system notifications rather than adding to them.",
|
|
2444
|
+
overlayHint: "Draw a card in the window corner, on whatever display the window sits on. System notifications only ever show on the primary display. No permission needed, and the card carries Approve / Reject directly. It replaces system notifications rather than adding to them — except while the window is not in front, when one system notification is sent as well (switchable on the next row).",
|
|
2421
2445
|
channelLabel: "Alert type",
|
|
2422
2446
|
overlaySeg: "Overlay",
|
|
2423
2447
|
channelHint: "System notifications land in the Windows notification center: permission needed, primary display only, and the Desktop shell's notifications carry no Approve / Reject buttons (an approval also drops a clickable card in the window corner). The in-page overlay draws on whichever display the DSH window sits on, needs no permission, and lets the Desktop shell decide right on the card. Pick one.",
|
|
@@ -2428,6 +2452,8 @@
|
|
|
2428
2452
|
overlayPosTL: "Top left",
|
|
2429
2453
|
overlayPosBL: "Bottom left",
|
|
2430
2454
|
overlayQuickNote: "\"Approve\" here equals \"Allow once\" on the approval card — the same decision the toast buttons send.",
|
|
2455
|
+
overlayAwayToast: "Also send a system notification while the window is in the background",
|
|
2456
|
+
overlayAwayToastHint: "The card is drawn inside the page, so a window hidden behind another app shows nothing — as good as no alert. With this on, an alert that arrives while the window is not in front is also sent as a system notification (notification permission required).",
|
|
2431
2457
|
testApprovalNoBridge: "Test alert sent: system notifications carry no buttons, so the quick-decision buttons are drawn on a card in the window corner.",
|
|
2432
2458
|
testNeedsQuick: "Turn on \"Decide approvals from the toast\" above to test the buttons.",
|
|
2433
2459
|
volume: "Volume",
|
|
@@ -3144,6 +3170,9 @@
|
|
|
3144
3170
|
])
|
|
3145
3171
|
])
|
|
3146
3172
|
}) : null,
|
|
3173
|
+
cfg.channel === "overlay" ? rowSwitch("overlayAwayToast", t("overlayAwayToast"), t("overlayAwayToastHint"), cfg.overlayAwayToast, function (v) {
|
|
3174
|
+
patch({ overlayAwayToast: v });
|
|
3175
|
+
}) : null,
|
|
3147
3176
|
cfg.sound ? discloseRow({
|
|
3148
3177
|
key: "volume",
|
|
3149
3178
|
labelText: t("sound"),
|