dsh-notify-me 1.16.0 → 1.17.0

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 CHANGED
@@ -2,6 +2,44 @@
2
2
 
3
3
  All notable changes to **dsh-notify-me** are documented here.
4
4
 
5
+ ## [1.17.0] — 2026-10-29
6
+
7
+ 回到页面,还挂着的通知立刻收起;三种「自动消失」设置从此只约束定时关闭。
8
+
9
+ ### 修复
10
+
11
+ - **离开时收到的那条通知不再一直挡着**:以前按默认设置(「离开时保留」)收到的那条会一直留着——回到页面了它还在,挡在对话上或留在通知中心里,直到它自己的定时器到点、或被点掉。现在只要回到 DSH 页面,**不管用什么方式**——点任务栏、Alt+Tab、点通知本身、把最小化的窗口还原——插件都会立刻收起仍然挂着的通知。三条路径在实现上汇到同一处:窗口 `focus` 事件(`lib/client.js:2230`)、页面 `visibilitychange` 回到可见(`lib/client.js:4781`)、以及窗口一直没失去焦点但人走开了(`idleMinutes` 判定为空闲)之后的第一下键鼠输入(`lib/client.js:2254`)。
12
+ - **两条通知通道都覆盖**:桌面端那种不带按钮的普通通知由构造器产生,插件自己记着句柄(`lib/client.js:1364`);Web 端带「同意 / 拒绝」的常驻通知,插件向自己的 Service Worker 注册查列表再关(`lib/client.js:1379`)。所以连刷新页面前留下的那些也会被收掉——它们是上一个页面实例弹的,本页本来就没有它们的句柄。
13
+ - **收起只是把通知撤掉,不改动任何待办**:审批请求仍然在对话里等你裁决,标题标记、去重、外部推送、提示音都不受影响;之后请求被回答时原本的收尾逻辑照旧(关同 tag 的通知是幂等的)。记待办的 `pendingActions` 不被清掉。
14
+
15
+ ### 变更
16
+
17
+ - **三种「通知自动消失」设置只剩「时间到点」这一层含义**:离开时保留 / 总是关闭 / 从不关闭,管的都只是定时器那一次关闭;回到页面收起残留通知这一条,三种设置下都生效。「从不关闭」现在的准确含义是:不因为时间到点而关,但你回到页面时仍会收起。设置页那行提示文案一起改了(`autoDismissHint`,`lib/client.js:3300` 中文、`lib/client.js:3475` 英文):先说「离开电脑时收到的那条会留到你回来」,再点明三种设置只管那次到点关闭,切回页面(点任务栏、Alt+Tab、点通知都算)后残留的通知一律收起。
18
+
19
+ ### 新增
20
+
21
+ - `debug()` 新增三个字段:`toastsLive`(本页仍记着的、构造器通道的 toast 句柄数)、`toastsWithdrawn`(累计收起条数)、`lastToastWithdrawAt`(最后一次收起时间,ISO 字符串或 `null`)(`lib/client.js:3160`)。
22
+
23
+ ### 测试
24
+
25
+ - `smoke/smoke-test.cjs` 新增一节:回到页面即收起残留通知的离线用例(三条回来路径、两条通知通道、待办记录不被清掉;页面在前台时输入不会误收;「从不关闭」档照样收起)。
26
+
27
+ ### 文档
28
+
29
+ - README 中英同步:顶部特性里的「人走开但窗口没走」补一句回到页面就收起残留通知;「通知自动消失」与「离开时保留」两处改写边界(三种设置只约束定时关闭、回到页面一律收起、不看通知中心也不会被遗留通知挡着);提醒渠道一节补同样的边界;开发自检的测试清单补上这一节。
30
+ - `docs/console-config.md` / `docs/console-config.en.md` 的 `autoDismiss` 注释补一句「只管定时关闭」。
31
+
32
+ ## [1.16.1] — 2026-10-28
33
+
34
+ 文案修正,无行为变化。
35
+
36
+ ### 文档
37
+
38
+ - 设置页「会话静音」卡的说明原写「被静音的会话在标题前显示划掉的铃铛」,但那个槽位在会话有运行状态时被状态点占用——正在跑的后台任务看不到标记。说明里补上这一点,并指出此时看行尾铃铛的按下状态(中英同步)。`README.md` / `README.en.md` 的正文本来就写了这个限制,只有设置页漏了。
39
+ - 同一段里「列表上限 500 条」改成 200 条:上一版把 `MUTED_MAX` 降到 200(心跳 body 的 16 KiB 上限),README 两处漏改(`README.md:158`、`README.en.md:158`)。
40
+ - README 中英:兼容性写清实测范围——徽章与「已逐版实测真正激活」名单从 `0.2.1-rc.2` 更新到 `0.2.2-alpha.2`,补上 `0.2.1-rc.3` / `0.2.1-rc.4` / `0.2.2-alpha.2` 三版隔离实测(启动条目 71 / 71 / 72、`client.js` 返回 1.16.1 构建 248,023 B、`apply` 执行且 `debug()` 报 `bound`、设置页渲染出整块「通知提醒」)与「四个会话行槽位一个没少」的结论;`dsh.compatibility.dshReleases` 同步补 rc.3 / rc.4。
41
+ - 设置页截图重拍:旧图是 1.14.1 时代拍的(页脚版本号与「会话静音」卡片都不对),改在 `0.2.2-alpha.2` 的隔离实例里过 CDP 截取,两张 alt 文本补「会话静音 / muted sessions」。
42
+
5
43
  ## [1.16.0] — 2026-10-28
6
44
 
7
45
  回应 [#23](https://github.com/chromoany/dsh-notify-me/issues/23):可以按对话静音,只影响那一行。
@@ -71,7 +109,7 @@ All notable changes to **dsh-notify-me** are documented here.
71
109
  ### 文档
72
110
 
73
111
  - README 中英:提醒渠道补上 Linux;外部推送写明关掉转发会取消已排队的重试、服务码非成功值记失败、2xx 但不是该服务的 JSON 记「已送出不可确认」;控制台示例补 `hostEnv` 与 `debug()` 的 `raiseChannel` / `raiseLast` / `configStored`。
74
- - 致谢新增 unnamed42([#21](https://github.com/chromoany/dsh-notify-me/issues/21) / [#22](https://github.com/chromoany/dsh-notify-me/pull/22):Linux 上 `dsh://open` 抬窗失效的报障与补丁)。11 张贡献者头像统一成同一套 48×48 圆形遮罩,`dunxuan`、`Donald-Yip` 之前分别是方形和自带 alpha。
112
+ - README 致谢表补 [#21](https://github.com/chromoany/dsh-notify-me/issues/21) / [#22](https://github.com/chromoany/dsh-notify-me/pull/22):Linux 上 `dsh://open` 抬窗失效的报障与补丁。11 张贡献者头像统一成同一套 48×48 圆形遮罩(此前有的方形、有的自带 alpha)。
75
113
  - `docs/listing.md` 版本口径同步到 1.14.7。
76
114
 
77
115
  ### 测试
@@ -237,13 +275,13 @@ All notable changes to **dsh-notify-me** are documented here.
237
275
 
238
276
  ### 文档
239
277
 
240
- - README 中英:外部推送整节重写(目标类型、可靠性、状态、签名、模板、钉钉为何不支持),控制台示例补 `externalRetryDelays` 与目标字段形状,已知限制口径同步;致谢加上 [@yuexian7](https://github.com/yuexian7) 与 #17。
278
+ - README 中英:外部推送整节重写(目标类型、可靠性、状态、签名、模板、钉钉为何不支持),控制台示例补 `externalRetryDelays` 与目标字段形状,已知限制口径同步;致谢表补 #17。
241
279
 
242
280
  ## [1.12.0] — 2026-10-21
243
281
 
244
282
  ### 新增
245
283
 
246
- - **人走开但窗口没走也算离开**(来自 [#16](https://github.com/chromoany/dsh-notify-me/pull/16),[@shrekcg](https://github.com/shrekcg)):`idleMinutes`(默认 3 分钟,`0` 关掉)内没有任何键鼠输入,就把「窗口在前台」按离开处理——「需要你」照常提醒、「回复完成」按离开规则提醒、`autoDismiss: "present"` 也不再撤掉那条通知。此前只认窗口失焦 / 页面隐藏,人坐在桌前离开座位时一切都还是「你在看」。
284
+ - **人走开但窗口没走也算离开**(来自 [#16](https://github.com/chromoany/dsh-notify-me/pull/16)):`idleMinutes`(默认 3 分钟,`0` 关掉)内没有任何键鼠输入,就把「窗口在前台」按离开处理——「需要你」照常提醒、「回复完成」按离开规则提醒、`autoDismiss: "present"` 也不再撤掉那条通知。此前只认窗口失焦 / 页面隐藏,人坐在桌前离开座位时一切都还是「你在看」。
247
285
  - **闲置到期会补发被压下的审批**(维护者补的):`currentHiddenOnly` 把当前对话的等待只留标题标记时,原先只有失焦 / 页面隐藏事件才会补发;现在闲置定时器到期即补发,人离开但窗口没动也能收到。一次性触发,队列清空后不重复。
248
286
  - **「回复完成」提醒时机三选一**(#16):`donePolicy` —— `"background"`(默认,旧行为)/ `"smart"`(屏幕上那条静默,别的对话完成照常提醒)/ `"always"`(从不静默),设置页「什么时候提醒」里换成下拉。
249
287
  - **通知自动消失三选一**(#16):`autoDismiss` —— `"present"`(默认,只有你在页面时才计时关闭,离开时收到的留在通知中心)/ `"always"`(旧行为)/ `"never"`(普通通知等你点掉)。带「同意 / 拒绝」的审批通知仍按 12 秒走。
@@ -265,7 +303,7 @@ All notable changes to **dsh-notify-me** are documented here.
265
303
 
266
304
  ### 文档
267
305
 
268
- - README 中英:设置清单换成三档下拉、补闲置判定与通知自收、删「副屏与审批卡片」整节、控制台示例同步、致谢加上 [@shrekcg](https://github.com/shrekcg) 与 #16。
306
+ - README 中英:设置清单换成三档下拉、补闲置判定与通知自收、删「副屏与审批卡片」整节、控制台示例同步、致谢表补 #16。
269
307
 
270
308
  ## [1.11.0] — 2026-10-21
271
309
 
@@ -499,7 +537,7 @@ All notable changes to **dsh-notify-me** are documented here.
499
537
  - 转发挂在 `fire()` 里、本地提醒决定要发之后触发:**跟本地提醒完全同一套触发规则**(「当前对话不弹通知」「页面打开时也提醒」等开关同样管它);设置页的「测试提醒」按钮与快捷裁决反馈走 `deliver()`,不会误发 webhook。
500
538
  - 跨域(CORS)口径:先走能读回响应的 CORS POST JSON;被拒(CORS/网络错误)时降级 no-cors + `text/plain` 送出,如实标为「已送出不可确认」(响应对页面不可见是浏览器规则,读不回就没法确认);Bark 另有经典 GET(`<地址>/<标题>/<正文>`)兜底;HTTP 错误如实记失败、不盲重试。
501
539
  - 版本号 1.6.1 → 1.7.0;`window.__dshNotifyMe.version` 与 `package.json` 同步;npm 关键词新增 external-notification / webhook / discord / bark / gotify / push-notification / 外部通知 / 推送提醒。
502
- - README(中英)同步:搜索词、设置清单、提醒方式、控制台配置块(四个新键 + `testExternal()`)、已知限制的 CORS 说明;致谢名单新增 [@RiZhiZhaoYi](https://github.com/RiZhiZhaoYi)(issue #12 的功能建议)。
540
+ - README(中英)同步:搜索词、设置清单、提醒方式、控制台配置块(四个新键 + `testExternal()`)、已知限制的 CORS 说明;致谢表补 #12(功能建议)。
503
541
 
504
542
  ### 测试
505
543
  - `smoke/smoke-test.cjs` 新增两段:① 转发链路(默认零外发、toast 测试不触发转发、四类负载形状、真实提醒镜像与两类开关、主开关、no-cors 降级、HTTP 500 单次不重试、Bark GET 兜底、非法 URL 剔除与未知类型归为 custom);② 设置页「外部通知」卡片(渲染与空状态、目标增删改落配置、测试按钮反馈文案、两种静默原因的提示语)。
@@ -517,7 +555,7 @@ All notable changes to **dsh-notify-me** are documented here.
517
555
 
518
556
  ### 变更
519
557
  - 版本号 1.6.0 → 1.6.1;`window.__dshNotifyMe.version` 同步。
520
- - README(中英)致谢名单新增 [@yanzhaohui1999](https://github.com/yanzhaohui1999)(issue #13 的性能报告与 PR #14 的修复及回归断言)。
558
+ - README(中英)致谢表补 #13 / #14(性能报告与修复、回归断言)。
521
559
 
522
560
  ## [1.6.0] — 2026-10-15
523
561
 
@@ -552,7 +590,7 @@ All notable changes to **dsh-notify-me** are documented here.
552
590
 
553
591
  ### 变更
554
592
  - 版本号 1.5.2 → 1.5.3;`window.__dshNotifyMe.version` 同步。
555
- - README(中英):「桌面端怎么抬窗的 / How the Desktop window gets raised」补真实壳复测结论与触发时机口径——深链必须在带用户手势的处理器里发(通知 `onclick` 自带手势,产品路径通);无手势的脚本化注入会被 Chromium 静默丢弃、外部协议不回流,复现时看似「通道被拦死」。致谢名单新增 [@EliteOtaku](https://github.com/EliteOtaku)(issue #9 的逐层排查与三轮真实壳复测)。
593
+ - README(中英):「桌面端怎么抬窗的 / How the Desktop window gets raised」补真实壳复测结论与触发时机口径——深链必须在带用户手势的处理器里发(通知 `onclick` 自带手势,产品路径通);无手势的脚本化注入会被 Chromium 静默丢弃、外部协议不回流,复现时看似「通道被拦死」。致谢表补 [#9](https://github.com/chromoany/dsh-notify-me/issues/9)(逐层排查与三轮真实壳复测)。
556
594
 
557
595
  ### 核实
558
596
  - issue #9 真实壳三轮复测(DSH Desktop 0.2.0-rc.2 / Windows 11):点通知 = 抬窗 + 切会话一步到位,同会话、跨会话、窗口在后台均稳定 ✅,1.5.2 的抬窗修复确认生效。
@@ -617,7 +655,7 @@ All notable changes to **dsh-notify-me** are documented here.
617
655
  ### 变更
618
656
  - 版本号 1.3.1 → 1.4.0;`window.__dshNotifyMe.version` 同步。
619
657
  - README(中英)补上设置页新开关、提醒时机说明、控制台配置示例与工作原理里的子代理口径。
620
- - README(中英)新增「致谢与贡献须知 / Credits & how contributions land」:外部 PR 的署名口径与贡献者名单;「只静音后台子代理、当前打开的照常提醒」这一口径来自 [@d0ublecl1ck](https://github.com/d0ublecl1ck) 在 [#8](https://github.com/chromoany/dsh-notify-me/pull/8) 讨论里的建议(收编进 main 的原版是整条静音),本次按该口径改准并由维护者落地。
658
+ - README(中英)新增「致谢与贡献须知 / Credits & how contributions land」:外部 PR 的署名口径与贡献者名单;「只静音后台子代理、当前打开的照常提醒」这一口径来自 [#8](https://github.com/chromoany/dsh-notify-me/pull/8) 讨论里的建议(收编进 main 的原版是整条静音),本次按该口径改准并由维护者落地。
621
659
 
622
660
  ### 测试
623
661
  - `smoke/smoke-test.cjs` 新增子代理用例:`ignoreSubagent` 默认值与 `debug()` 字段、后台子代理完成不提醒而普通后台会话照常、后台子代理等待不提醒也不打标题标记、分支(fork)会话仍提醒、关掉开关后子代理的等待与完成重新提醒,以及「当前打开的子代理会话照常提醒」——等待与完成都提醒;后台积压的等待在切进去时按当前对话的规则排队补发,切走则连标题标记与排队通知一起撤下。
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 chromoany
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 chromoany
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md CHANGED
@@ -15,7 +15,7 @@
15
15
  [![test](https://github.com/chromoany/dsh-notify-me/actions/workflows/test.yml/badge.svg)](https://github.com/chromoany/dsh-notify-me/actions/workflows/test.yml)
16
16
  [![DSH Web and Desktop](https://img.shields.io/badge/DSH-Web%20%7C%20Desktop-blue?style=flat-square)](#installation)
17
17
  [![Package size](https://img.shields.io/npm/unpacked-size/dsh-notify-me?style=flat-square&label=package%20size)](https://www.npmjs.com/package/dsh-notify-me)
18
- [![DSH Compatibility](https://img.shields.io/badge/DSH-tested%200.2.1--rc.2-6366f1.svg?style=flat-square)](#compatibility)
18
+ [![DSH Compatibility](https://img.shields.io/badge/DSH-tested%200.2.2--alpha.2-6366f1.svg?style=flat-square)](#compatibility)
19
19
  [![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
20
20
 
21
21
  </div>
@@ -26,7 +26,7 @@ A notification plugin for DSH Web / Desktop, so you can afford to keep full acce
26
26
 
27
27
  - **When input is needed:** approval, plan review, and questions get a notification, a sound, and a title marker.
28
28
  - **When a background reply finishes:** come back for the result; clicking the notification returns to that conversation. Pick "background only", "quiet for the open one", or "always".
29
- - **When you walk off but the window stays in front:** over 3 minutes without input counts as away, and the alert still fires as usual; the toast that arrived does not clear itself before you come back.
29
+ - **When you walk off but the window stays in front:** over 3 minutes without input counts as away, and the alert still fires as usual; the toast that arrived does not clear itself before you come back, and is withdrawn the moment you are back at the page (taskbar, Alt-Tab or the toast itself).
30
30
  - **When you leave your computer:** optionally forward alerts to Discord, Bark, Gotify, Feishu group bots, ServerChan, WxPusher, or your own webhook.
31
31
  - **When you close the page entirely:** optional host-side fallback — with no page open the host process keeps pushing "needs you" / "reply finished" to your gateway; or turn on just the same-origin relay so the page can reach an authenticated gateway. Both are off by default and configured in the profile's patch layer (see "After the page closes" under [Advanced](#advanced)).
32
32
 
@@ -41,7 +41,7 @@ A notification plugin for DSH Web / Desktop, so you can afford to keep full acce
41
41
  <details>
42
42
  <summary>See the settings interface</summary>
43
43
 
44
- ![The Notify me settings page: header, how you get told, when to alert, try it, and the collapsed Advanced block](https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/screenshots/settings-en.png)
44
+ ![The Notify me settings page: header, how you get told, when to alert, muted sessions, try it, and the collapsed Advanced block](https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/screenshots/settings-en.png)
45
45
 
46
46
  Just the plugin's own panel (the real component, on the same dark theme as the host), without the DSH navigation sidebar; row explanations only appear once the pointer rests on the title text, which is why only the titles show here.
47
47
 
@@ -124,7 +124,7 @@ Open **Settings → Notify me**. The page lays out three blocks — how you get
124
124
  - **Also alert "needs you" while the window is in front** (on by default): off means you only hear it once the window goes to the background;
125
125
  - **Stay quiet for the conversation on screen** (on by default): a wait in the conversation you are looking at keeps only the tab marker, and is delivered once you leave;
126
126
  - **When "reply finished" alerts** (default "background only"): background only / quiet for the open one / always — pick one;
127
- - **Dismiss the toast automatically** (default "keep while away"): keep while away / always close / never close — pick one;
127
+ - **Dismiss the toast automatically** (default "keep while away"): keep while away / always close / never close — pick one; the choice only covers the closing on the timer, and leftover toasts are withdrawn once you are back at the page;
128
128
  - **Ignore subagent sessions** (on by default): skips background subagent sessions, while the one you have open still alerts;
129
129
  - **Click a toast to open that conversation** (on by default): switches to that conversation and brings the window forward — on Windows through the host route, on macOS / Linux through the `dsh://open` deep link — and with several tabs only one is raised.
130
130
 
@@ -134,7 +134,7 @@ Open **Settings → Notify me**. The page lays out three blocks — how you get
134
134
  - **What counts as background**: switching to another app, being covered by another window, or minimizing all count; a window left in front with 3 minutes of no keyboard or mouse input counts too, and `idleMinutes: 0` falls back to looking only at the window.
135
135
  - **When "stay quiet for the conversation on screen" is replayed**: as usual once the window goes to the background or the idle timer fires; if you already handled it, it is dropped.
136
136
  - **The three "reply finished" choices**: "background only" = alert when you are not watching the page; "quiet for the open one" = the one on screen stays silent while other conversations still alert, useful with several open; "always" = never suppress. An old profile's "also alert 'reply finished' while in front" switch migrates to this setting automatically.
137
- - **"Keep while away"**: while you are at the page a plain toast closes itself after a few seconds; one that arrived while you were away stays in the notification centre until you come back. A toast with Approve / Reject carries no auto-dismiss timer — it stays until you click a button, answer the request in the page, or a newer request replaces it; a desktop approval toast, which cannot render buttons, closes after 12 s and is likewise not withdrawn while you are away.
137
+ - **"Keep while away"**: while you are at the page a plain toast closes itself after a few seconds; one that arrived while you were away stays in the notification centre until you come back. It is withdrawn the moment you are back (taskbar, Alt-Tab, the toast itself, or restoring a minimized window), and none of the three options affect that — so a toast you never opened in the notification centre is not left in your way. A toast with Approve / Reject carries no auto-dismiss timer — it stays until you click a button, answer the request in the page, or a newer request replaces it; a desktop approval toast, which cannot render buttons, closes after 12 s and is likewise not withdrawn while you are away. Both are withdrawn when you come back to the page.
138
138
  - **Fallback for a toast click**: on Desktop a window that will not raise leaves only the conversation switch, with the reason in `debug().raiseLast`; turn this switch off and a click does nothing.
139
139
 
140
140
  </details>
@@ -155,7 +155,7 @@ The settings page has a "Muted sessions" card under "When to alert" with the cur
155
155
  <summary>Edge cases</summary>
156
156
 
157
157
  - The mark lives in the host's `sidebar.session.row.leading` slot, and the host puts its status dots there while a session is running, so the mark is not rendered then — a running background job shows no crossed bell until it stops. The mute itself is unaffected.
158
- - Muting keys on the session id: renaming or moving the directory changes nothing, and a deleted session is harmless in the list (capped at 500 ids; "Unmute all" clears it).
158
+ - Muting keys on the session id: renaming or moving the directory changes nothing, and a deleted session is harmless in the list (capped at 200 ids; "Unmute all" clears it).
159
159
  - Muting does not change the "reply finished" policy or "current conversation stays quiet"; when both apply, the mute wins.
160
160
 
161
161
  </details>
@@ -312,80 +312,11 @@ This is primarily a **browser-layer** plugin: local toasts, sound and the title
312
312
 
313
313
  ## Compatibility
314
314
 
315
- Per-release adaptation records live in [package.json](package.json) under `dsh.compatibility.dshReleases`; the current host (`0.2.1-rc.2`) gates installation on `peerDependencies` and `engines` only and no longer reads that field, so it is a human-readable record, not a gate.
316
-
317
- Every release was tested to **actually activate**: `0.1.1-rc.2`, `0.1.2-rc.1`, `0.1.5-rc.1`, `0.1.5-rc.2`, `0.2.0-rc.2` and `0.2.1-rc.2` (the criteria: the plugin entry lands in the boot page's `__DSH_BOOT__`, its inject dependencies resolve, `/plugins/??dsh-notify-me/client.js&rev=…` serves a build containing the new code, and the "Notify me" section appears in Settings). Plugin entries stay compatible from `0.1.1-rc.2` through `0.2.1-rc.2`, and stepping back to an older host needs no config change; the `1.9.0` settings redesign added no new host API, and the bell in the settings page header is the plugin's own SVG (`docs/brand/`).
318
-
319
- <details>
320
- <summary>Host-generation shape differences and two known traps</summary>
321
-
322
- The plugin picks its interaction source per host generation; the table below marks the boundaries of each shape, not a gate:
323
-
324
- | Host generation | "Needs you" interaction source | Current session | Toast-click navigation |
325
- | --- | --- | --- | --- |
326
- | `<= 0.1.2-alpha.1` | controller snapshot `pending[]` | snapshot `current` | `sessions.open()` |
327
- | `0.1.2-alpha.2 .. 0.1.6-alpha.1` | `uiSession.pendingInteractions` | snapshot `current` | `sessions.open()` |
328
- | `>= 0.1.6-alpha.2` (incl. `0.2.0-rc.2`, `0.2.1-rc.2`) | `uiSession.sessionStatus` | `retainedBy.mainView` | `uiWorkspace.openSession()` |
329
-
330
- The ranges are illustrative: the plugin picks its source by store shape (whenever `sessionStatus` exists it takes the new path), and the version numbers only mark where each shape appeared. The `peerDependencies` range shapes npm's peer warning — `0.2.1-rc.2` already falls inside `>=0.2.0-rc.1 <0.3.0-0`, so no exemption is needed.
331
-
332
- `0.2.1-rc.2` got a separate isolated run: an isolated `DSH_HOME` booting `dsh web` (70 boot entries) placed the plugin entry 59th, in the `application` batch, with all three inject targets present and ordered before it; `client.js` served the then-installed 1.7.0 source build (140,153 B); loaded in a headless Chromium page, `apply` ran normally and `debug()` reported `uiSession: bound`, `uiSessionSource: sessionStatus`, `bridge: active`. Host-side shapes match `0.2.0-rc.2`; no code change was needed.
333
-
334
- Two traps are worth remembering: a package listed in `dsh.client.inject` that a newer runtime no longer ships parks the client entry at `pending (waiting for services: …)` forever — which is exactly how 1.1.3 broke on `0.1.2-rc.1` and later; and when the host swaps a store or a field name nothing throws, alerts just go **silent** — `pendingInteractions`→`sessionStatus`, `list.current`→`retainedBy.mainView` and `sessions.open()`→`uiWorkspace.openSession()` were all this kind. So every adaptation has to confirm with `window.__dshNotifyMe.debug()` that it really reports `bound`.
335
-
336
- </details>
315
+ Every release from `0.1.1-rc.2` through `0.2.2-alpha.2` was tested to actually activate (the criteria: the plugin entry lands in the boot page's `__DSH_BOOT__`, its inject dependencies resolve, `/plugins/??dsh-notify-me/client.js` serves a build containing the new code, and the "Notify me" section appears in Settings). Per-release records, the host-generation shape differences and the two traps that fail silently are in **[docs/compatibility.en.md](docs/compatibility.en.md)**.
337
316
 
338
317
  ## Advanced console configuration
339
318
 
340
- The Settings page is the first entry point; to script or bulk-edit preferences, or to reset them, the config lives in `localStorage` (`dshNotifyMe.config`) and can be adjusted live from the console:
341
-
342
- <details>
343
- <summary>Console API and storage reference</summary>
344
-
345
- ```js
346
- window.__dshNotifyMe.config // view current config
347
- window.__dshNotifyMe.setConfig({
348
- enabled: true, // false = disable all reminders (master switch)
349
- language: "auto", // 'auto' follow the UI | 'zh' Simplified Chinese | 'en' English
350
- attentionHiddenOnly: false, // true = don't alert "needs you" while the page is visible
351
- currentHiddenOnly: true, // true = waits in the conversation on screen keep only the title marker (replayed once away)
352
- donePolicy: "background", // "reply finished" policy: 'background' only when away | 'smart' quiet only for the open one | 'always' always alert
353
- idleMinutes: 3, // minutes without keyboard/mouse input before "away" counts (0 = turn the idle rule off)
354
- autoDismiss: "present", // toast auto-dismiss: 'present' keep while away | 'always' always close | 'never' never close
355
- ignoreSubagent: true, // true = no alerts for background subagent sessions (the open one still alerts)
356
- mutedSessions: [], // session ids muted per conversation (written by the sidebar bell, survives reloads)
357
- sound: true, // sound switch (also governs the "system notification sound" mode)
358
- soundDone: "synth", // "reply finished" sound source: 'synth' built-in | 'custom' picked file | 'system' OS notification sound
359
- soundAttention: "synth", // "needs you" sound source, same values
360
- volume: 0.5, // volume 0..1
361
- autoFocus: true, // a toast click returns to the conversation that raised it
362
- quickActions: true, // Approve / Reject buttons on approval toasts
363
- hostEnv: "auto", // runtime: 'auto' detect | 'desktop' force the app | 'web' force the browser
364
- externalEnabled: false, // external forwarding master switch (default off: no endpoint, nothing is sent)
365
- externalAttention: true, // forward "needs you" (exactly the same trigger rules as local alerts)
366
- externalDone: true, // forward "reply finished"
367
- externalRetryDelays: [2000, 6000], // backoff for retryable failures (ms, with jitter; [] = send once)
368
- externalTargets: [] // push targets, see the field notes below
369
- })
370
- // Target shape: {id, type, url, secret?, token?, uid?, template?, enabled?}
371
- // type: 'discord' | 'bark' | 'gotify' | 'feishu' | 'serverchan' | 'wxpusher' | 'custom'
372
- // token/uid only for wxpusher (its URL is fixed to the official endpoint); secret signs Feishu bodies
373
- // and custom HMAC headers; template is optional ({{title}} {{body}} {{event}} {{time}} {{session}});
374
- // enabled:false disables that one target
375
- window.__dshNotifyMe.resetConfig() // restore defaults (also drops any picked audio files)
376
- window.__dshNotifyMe.decide("approval:3", "allowed-once") // programmatic decision: "allowed-once" | "rejected"
377
- window.__dshNotifyMe.testExternal() // explicit outbound test to valid targets; resolves {sent, unverified, failed, statuses}
378
- ```
379
-
380
- > **External-test switch boundary:** the settings page's "Send test notification" needs the "Enable reminders" and "External notifications" master switches on, but ignores the two per-kind forwarding switches. The console `testExternal()` call is an explicit test: with valid configured targets it sends to them even when those master switches are off; with no valid targets it sends nothing. Ordinary `test("done")` / `test("attention")` / `test("approval")` calls only test local alerts and never forward externally.
381
-
382
- > Picked audio files do not live in `dshNotifyMe.config`: each kind gets its own key (`dshNotifyMe.sound.done` / `dshNotifyMe.sound.attention`, holding a `{name, size, data}` data URL), because one file inflates by ~1.37× once turned into a data URL and would slow down every config read. `resetConfig()` clears both keys along with the config.
383
- >
384
- > To confirm which source is actually in effect, check `soundDone` / `soundAttention` and `customSoundDone` / `customSoundAttention` in `window.__dshNotifyMe.debug()`.
385
- >
386
- > `debug().hostBridge` is the read-only snapshot of host coordination: `state` (`idle` the probe has not answered yet; `active` the host has a fallback and this page is holding the lease with its heartbeat; `unavailable` the host is there but offers no fallback, which is what a stock install looks like — an unregistered 404 route counts here too and is not a fault; `error` the host answered nothing usable, or the gate refused this page outright), `leaseMs` (the lease the host granted, in milliseconds), `relayEnabled` and `relayPath` (the relay route, when the host enabled one), `relayUpstreamHost` / `relayUpstreamPath` (the gateway endpoint the fold matches), `lastReason` (why the last probe failed — `bad-host` / `cross-origin` / `http-403` — and `null` when it was not a fault), and `lastProbeAt` / `lastBeaconAt` (the last probe and the last heartbeat, as ISO strings or `null`). A gate refusal reads as `error` rather than as "off", because it is a configuration the user can fix: add this page's origin to the top-level `allowedOrigins` of the `- id: notify-me` entry in the profile.
387
-
388
- </details>
319
+ The Settings page is the first entry point. To script or bulk-edit preferences, reset them, or look up the external-target fields, see **[docs/console-config.en.md](docs/console-config.en.md)** — the full config keys, `decide()` / `testExternal()`, the external-test switch boundary, and how to read custom sounds and `debug().hostBridge`.
389
320
 
390
321
  ## How it works
391
322
 
@@ -394,7 +325,7 @@ The reminder core watches session state and pending interactions; approval decis
394
325
  <details>
395
326
  <summary>Event sources and graceful degradation</summary>
396
327
 
397
- The reminder core picks its interaction source per host generation (see the table above); the current session always comes from the client `sessions` service:
328
+ The reminder core picks its interaction source per host generation (see the table in [docs/compatibility.en.md](docs/compatibility.en.md)); the current session always comes from the client `sessions` service:
398
329
 
399
330
  - **The current session's** `SessionSnapshot`: a `running: true → false` edge means a reply finished;
400
331
  - **pending interactions**: a new key in `uiSession`'s `sessionStatus` (`>= 0.1.6`, per-session `pendingInteraction`) or in `pendingInteractions` (`0.1.2 .. 0.1.5`) means the agent is waiting on you — the container carries the approval tool name / reason or the question text; older hosts fall back to the controller snapshot's `pending[]`;
@@ -412,7 +343,7 @@ Notifications with Approve / Reject buttons can only be raised by a Service Work
412
343
  <details>
413
344
  <summary>Button-toast bookkeeping and window raising</summary>
414
345
 
415
- Each button toast is booked against its interaction key, and one toast claims only one wait; once the request has been answered in the page, or replaced by a newer request, clicking the leftover buttons decides nothing and just closes it quietly. Button toasts carry no auto-dismiss timer — they stay until you click or answer; plain toasts close after 5 s, and a desktop approval toast without buttons after 12 s. With "never close" selected neither kind closes itself. If you miss the click, the approval in the conversation is still waiting for you.
346
+ Each button toast is booked against its interaction key, and one toast claims only one wait; once the request has been answered in the page, or replaced by a newer request, clicking the leftover buttons decides nothing and just closes it quietly. Button toasts carry no auto-dismiss timer — they stay until you click or answer; plain toasts close after 5 s, and a desktop approval toast without buttons after 12 s. With "never close" selected neither kind closes on the timer; all three options cover that timer only, so anything still up is withdrawn once you are back at the page. If you miss the click, the approval in the conversation is still waiting for you.
416
347
 
417
348
  The "raise a window and switch its conversation" part of a body click is scheduled on the worker half as well: `client.focus()` raises exactly one window (a visible one first) and routes the conversation switch to that window alone, so several DSH tabs never fight over focus or all switch at once.
418
349
 
@@ -481,7 +412,7 @@ npm test # smoke-test (state machine) + host-route-test
481
412
  npm pack --dry-run # preview the published tarball
482
413
  ```
483
414
 
484
- `smoke/smoke-test.cjs` is the offline state-machine suite: three host generations + master switch + zh/en cases + the quick-decision bridge (worker half included) + idle detection and toast self-dismiss + toast tag length handling + the page's host-bridge probe / heartbeat / release and the shape of `debug().hostBridge`. `smoke/host-route-test.mjs` needs no local DSH and runs the `lib/index.js` route, its probe and the 403/405/501 gate on every platform.
415
+ `smoke/smoke-test.cjs` is the offline state-machine suite: three host generations + master switch + zh/en cases + the quick-decision bridge (worker half included) + idle detection and toast self-dismiss + withdrawing leftover toasts on return + toast tag length handling + the page's host-bridge probe / heartbeat / release and the shape of `debug().hostBridge`. `smoke/host-route-test.mjs` needs no local DSH and runs the `lib/index.js` route, its probe and the 403/405/501 gate on every platform.
485
416
 
486
417
  The three new suites also ship their own fake `ctx`, need no local DSH and touch no network: `smoke/page-bridge-test.mjs` runs the page-bridge route — status shape, heartbeat and release, missing intent header `403`, cross-origin `403`, bad JSON `400`, oversized `413`, the `allowedOrigins`-derived `Host` (a simulated tunnel) being let through, and path collisions; `smoke/host-fallback-test.mjs` runs the host fallback — approval dedupe, `turn/end` throttling, subagent skip, no push on a fresh lease, a push after the lease expires, an immediate push after `alive:false`, language following the heartbeat, credentials re-read after a 401, and the health probe; `smoke/relay-route-test.mjs` runs the relay — the `GET` probe, `405`, cross-origin `403`, `413`, `400`, `503`, the `200` / `502` mapping and "retry exactly once on a 401".
487
418
 
@@ -509,6 +440,7 @@ powershell -NoProfile -File lib/focus-window.ps1 -ProcessId 0 # the last line
509
440
  | <a href="https://github.com/dunxuan"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/dunxuan.png" width="40" height="40" alt="@dunxuan"></a> | [#20](https://github.com/chromoany/dsh-notify-me/issues/20): the report that alerts for the open session showed a placeholder instead of the session title |
510
441
  | <a href="https://github.com/unnamed42"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/unnamed42.png" width="40" height="40" alt="@unnamed42"></a> | [#21](https://github.com/chromoany/dsh-notify-me/issues/21) / [#22](https://github.com/chromoany/dsh-notify-me/pull/22): the Linux `dsh://open` raise-path report and patch, which brought the deep link back on macOS / Linux in 1.14.4 |
511
442
  | <a href="https://github.com/LIEGU0317"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/LIEGU0317.png" width="40" height="40" alt="@LIEGU0317"></a> | [#24](https://github.com/chromoany/dsh-notify-me/issues/24) / [#25](https://github.com/chromoany/dsh-notify-me/pull/25): the host-side fallback push and same-origin relay modules (optional, off by default), with tests and docs |
443
+ | <a href="https://github.com/ekexium"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/ekexium.png" width="40" height="40" alt="@ekexium"></a> | [#23](https://github.com/chromoany/dsh-notify-me/issues/23): the per-conversation mute request (an on/off switch per session, persistence across restarts, a mark on the session row), supported since 1.16.0 |
512
444
 
513
445
  Attribution policy: external PRs are landed as maintainer commits — the original commit is not reused and no Co-authored-by trailer is added, so GitHub's contributors graph lists the maintainer only and contributors are credited above.
514
446
 
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  [![test](https://github.com/chromoany/dsh-notify-me/actions/workflows/test.yml/badge.svg)](https://github.com/chromoany/dsh-notify-me/actions/workflows/test.yml)
16
16
  [![DSH Web and Desktop](https://img.shields.io/badge/DSH-Web%20%7C%20Desktop-blue?style=flat-square)](#安装)
17
17
  [![Package size](https://img.shields.io/npm/unpacked-size/dsh-notify-me?style=flat-square&label=package%20size)](https://www.npmjs.com/package/dsh-notify-me)
18
- [![DSH Compatibility](https://img.shields.io/badge/DSH-%E5%B7%B2%E9%80%82%E9%85%8D%200.2.1--rc.2-6366f1.svg?style=flat-square)](#兼容性)
18
+ [![DSH Compatibility](https://img.shields.io/badge/DSH-%E5%B7%B2%E9%80%82%E9%85%8D%200.2.2--alpha.2-6366f1.svg?style=flat-square)](#兼容性)
19
19
  [![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
20
20
 
21
21
  </div>
@@ -26,7 +26,7 @@ DSH Web / Desktop 的通知插件,让你敢不开完整访问,也不必一
26
26
 
27
27
  - **需要你操作时**:审批、方案确认、提问,用通知、提示音和标题标记提醒。
28
28
  - **后台回复完成时**:及时回来查看结果,点击通知可回到对应对话;提醒时机可选「仅后台 / 仅当前对话静默 / 总是提醒」。
29
- - **人走开但窗口没走**:窗口留在最前台、人却离开座位,超过 3 分钟没有输入也算离开,该提醒的照常提醒;收到的那条通知不会在你回来之前自己消失。
29
+ - **人走开但窗口没走**:窗口留在最前台、人却离开座位,超过 3 分钟没有输入也算离开,该提醒的照常提醒;收到的那条通知不会在你回来之前自己消失,一回到页面(点任务栏、Alt+Tab、点通知都算)就收起。
30
30
  - **离开电脑时**:可选转发到 Discord、Bark、Gotify、飞书群机器人、Server酱、WxPusher 或自己的 Webhook。
31
31
  - **连页面都关掉时**:可选让宿主进程兜底——页面不在时宿主继续把「需要你操作」「回复完成」推到你的网关;也可以只开同源中继,让页面够到要认证的网关。两项默认关,配置写在 profile 的 patch 层(见[高级设置](#高级设置)里的「页面关闭后:宿主侧兜底与同源中继」)。
32
32
 
@@ -41,7 +41,7 @@ DSH Web / Desktop 的通知插件,让你敢不开完整访问,也不必一
41
41
  <details>
42
42
  <summary>展开设置界面预览</summary>
43
43
 
44
- ![通知提醒设置页:页眉、提醒方式、什么时候提醒、试一试与折叠的高级设置](https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/screenshots/settings-zh.png)
44
+ ![通知提醒设置页:页眉、提醒方式、什么时候提醒、会话静音、试一试与折叠的高级设置](https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/screenshots/settings-zh.png)
45
45
 
46
46
  只截插件自己的面板(真实组件,与宿主同款深色主题),不带 DSH 左侧导航栏;每行说明在鼠标停在标题文字上时才出现,所以这里只看到标题。
47
47
 
@@ -124,7 +124,7 @@ dsh-notify-me 把「监督」和「守在屏幕前」解耦:只在真的出现
124
124
  - **窗口在前台时也提醒「需要你」**(默认开):关掉后只有窗口转到后台才提醒;
125
125
  - **当前对话不弹通知**(默认开):正看着的对话里的等待只留标签页标记,人离开后照常补发;
126
126
  - **「回复完成」什么时候提醒**(默认「仅后台」):仅后台 / 仅当前对话静默 / 总是提醒,三选一;
127
- - **通知自动消失**(默认「离开时保留」):离开时保留 / 总是关闭 / 从不关闭,三选一;
127
+ - **通知自动消失**(默认「离开时保留」):离开时保留 / 总是关闭 / 从不关闭,三选一;三种设置只管「时间到点」那一次关闭,你回到页面时残留的通知一律收起;
128
128
  - **子代理会话不提醒**(默认开):跳过后台子代理(subagent)会话,你正开着的那个照常提醒;
129
129
  - **点击通知回到对应对话**(默认开):切到对应对话并把窗口带到前台,Windows 桌面走宿主路由原生抬窗、macOS / Linux 走 `dsh://open` 深链,多个标签页只调起一个。
130
130
 
@@ -134,7 +134,7 @@ dsh-notify-me 把「监督」和「守在屏幕前」解耦:只在真的出现
134
134
  - **后台的判定**:切到别的应用、被别的窗口盖住、最小化都算;窗口一直留在前台但 3 分钟没有任何键鼠输入同样算,`idleMinutes: 0` 退回只看窗口。
135
135
  - **「当前对话不弹通知」何时补发**:窗口转到后台或闲置超时后照常提醒;若你已处理掉就作废。
136
136
  - **「回复完成」三档**:「仅后台」=不在看页面才提醒;「仅当前对话静默」=屏幕上那条静默、别的对话照常提醒,多开对话时有用;「总是提醒」=从不静默。老配置里的「窗口在前台时也提醒『回复完成』」开关自动迁移到这一项。
137
- - **「离开时保留」**:你人在页面前时,普通通知几秒后自己收;人不在时收到的那条留在通知中心等你回来。带「同意 / 拒绝」的通知不设自动撤回,留到你点按钮、回页面把请求答掉、或被新请求顶替为止;桌面端画不出按钮的审批通知按 12 秒收,人不在时同样不撤。
137
+ - **「离开时保留」**:你人在页面前时,普通通知几秒后自己收;人不在时收到的那条留在通知中心等你回来。回到页面(点任务栏、Alt+Tab、点通知、还原最小化的窗口都算)就立刻收起,三种设置都不影响这一条——不看通知中心,也不会被遗留通知挡着。带「同意 / 拒绝」的通知不设自动撤回,留到你点按钮、回页面把请求答掉、或被新请求顶替为止;桌面端画不出按钮的审批通知按 12 秒收,人不在时同样不撤,回到页面同样收起。
138
138
  - **点击通知的兜底**:桌面端抬不起来时只切对话,原因记在 `debug().raiseLast` 里;关掉这一项后点通知不做任何事。
139
139
 
140
140
  </details>
@@ -155,7 +155,7 @@ dsh-notify-me 把「监督」和「守在屏幕前」解耦:只在真的出现
155
155
  <summary>边界条件</summary>
156
156
 
157
157
  - 标记注在宿主的 `sidebar.session.row.leading` 槽位,宿主在「这条会话有运行状态」时用状态点占着这个位置,标记就不渲染——正在跑的后台任务看不到划掉的铃铛,停下后自动回来。静音本身不受影响,通知照旧不发。
158
- - 静音只看会话 id:重命名、换目录都不影响,删掉的会话留在列表里也不会报错(列表上限 500 条,恢复按钮随时清空)。
158
+ - 静音只看会话 id:重命名、换目录都不影响,删掉的会话留在列表里也不会报错(列表上限 200 条,恢复按钮随时清空)。
159
159
  - 静音不改变「回复完成」的 donePolicy 判定,也不改变「当前对话不弹通知」:两者叠加时以静音为准。
160
160
 
161
161
  </details>
@@ -312,79 +312,11 @@ profile 覆盖示例(`~/.dsh/profiles/<profile>/cordis.patch.yml`)。**`conf
312
312
 
313
313
  ## 兼容性
314
314
 
315
- 逐版本适配记录见 [package.json](package.json) 的 `dsh.compatibility.dshReleases`;当前宿主(`0.2.1-rc.2`)的安装门控只读 `peerDependencies` 与 `engines`,**不再读取这个字段**,所以它只是一份给人看的记录,不构成门禁。
316
-
317
- 已逐版实测**真正激活**于 `0.1.1-rc.2`、`0.1.2-rc.1`、`0.1.5-rc.1`、`0.1.5-rc.2`、`0.2.0-rc.2` 与 `0.2.1-rc.2`(判定标准:插件条目进启动页 `__DSH_BOOT__`、注入依赖解析通过、`/plugins/??dsh-notify-me/client.js&rev=…` 返回含新代码的构建、设置里出现「通知提醒」分区)。`0.1.1-rc.2` 到 `0.2.1-rc.2` 的插件条目照旧兼容,换回旧宿主也不需要改配置;`1.9.0` 的界面重排没有引入新的宿主 API,设置页页眉的铃铛是插件自己画的 SVG(`docs/brand/`)。
318
-
319
- <details>
320
- <summary>展开宿主代际的形状差异与两个已知坑</summary>
321
-
322
- 插件按宿主代际自动选源;下表是各形状的边界,不是门禁:
323
-
324
- | 宿主代际 | 「需要你」交互来源 | 判断当前会话 | 点通知切会话 |
325
- | --- | --- | --- | --- |
326
- | `≤ 0.1.2-alpha.1` | 控制器快照的 `pending[]` | 快照 `current` | `sessions.open()` |
327
- | `0.1.2-alpha.2 .. 0.1.6-alpha.1` | `uiSession.pendingInteractions` | 快照 `current` | `sessions.open()` |
328
- | `≥ 0.1.6-alpha.2`(含 `0.2.0-rc.2`、`0.2.1-rc.2`) | `uiSession.sessionStatus` | `retainedBy.mainView` | `uiWorkspace.openSession()` |
329
-
330
- 区间仅作示意:插件按 store 形状自动选源(`sessionStatus` 存在即走新路),版本号只是各形状的出现边界。`peerDependencies` 范围决定 npm 的 peer 提示——`0.2.1-rc.2` 已落在 `>=0.2.0-rc.1 <0.3.0-0` 里,不需要豁免。
331
-
332
- `0.2.1-rc.2` 另跑了一轮隔离验证:隔离 `DSH_HOME` 起 `dsh web`(70 个启动条目),插件条目排第 59、`application` 批,三个注入目标都在且都排在它前面;`client.js` 返回 1.7.0 源码构建(140,153 B);无头 Chromium 载入后 `apply` 正常执行,`debug()` 报 `uiSession: bound`、`uiSessionSource: sessionStatus`、`bridge: active`。宿主侧形状与 `0.2.0-rc.2` 一致,不需要改代码。
333
-
334
- 两个坑值得记住:一是 `dsh.client.inject` 里列了新版运行时已不再提供的包,客户端条目会停在 `pending (waiting for services: …)` 而永不执行——1.1.3 在 `0.1.2-rc.1` 及以后正是这样失效的;二是宿主换存储或字段名时**不会报错**,提醒只会静默失效——`pendingInteractions`→`sessionStatus`、`list.current`→`retainedBy.mainView`、`sessions.open()`→`uiWorkspace.openSession()` 都是这一类,所以每次适配都要用 `window.__dshNotifyMe.debug()` 确认真的是 `bound`。
335
-
336
- </details>
315
+ 已逐版实测在 `0.1.1-rc.2` 到 `0.2.2-alpha.2` 上真正激活(判定标准:插件条目进启动页 `__DSH_BOOT__`、注入依赖解析通过、`/plugins/??dsh-notify-me/client.js` 返回含新代码的构建、设置里出现「通知提醒」分区)。逐版适配记录、宿主代际的形状差异与两个会静默失效的坑,见 **[docs/compatibility.md](docs/compatibility.md)**。
337
316
 
338
317
  ## 控制台高级配置
339
318
 
340
- 设置页是第一入口;想脚本化/批量改或恢复默认时,偏好存 `localStorage`(`dshNotifyMe.config`),可用控制台实时调整:
341
-
342
- <details>
343
- <summary>展开控制台 API 与存储说明</summary>
344
-
345
- ```js
346
- window.__dshNotifyMe.config // 查看
347
- window.__dshNotifyMe.setConfig({
348
- enabled: true, // false = 关闭所有提醒(主开关)
349
- language: "auto", // 'auto' 跟随界面 | 'zh' 简体中文 | 'en' English
350
- attentionHiddenOnly: false, // true = 页面可见时「需要你」不提醒
351
- currentHiddenOnly: true, // true = 当前对话的等待只留标题标记(人离开后补发)
352
- donePolicy: "background", // 「回复完成」策略:'background' 仅后台 | 'smart' 仅当前对话静默 | 'always' 总是提醒
353
- idleMinutes: 3, // 超过多少分钟没有键鼠输入算「离开」(0 = 关掉闲置判定)
354
- autoDismiss: "present", // 通知自动消失:'present' 离开时保留 | 'always' 总是关闭 | 'never' 从不关闭
355
- ignoreSubagent: true, // true = 后台子代理(subagent)会话不提醒(当前打开的照常)
356
- mutedSessions: [], // 按对话静音的会话 id 列表(侧边栏铃铛写入,重载后仍在)
357
- sound: true, // 提示音开关(含「系统通知音」模式)
358
- soundDone: "synth", // 「完成」音效来源:'synth' 内置 | 'custom' 自定义文件 | 'system' 系统通知音
359
- soundAttention: "synth", // 「需要你」音效来源,取值同上
360
- volume: 0.5, // 音量 0~1
361
- autoFocus: true, // 点通知回到提醒所属的对话
362
- quickActions: true, // 审批通知上的「同意 / 拒绝」按钮
363
- hostEnv: "auto", // 运行环境:'auto' 自动识别 | 'desktop' 强制桌面端 | 'web' 强制 Web
364
- externalEnabled: false, // 外部通知转发主开关(默认关:不填端点就什么都不发)
365
- externalAttention: true, // 转发「需要你」(触发规则跟本地提醒完全一致)
366
- externalDone: true, // 转发「回复完成」
367
- externalRetryDelays: [2000, 6000], // 可重试失败的退避间隔(毫秒,带抖动;[] = 只发一次)
368
- externalTargets: [] // 推送目标,见下方字段说明
369
- })
370
- // 目标的形状:{id, type, url, secret?, token?, uid?, template?, enabled?}
371
- // type: 'discord' | 'bark' | 'gotify' | 'feishu' | 'serverchan' | 'wxpusher' | 'custom'
372
- // token/uid 只用于 wxpusher(url 固定为官方端点);secret 用于飞书签名与自定义 HMAC 签名;
373
- // template 可选,占位符 {{title}} {{body}} {{event}} {{time}} {{session}};enabled:false 单独停用该目标
374
- window.__dshNotifyMe.resetConfig() // 恢复默认(同时清掉已选的自定义音效文件)
375
- window.__dshNotifyMe.decide("approval:3", "allowed-once") // 程序化裁决:"allowed-once" | "rejected"
376
- window.__dshNotifyMe.testExternal() // 显式外发测试:向有效目标发送,返回 {sent, unverified, failed, statuses}
377
- ```
378
-
379
- > **外部通知测试的开关边界**:设置页「发送测试通知」要求「启用提醒」与「外部通知」主开关开启,但忽略两类提醒的转发开关。控制台 `testExternal()` 是显式测试调用:只要配置了有效目标,即使上述主开关关闭,也会向这些目标发送测试消息;没有有效目标则不发送。普通的 `test("done")` / `test("attention")` / `test("approval")` 只测试本地提醒,不外发。
380
-
381
- > 自定义音效文件不在 `dshNotifyMe.config` 里,而是按类别各存一个键(`dshNotifyMe.sound.done` / `dshNotifyMe.sound.attention`,内容是 `{name, size, data}` 的 data URL)——一个文件转成 data URL 会膨胀约 1.37 倍,塞进配置会拖慢每次读取。`resetConfig()` 会连这两个键一起清掉。
382
- >
383
- > 想确认当前生效的来源,看 `window.__dshNotifyMe.debug()` 的 `soundDone` / `soundAttention` 与 `customSoundDone` / `customSoundAttention`。
384
- >
385
- > `debug().hostBridge` 是宿主协调的只读快照:`state`(`idle` 还没探到;`active` 宿主有兜底、本页正用心跳占住租约;`unavailable` 宿主在但没有兜底,默认安装即如此——路由没注册的 404 也算这一档,不是故障;`error` 宿主答不出可用回包,或被闸门直接拒了)、`leaseMs`(宿主授予的租约,毫秒)、`relayEnabled` 与 `relayPath`(宿主启用了中继时给出它的路径)、`relayUpstreamHost` / `relayUpstreamPath`(中继上游网关的主机名与路径,即会被折叠的那个端点)、`lastReason`(上一次探测失败的原因,如 `bad-host` / `cross-origin` / `http-403`,正常时为 `null`)、`lastProbeAt` / `lastBeaconAt`(最近一次探测与心跳的时间,ISO 字符串或 `null`)。闸门拒绝算 `error` 而不是「未启用」,因为那是能自己修的配置:把本页来源补进 profile 里 `- id: notify-me` 顶层的 `allowedOrigins`。
386
-
387
- </details>
319
+ 设置页是第一入口。想脚本化批量改、恢复默认,或查外部通知目标的字段,见 **[docs/console-config.md](docs/console-config.md)**——完整的配置键、`decide()` / `testExternal()` 接口、外部通知测试的开关边界,以及自定义音效和 `debug().hostBridge` 的读法都在那里。
388
320
 
389
321
  ## 工作原理
390
322
 
@@ -393,7 +325,7 @@ window.__dshNotifyMe.testExternal() // 显式外发测试:向有
393
325
  <details>
394
326
  <summary>展开事件来源与降级说明</summary>
395
327
 
396
- 提醒核心按宿主代际取源(见上表),当前会话一律来自客户端 `sessions` 服务:
328
+ 提醒核心按宿主代际取源(对照表见 [docs/compatibility.md](docs/compatibility.md)),当前会话一律来自客户端 `sessions` 服务:
397
329
 
398
330
  - **当前会话** `SessionSnapshot`:`running` true→false = 回复完成;
399
331
  - **待办交互**:`uiSession` 的 `sessionStatus`(`≥ 0.1.6`,逐会话 `pendingInteraction`)或 `pendingInteractions`(`0.1.2 .. 0.1.5`)出现新 key = 模型在等你,容器里带上审批工具名 / 理由、提问文本;旧宿主回落到控制器快照的 `pending[]`;
@@ -411,7 +343,7 @@ window.__dshNotifyMe.testExternal() // 显式外发测试:向有
411
343
  <details>
412
344
  <summary>展开按钮通知的记账与调窗口</summary>
413
345
 
414
- 每条按钮通知按交互 key 记账,一次只认领一条等待;请求被页面里答掉、或被新请求顶替之后,残留通知上的按钮再点也不会误裁,只是安静地关掉。带按钮的通知不设自动撤回,等你点按钮或把请求答掉才消失;普通通知 5 秒自收,桌面端没有按钮的审批通知 12 秒自收。「通知自动消失」选「从不关闭」时,这两类都不收。没来得及点就回页面里裁决,对话里的审批一直等着你。
346
+ 每条按钮通知按交互 key 记账,一次只认领一条等待;请求被页面里答掉、或被新请求顶替之后,残留通知上的按钮再点也不会误裁,只是安静地关掉。带按钮的通知不设自动撤回,等你点按钮或把请求答掉才消失;普通通知 5 秒自收,桌面端没有按钮的审批通知 12 秒自收。「通知自动消失」选「从不关闭」时,这两类都不因到点而收;三种设置都只管定时器那一次关闭,你回到页面时残留的通知一律收起。没来得及点就回页面里裁决,对话里的审批一直等着你。
415
347
 
416
348
  点正文的「调窗口 + 切对话」也归 worker 这半侧调度:`client.focus()` 只调起一个窗口(优先当前可见的),也只让那个窗口切对话——多个 DSH 标签页不会互相抢焦点或一起乱切。
417
349
 
@@ -480,7 +412,7 @@ npm test # smoke-test(状态机)+ host-route-test(
480
412
  npm pack --dry-run # 预览发布包
481
413
  ```
482
414
 
483
- `smoke/smoke-test.cjs` 是离线状态机测试:三代宿主 + 主开关 + 中英语言用例 + 快捷裁决桥(Service Worker 半侧一并跑)+ 闲置判定与通知自收 + 通知标签长度收口 + 页面侧 host-bridge 探测/心跳/释放与 `debug().hostBridge` 形状。`smoke/host-route-test.mjs` 不需要本机 DSH,`lib/index.js` 的路由、探针与 403/405/501 闸门在任何平台都会跑。
415
+ `smoke/smoke-test.cjs` 是离线状态机测试:三代宿主 + 主开关 + 中英语言用例 + 快捷裁决桥(Service Worker 半侧一并跑)+ 闲置判定与通知自收 + 回到页面即收起残留通知 + 通知标签长度收口 + 页面侧 host-bridge 探测/心跳/释放与 `debug().hostBridge` 形状。`smoke/host-route-test.mjs` 不需要本机 DSH,`lib/index.js` 的路由、探针与 403/405/501 闸门在任何平台都会跑。
484
416
 
485
417
  新增的三个套件同样自带假 `ctx`、不联网、不需要本机 DSH:`smoke/page-bridge-test.mjs` 跑页面桥接路由的状态回包形状、心跳与释放、缺意图头 `403`、跨源 `403`、坏 JSON `400`、超长 `413`,以及 `allowedOrigins` 派生的 `Host`(模拟隧道)放行与路径冲突;`smoke/host-fallback-test.mjs` 跑宿主兜底——审批去重、`turn/end` 节流、子代理跳过、租约新鲜时不发、租约过期后发、`alive:false` 后立刻发、语言跟随心跳、401 后重读凭据、健康探针;`smoke/relay-route-test.mjs` 跑中继——`GET` 探针、`405`、跨源 `403`、`413`、`400`、`503`、`200` / `502` 映射与「401 只重试一次」。
486
418
 
@@ -508,6 +440,7 @@ powershell -NoProfile -File lib/focus-window.ps1 -ProcessId 0 # 末行应是 F
508
440
  | <a href="https://github.com/dunxuan"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/dunxuan.png" width="40" height="40" alt="@dunxuan"></a> | [#20](https://github.com/chromoany/dsh-notify-me/issues/20):当前会话的通知正文用占位符、未取会话标题的报告 |
509
441
  | <a href="https://github.com/unnamed42"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/unnamed42.png" width="40" height="40" alt="@unnamed42"></a> | [#21](https://github.com/chromoany/dsh-notify-me/issues/21) / [#22](https://github.com/chromoany/dsh-notify-me/pull/22):Linux 上 `dsh://open` 抬窗失效的报障与补丁,1.14.4 起 macOS / Linux 恢复深链抬窗 |
510
442
  | <a href="https://github.com/LIEGU0317"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/LIEGU0317.png" width="40" height="40" alt="@LIEGU0317"></a> | [#24](https://github.com/chromoany/dsh-notify-me/issues/24) / [#25](https://github.com/chromoany/dsh-notify-me/pull/25):页面关闭后由宿主兜底推送、同源中继两个可选模块(默认关),含测试与文档 |
443
+ | <a href="https://github.com/ekexium"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/ekexium.png" width="40" height="40" alt="@ekexium"></a> | [#23](https://github.com/chromoany/dsh-notify-me/issues/23):按对话静音的诉求(每会话一个开关、跨重启持久化、会话行上带标记),1.16.0 起支持 |
511
444
 
512
445
  署名口径:本仓库收编外部 PR 时以维护者提交落地——不沿用原 commit、不挂 Co-authored-by,GitHub 的 contributors 图只显示维护者,贡献者以上面的致谢署名。
513
446
 
package/lib/client.js CHANGED
@@ -1339,6 +1339,59 @@
1339
1339
  };
1340
1340
  try { console.warn("[dsh-notify-me] toast refused (" + lastToastReject.length + "-char tag): " + message); } catch (e) {}
1341
1341
  }
1342
+ // ─────────── withdrawing what is left over when the user comes back ───────
1343
+ // A toast raised while the page was away is kept on purpose (see the
1344
+ // autoDismiss note in showToast): walking off must never cost an alert.
1345
+ // Nothing used to withdraw it once the user was back, though — it hovered
1346
+ // over the very conversation it was about, or sat in the Action Center,
1347
+ // until its own timer or a click. Getting back to the page always ends in
1348
+ // one of three events (window focus, visibility, the first input after an
1349
+ // idle stretch) whichever route was used: taskbar, alt-tab, clicking the
1350
+ // notification itself, a restored window. All three mean the same thing —
1351
+ // the page is in front of the user again — so they all withdraw the
1352
+ // leftovers. Closing a toast only removes it from the screen: pendingActions
1353
+ // is untouched, so an approval is still answerable in the conversation
1354
+ // (and its answer still closes whatever toast a retry raises).
1355
+ var liveToasts = []; // constructor-path handles: { tag, close }
1356
+ var toastsWithdrawn = 0;
1357
+ var lastToastWithdrawAt = null;
1358
+ var LIVE_TOASTS_LIMIT = 24; // the platform shows far fewer; this is a leak guard
1359
+ function noteToastWithdraw(n) {
1360
+ if (!n) return;
1361
+ toastsWithdrawn += n;
1362
+ lastToastWithdrawAt = new Date().toISOString();
1363
+ }
1364
+ function trackToast(tag, close) {
1365
+ liveToasts.push({ tag: tag, close: close });
1366
+ if (liveToasts.length > LIVE_TOASTS_LIMIT) liveToasts.splice(0, liveToasts.length - LIVE_TOASTS_LIMIT);
1367
+ }
1368
+ function withdrawToasts() {
1369
+ var list = liveToasts;
1370
+ liveToasts = [];
1371
+ for (var i = 0; i < list.length; i++) {
1372
+ try { list[i].close(); } catch (e) {}
1373
+ }
1374
+ noteToastWithdraw(list.length);
1375
+ // The worker path gives no handle back, so ask the registration for its
1376
+ // list: every notification under it is the plugin's own, which also
1377
+ // covers toasts raised before a page reload (this page instance never
1378
+ // held those). Closing is idempotent on both paths.
1379
+ if (swRegistration && typeof swRegistration.getNotifications === "function") {
1380
+ try {
1381
+ var done = function (notes) {
1382
+ var n = (notes || []).length;
1383
+ for (var j = 0; j < n; j++) {
1384
+ try { notes[j].close(); } catch (e) {}
1385
+ }
1386
+ noteToastWithdraw(n);
1387
+ };
1388
+ var r = swRegistration.getNotifications();
1389
+ if (r && typeof r.then === "function") r.then(done, function () {});
1390
+ else done(r);
1391
+ } catch (e) {}
1392
+ }
1393
+ return list.length;
1394
+ }
1342
1395
  function showToast(kind, title, body, sessionId, quick) {
1343
1396
  if (!canToast()) return;
1344
1397
  var tag = quick ? quick.tag : uniqueToastTag(kind);
@@ -1388,6 +1441,9 @@
1388
1441
  silent: !systemCue(kind),
1389
1442
  icon: (location.origin || "") + "/favicon.svg"
1390
1443
  });
1444
+ // The handle is the only way to withdraw this one later; withdrawToasts()
1445
+ // fires whenever the user is back at the page.
1446
+ trackToast(tag, function () { n.close(); });
1391
1447
  if (config.autoFocus) {
1392
1448
  n.onclick = function () {
1393
1449
  focusSession(sessionId);
@@ -2171,7 +2227,13 @@
2171
2227
  try {
2172
2228
  if (typeof document.hasFocus === "function") pageFocused = document.hasFocus() !== false;
2173
2229
  } catch (e) {}
2174
- function onPageFocus() { pageFocused = true; }
2230
+ function onPageFocus() {
2231
+ pageFocused = true;
2232
+ // Back at the page, whatever brought it forward — the taskbar, alt-tab, a
2233
+ // click on the notification itself, or the window being restored. The
2234
+ // alerts kept while away have done their job (see withdrawToasts()).
2235
+ try { withdrawToasts(); } catch (e) {}
2236
+ }
2175
2237
  function onPageBlur() {
2176
2238
  pageFocused = false;
2177
2239
  // Walking away is what re-arms the waits kept quiet because they belonged
@@ -2184,7 +2246,14 @@
2184
2246
  // away too. Everything that keys on away() benefits without changing shape.
2185
2247
  var lastActivityAt = Date.now();
2186
2248
  function noteActivity() {
2249
+ // The other way back, and the one that fires no focus event: the window
2250
+ // never lost focus, its owner simply stopped touching it (idleMinutes).
2251
+ // The first input after that stretch is a return, so it withdraws the
2252
+ // leftovers exactly like onPageFocus() does — read before the clock is
2253
+ // reset, otherwise the stretch has already ended.
2254
+ var returning = idleExpired();
2187
2255
  lastActivityAt = Date.now();
2256
+ if (returning) { try { withdrawToasts(); } catch (e) {} }
2188
2257
  if (!idleTimer) armIdle();
2189
2258
  }
2190
2259
  // Registered from the watchers effect (see apply below) so a client-plugin
@@ -2932,7 +3001,7 @@
2932
3001
  });
2933
3002
  } catch (e) {}
2934
3003
  // keep in sync with package.json "version" on every release
2935
- api.version = "1.16.0";
3004
+ api.version = "1.17.0";
2936
3005
  api.setConfig = function (patch) { return setConfigLocal(patch); };
2937
3006
  api.resetConfig = function () {
2938
3007
  try {
@@ -3084,7 +3153,13 @@
3084
3153
  // #18).
3085
3154
  notifyTagBudget: toastTagBudget(),
3086
3155
  notifyTagLimit: TOAST_TAG_LIMIT,
3087
- lastToastReject: lastToastReject
3156
+ lastToastReject: lastToastReject,
3157
+ // Coming back to the page withdraws the toasts that were kept while
3158
+ // away. Count + timestamp, so "did it close by itself or did I never see
3159
+ // it" is answerable from the page instead of guessed from a screenshot.
3160
+ toastsLive: liveToasts.length,
3161
+ toastsWithdrawn: toastsWithdrawn,
3162
+ lastToastWithdrawAt: lastToastWithdrawAt
3088
3163
  };
3089
3164
  };
3090
3165
  window.__dshNotifyMe = api;
@@ -3222,7 +3297,7 @@
3222
3297
  dpSmart: "仅当前对话静默",
3223
3298
  dpAlways: "总是提醒",
3224
3299
  autoDismiss: "通知自动消失",
3225
- autoDismissHint: "离开电脑时收到的那条,回来还要能看见。选「离开时保留」时只在你看页面时才关掉。",
3300
+ autoDismissHint: "离开电脑时收到的那条会留到你回来。三种设置管的都只是「时间到点」那次关闭;一旦你切回页面(点任务栏、Alt+Tab、点通知都算),残留的通知一律收起。",
3226
3301
  adPresent: "离开时保留",
3227
3302
  adAlways: "总是关闭",
3228
3303
  adNever: "从不关闭",
@@ -3259,7 +3334,7 @@
3259
3334
  offHint: "已关闭提醒:先打开「启用提醒」再测试。",
3260
3335
  storageFailed: "设置没能保存:浏览器拒绝了这次本地存储写入(空间不足或存储被禁用),改动只在当前页面有效,刷新即还原。",
3261
3336
  secMute: "会话静音",
3262
- muteHint: "把鼠标移到侧边栏的会话上,点铃铛就只关掉这一条会话的提醒:被静音的会话在标题前显示划掉的铃铛,其它会话照旧提醒。",
3337
+ muteHint: "把鼠标移到侧边栏的会话上,点铃铛就只关掉这一条会话的提醒:被静音的会话在标题前显示划掉的铃铛,正在运行的会话那里被状态点占着,此时看行尾铃铛的按下状态;其它会话照旧提醒。",
3263
3338
  muteNone: "还没有静音的会话。",
3264
3339
  muteMuted: "已静音会话数:",
3265
3340
  muteClear: "全部取消静音",
@@ -3397,7 +3472,7 @@
3397
3472
  dpSmart: "Quiet for the open one",
3398
3473
  dpAlways: "Always",
3399
3474
  autoDismiss: "Dismiss the toast automatically",
3400
- autoDismissHint: "An alert that arrived while you were away should still be there when you return. \"Keep while away\" only tidies up while the page is in front.",
3475
+ autoDismissHint: "An alert that arrived while you were away waits for you here. All three options cover the timer only — once you are back at the page (taskbar, Alt-Tab or the notification itself), any leftover toast is withdrawn.",
3401
3476
  adPresent: "Keep while away",
3402
3477
  adAlways: "Always close",
3403
3478
  adNever: "Never close",
@@ -3434,7 +3509,7 @@
3434
3509
  offHint: "Reminders are off: enable them first, then test.",
3435
3510
  storageFailed: "Settings were not saved: the browser refused this local-storage write (quota or storage disabled), so the change lasts only for this page and is gone on reload.",
3436
3511
  secMute: "Muted sessions",
3437
- muteHint: "Hover a session in the sidebar and click the bell to silence just that conversation: a muted session shows a crossed bell before its title, and the other sessions keep alerting.",
3512
+ muteHint: "Hover a session in the sidebar and click the bell to silence just that conversation: a muted session shows a crossed bell before its title — while a session is running that spot holds the status dots, so the hover bell (pressed, struck through) is where the state shows then; other sessions keep alerting.",
3438
3513
  muteNone: "No session is muted.",
3439
3514
  muteMuted: "Muted sessions: ",
3440
3515
  muteClear: "Unmute all",
@@ -4698,7 +4773,15 @@
4698
4773
  unsubs.push(sessionsSvc.list.subscribe(onListChanged));
4699
4774
  // A wait kept quiet because it was already on screen still has to
4700
4775
  // reach the user the moment they leave the page.
4701
- var onVisibility = function () { try { flushQuieted(); } catch (e) {} };
4776
+ // Two directions, two jobs: leaving delivers the waits kept quiet only
4777
+ // because their conversation was on screen; coming back withdraws the
4778
+ // toasts raised for them (a restored window reports this, and not
4779
+ // always a focus event). Withdraw first so a toast flushed in the same
4780
+ // tick cannot be closed before it is ever seen.
4781
+ var onVisibility = function () {
4782
+ try { if (!hidden()) withdrawToasts(); } catch (e) {}
4783
+ try { flushQuieted(); } catch (e) {}
4784
+ };
4702
4785
  try { document.addEventListener("visibilitychange", onVisibility); } catch (e) {}
4703
4786
  unsubs.push(function () { try { document.removeEventListener("visibilitychange", onVisibility); } catch (e) {} });
4704
4787
  for (var ai = 0; ai < ACTIVITY_EVENTS.length; ai++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-notify-me",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "离开 DSH 页面也能收到提醒:需要你操作 / 后台回复完成时发系统通知、标题标记与提示音,支持审批快捷裁决与外部推送,Web 版与桌面版均可用。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -104,6 +104,8 @@
104
104
  "0.1.5-rc.2": "compatible",
105
105
  "0.2.0-rc.2": "compatible",
106
106
  "0.2.1-rc.2": "compatible",
107
+ "0.2.1-rc.3": "compatible",
108
+ "0.2.1-rc.4": "compatible",
107
109
  "0.2.2-alpha.2": "compatible"
108
110
  }
109
111
  }