dsh-notify-me 1.14.2 → 1.14.3
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 +3 -2
- package/README.md +3 -2
- package/lib/client.js +22 -5
- 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.14.3] — 2026-10-26
|
|
6
|
+
|
|
7
|
+
### 修复
|
|
8
|
+
|
|
9
|
+
- **当前会话的通知正文改用真实会话标题**:以前关于「已经在屏幕上的那个会话」的通知,「回复完成」的正文、以及「需要你」的会话行,对当前会话第一行写死占位符「当前对话 / Current conversation」,而其他会话都带侧栏标题。现在当前会话也从同一条列表行取标题(新增 `sessionTitleOf()`,与侧栏同一个 `displayTitle`/`title`,宿主改名后下一条通知即生效);只有列表还没给出标题的新会话(或列表里暂时没有这一行)才回落到占位符。宿主 0.1.x 与 0.2.x 共用这条 adapter,两代都修复(issue #20)。
|
|
10
|
+
|
|
11
|
+
### 测试
|
|
12
|
+
|
|
13
|
+
- 冒烟新增 `currentSessionTitle()`:当前会话的「需要你」正文以会话标题开头、不含「当前对话」;「回复完成」正文等于标题;没有标题的会话仍回落「当前对话」。`modernHost()` 里当前会话「回复完成」的断言从占位符改为列表标题。`npm test` 全绿(冒烟 + cordis 真宿主两套)。
|
|
14
|
+
|
|
15
|
+
### 文档
|
|
16
|
+
|
|
17
|
+
- `docs/listing.md` 版本口径同步到 1.14.3。
|
|
18
|
+
|
|
5
19
|
## [1.14.2] — 2026-10-24
|
|
6
20
|
|
|
7
21
|
### 修复
|
package/README.en.md
CHANGED
|
@@ -80,7 +80,7 @@ Web users can also test the approval buttons, which then appear on the notificat
|
|
|
80
80
|
window.__dshNotifyMe.test("done") // "reply finished" sample
|
|
81
81
|
window.__dshNotifyMe.test("attention") // "needs you" sample
|
|
82
82
|
window.__dshNotifyMe.test("approval") // Approve / Reject when the bridge is available; a plain notification otherwise (which is what Desktop gets)
|
|
83
|
-
window.__dshNotifyMe.debug() // the bridge field reports the state
|
|
83
|
+
window.__dshNotifyMe.debug() // the bridge field reports the state ("active" = buttons work); a refused toast leaves its platform message in lastToastReject
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
If no test notification appears, check in this order: whether the notification permission was declined (click once on the page and choose **Allow**; or address-bar lock → Site settings → Notifications → Allow → reload), whether DSH was restarted after installing, and whether the browser's notifications are switched off in the OS settings.
|
|
@@ -327,6 +327,7 @@ The cases where it will not raise are the same ones listed under [Known limitati
|
|
|
327
327
|
**Platform differences**
|
|
328
328
|
|
|
329
329
|
- Quick-decision buttons need a Service Worker: `http://127.0.0.1` and `https` work, `http://192.168.x.x`-style LAN addresses do not; **the Desktop (`dsh-app://`) is tested and cannot register a Service Worker** (the host does not grant the `allowServiceWorkers` privilege), so approval toasts fall back to their buttonless form. When the host renders no notification buttons, the `bridge` field of `debug()` explains why, and nothing else is affected.
|
|
330
|
+
- Windows caps a toast tag at 64 characters, and Chromium hands the platform the whole `n#<origin>#<tag>` string — the desktop page's `dsh-app://app` alone takes 16. The plugin sizes each tag against the current `location.origin` and, when it does not fit, keeps a readable prefix and swaps the tail for a short hash, so a tag seen through `debug()` may be shortened; if the platform still refuses one, its message lands in `debug().lastToastReject` and the settings test button reports it instead of claiming the toast was sent.
|
|
330
331
|
- On Desktop (Windows) a toast click can still fail to raise the window: when the target window is owned by a higher integrity level (elevated / UAC), sits on another virtual desktop, has its foreground repeatedly stolen by another process, or is hidden to the tray with `SW_HIDE`, the host script answers `FOCUSED=0` and the route answers `202`, with the conversation switch intact (see [How the Desktop window gets raised](#how-the-desktop-window-gets-raised)).
|
|
331
332
|
- macOS: alerts, sound, the title marker and toast-click navigation carry no platform assumptions and work as usual; but DSH Desktop (Electron) system notifications require the app to be signed — an unsigned build simply emits no notification — and whether the official macOS build meets that precondition is untested; notification button rendering on the macOS desktop host is likewise untested (the Windows desktop host is tested and renders none).
|
|
332
333
|
|
|
@@ -349,7 +350,7 @@ The cases where it will not raise are the same ones listed under [Known limitati
|
|
|
349
350
|
```powershell
|
|
350
351
|
node --check lib\client.js
|
|
351
352
|
node --check lib\index.js
|
|
352
|
-
node smoke\smoke-test.cjs # offline state-machine test: three host generations + master switch + zh/en cases + the quick-decision bridge (worker half included) + idle detection and toast self-dismiss
|
|
353
|
+
node smoke\smoke-test.cjs # offline state-machine test: 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
|
|
353
354
|
node smoke\cordis-host-test.mjs # real-cordis end-to-end (skips when no local DSH installation is found)
|
|
354
355
|
powershell -NoProfile -File lib\focus-window.ps1 -ProcessId 0 # manual raise test, the last line should be FOCUSED=1
|
|
355
356
|
npm pack --dry-run # preview the published tarball
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ Web 用户可再测审批按钮,通知上会带「同意 / 拒绝」。桌面
|
|
|
80
80
|
window.__dshNotifyMe.test("done") // 「完成」示例
|
|
81
81
|
window.__dshNotifyMe.test("attention") // 「需要你」示例
|
|
82
82
|
window.__dshNotifyMe.test("approval") // 桥可用时带「同意 / 拒绝」按钮;否则只发普通通知(桌面端即如此)
|
|
83
|
-
window.__dshNotifyMe.debug() // 桥接状态看 bridge
|
|
83
|
+
window.__dshNotifyMe.debug() // 桥接状态看 bridge 字段(active = 按钮可用);最近一次被平台拒发的原因在 lastToastReject
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
没有测试通知时,先检查:通知权限是否被拒绝(在页面上点一下 → 选「允许」;或地址栏锁 → 站点设置 → 通知 → 允许 → 刷新)、装完没重启 DSH、系统设置里浏览器通知被关。
|
|
@@ -326,6 +326,7 @@ DSH Desktop 是一层 Electron 壳,页面跑在 `dsh-app://app` 下:DOM 的
|
|
|
326
326
|
**平台差异**
|
|
327
327
|
|
|
328
328
|
- 快捷裁决按钮要 Service Worker:`http://127.0.0.1`、`https` 可用,`http://192.168.x.x` 这类局域网地址不行;**桌面端(`dsh-app://`)已实测无法注册 Service Worker**(宿主未开放 `allowServiceWorkers` 特权),审批通知退回无按钮样式。宿主不渲染通知按钮时,`debug()` 的 `bridge` 字段会说明原因,其余功能不受影响。
|
|
329
|
+
- Windows 的系统通知标签上限 64 字符,而 Chromium 交给平台的是 `n#<origin>#<tag>` 整串——桌面页面 `dsh-app://app` 一项就占去 16 个。插件按当前 `location.origin` 算剩余预算,超长时保留可读前缀、尾部换成短哈希,所以 `debug()` 里看到的标签可能被截短;平台仍然拒发时,原文记在 `debug().lastToastReject`,设置页的测试按钮也会如实报出来,不再「提示已发送但什么都没弹」。
|
|
329
330
|
- 桌面端(Windows)点通知后窗口仍可能抬不起来:目标窗口属于更高完整性级别(提权 / UAC)、在另一个虚拟桌面、前台被别的进程反复抢回去,或窗口被 `SW_HIDE` 隐藏到托盘时,宿主脚本回 `FOCUSED=0`、路由回 `202`,对话照常切(详见[桌面端怎么抬窗的](#桌面端怎么抬窗的))。
|
|
330
331
|
- macOS:提醒、提示音、标题标记、点通知跳转都没有平台假设,照常工作;但 DSH Desktop(Electron)的系统通知要求应用已签名,未签名的通知直接发不出去,官方 macOS 版是否满足这一前提未实测;审批按钮在 macOS 桌面宿主上的渲染同样未实测(Windows 桌面端已实测不渲染)。
|
|
331
332
|
|
|
@@ -348,7 +349,7 @@ DSH Desktop 是一层 Electron 壳,页面跑在 `dsh-app://app` 下:DOM 的
|
|
|
348
349
|
```powershell
|
|
349
350
|
node --check lib\client.js
|
|
350
351
|
node --check lib\index.js
|
|
351
|
-
node smoke\smoke-test.cjs # 离线状态机冒烟测试:三代宿主 + 主开关 + 中英语言用例 + 快捷裁决桥(Service Worker 半侧一并跑)+ 闲置判定与通知自收
|
|
352
|
+
node smoke\smoke-test.cjs # 离线状态机冒烟测试:三代宿主 + 主开关 + 中英语言用例 + 快捷裁决桥(Service Worker 半侧一并跑)+ 闲置判定与通知自收 + 通知标签长度收口
|
|
352
353
|
node smoke\cordis-host-test.mjs # 真 cordis 端到端(找不到本机 DSH 时自动跳过)
|
|
353
354
|
powershell -NoProfile -File lib\focus-window.ps1 -ProcessId 0 # 手动验证抬窗脚本,末行应是 FOCUSED=1
|
|
354
355
|
npm pack --dry-run # 预览发布包
|
package/lib/client.js
CHANGED
|
@@ -1702,13 +1702,26 @@
|
|
|
1702
1702
|
fire("attention", copy.title, copy.body, false, copy.sessionId, copy.quick || null);
|
|
1703
1703
|
}
|
|
1704
1704
|
}
|
|
1705
|
-
// A display label for a session row
|
|
1706
|
-
// "当前对话 / Current
|
|
1705
|
+
// A display label for a session row; an empty label and the legacy
|
|
1706
|
+
// "current" sentinel fall back to the localized "当前对话 / Current
|
|
1707
|
+
// conversation" placeholder, which now only stands in for a session whose
|
|
1708
|
+
// title the list cannot supply yet.
|
|
1707
1709
|
function sessionLabelText(row) {
|
|
1708
1710
|
var raw = row && row.label;
|
|
1709
1711
|
if (!raw || raw === "current") return texts().current;
|
|
1710
1712
|
return raw;
|
|
1711
1713
|
}
|
|
1714
|
+
// The session's own sidebar title, or "" while the host has not published
|
|
1715
|
+
// one (a brand-new session) or the list does not carry the row at all.
|
|
1716
|
+
// Read live, so a title the host fills in later reaches the next alert.
|
|
1717
|
+
function sessionTitleOf(sid) {
|
|
1718
|
+
try {
|
|
1719
|
+
var st = listStore && listStore.getSnapshot();
|
|
1720
|
+
var sum = st && st.byId && st.byId[sid];
|
|
1721
|
+
if (sum) return sum.displayTitle || sum.title || "";
|
|
1722
|
+
} catch (e) {}
|
|
1723
|
+
return "";
|
|
1724
|
+
}
|
|
1712
1725
|
// The session the user is looking at, or null while the list is not ready.
|
|
1713
1726
|
// Two host generations own this fact differently:
|
|
1714
1727
|
// * <= 0.1.5-rc.3: the list snapshot carried `current`;
|
|
@@ -2001,7 +2014,11 @@
|
|
|
2001
2014
|
}
|
|
2002
2015
|
}
|
|
2003
2016
|
|
|
2004
|
-
// face -> row adapter (selected session, rich data)
|
|
2017
|
+
// face -> row adapter (selected session, rich data). The label is the
|
|
2018
|
+
// session's own sidebar title like any other row, so "needs you" and
|
|
2019
|
+
// "reply finished" name the conversation instead of the old placeholder;
|
|
2020
|
+
// the placeholder remains the fallback while the title is unknown
|
|
2021
|
+
// (issue #20).
|
|
2005
2022
|
function evalSessionFace(sessionId, snap) {
|
|
2006
2023
|
if (sessionId !== currentFaceId) return;
|
|
2007
2024
|
var pend = (snap.pending || []).map(function (p) {
|
|
@@ -2015,7 +2032,7 @@
|
|
|
2015
2032
|
face: true,
|
|
2016
2033
|
faceSnap: snap,
|
|
2017
2034
|
currentId: sessionId,
|
|
2018
|
-
label: "current"
|
|
2035
|
+
label: sessionTitleOf(sessionId) || "current"
|
|
2019
2036
|
});
|
|
2020
2037
|
}
|
|
2021
2038
|
// list row -> adapter (every other listed session)
|
|
@@ -2302,7 +2319,7 @@
|
|
|
2302
2319
|
});
|
|
2303
2320
|
} catch (e) {}
|
|
2304
2321
|
// keep in sync with package.json "version" on every release
|
|
2305
|
-
api.version = "1.14.
|
|
2322
|
+
api.version = "1.14.3";
|
|
2306
2323
|
api.setConfig = function (patch) { return setConfigLocal(patch); };
|
|
2307
2324
|
api.resetConfig = function () {
|
|
2308
2325
|
try {
|