@idoall/dsh-notify 0.5.0 → 0.5.2
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 +23 -0
- package/README.md +9 -7
- package/README.zh.md +9 -7
- package/dist/client.js +30 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). GitHub Releases use the same bilingual layout as [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.1.6-alpha.1).
|
|
4
4
|
|
|
5
|
+
## [0.5.2] - 2026-11-24
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **Handling a notification now clears the tab marker too.** The 🔔 title prefix and the red favicon dot only stopped when the page became visible, so a notification closed (or cleared, or answered, or jumped to) from a window the browser still reports as hidden — an occluded window, a second display, a desktop shell — left the tab flashing about work that was already done. A retiring card is now dropped from the unread set at the click, the slide-out timer also drops it, and the marker is recomputed against the cards still on screen, so no removal path can leave a stale count behind.
|
|
10
|
+
- **The indicator no longer reverts a title or favicon the host changed while it flashed.** Stopping used to restore the exact title captured when it started, which silently undid a session rename made in the meantime; it now restores only what it painted itself.
|
|
11
|
+
- **The indicator resolves `document` when it needs it** instead of capturing it at module load. A Client bundle evaluated before the page installs its document (and every test realm that swaps the global afterwards) used to get an indicator that silently did nothing.
|
|
12
|
+
|
|
13
|
+
### Verified
|
|
14
|
+
|
|
15
|
+
- Static checks, **125 automated tests**, build and package checks pass, and the packed tarball matches this checkout byte for byte. New coverage: a background toast marks the tab, closing it clears the marker while the page still counts as hidden; a host title/favicon change survives the marker; and a document installed after module evaluation is picked up.
|
|
16
|
+
|
|
17
|
+
## [0.5.1] - 2026-11-24
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **The window no longer covers the session toolbar above the chat.** Its vertical start was still the hardcoded `56px` offset, so in a window whose header is taller than that — or at a non-100% page zoom — the card landed on the 轨迹 / 上下文 / 费用 / 统计 row. `toastTopAnchor` now measures the conversation body (`[data-conversation-content]`, falling back to `[data-conversation-scroll]`) and starts 8px below its top edge, with the old `56px` kept as the floor for a host without the hook. Because it is measured, it follows a resized header, a collapsed sidebar and a zoom change through the same observer that already re-anchored the horizontal gutter.
|
|
22
|
+
- The screen-corner placement keeps its host-aware `--dsh-toast-top-offset` variable, so 屏幕右上 still means the top of the screen rather than the top of the chat.
|
|
23
|
+
|
|
24
|
+
### Verified
|
|
25
|
+
|
|
26
|
+
- Static checks, **123 automated tests**, build and package checks pass, and the packed tarball matches this checkout byte for byte. New coverage measures the body top at 120px → a 128px start, keeps the 56px floor for a short layout and for a host without the hook, falls back to the scroll body, and the DOM test now asserts `style.top === '136px'` on the rendered frame for a body top of 128px.
|
|
27
|
+
|
|
5
28
|
## [0.5.0] - 2026-11-23
|
|
6
29
|
|
|
7
30
|
### Added
|
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ Reload the profile or restart DSH only when its plugin host has not hot-reloaded
|
|
|
83
83
|
|
|
84
84
|
| Setting | Default | What it does |
|
|
85
85
|
| --- | --- | --- |
|
|
86
|
-
| Toast position | conversation top-left (default) | Anchors the overlay to the chat column's left edge and follows sidebar layout changes; top-right, screen top-right and off are the alternatives. |
|
|
86
|
+
| Toast position | conversation top-left (default) | Anchors the overlay to the chat column's left edge, starts just below the conversation body so the session toolbar above it stays clear, and follows sidebar layout changes; top-right, screen top-right and off are the alternatives. |
|
|
87
87
|
| Notification style | **Enhanced** | Enhanced uses clear status colours and a short attention bar; Soft uses a quieter presentation. |
|
|
88
88
|
| Collapse multiple notifications | **on** | From two cards onward, show the newest card fully and stack older cards below it; hover or focus expands them. |
|
|
89
89
|
| In-page sound | **on** | Plays one cue when a polling batch admits one or more new visible Toasts, including while DSH is in a background tab. Built-ins: chime, ping, alert, silent; custom uploads are supported. |
|
|
@@ -92,7 +92,7 @@ Reload the profile or restart DSH only when its plugin host has not hot-reloaded
|
|
|
92
92
|
|
|
93
93
|
Custom sounds are stored in `<dataDir>/sounds/` in the profile data directory, not the plugin installation. Uploads are limited to 1 MB and `mp3 / m4a / aac / wav / ogg / flac`; names must be a single path segment.
|
|
94
94
|
|
|
95
|
-
Above the cards, the page shows the running version against the newest one on npm: `v0.5.
|
|
95
|
+
Above the cards, the page shows the running version against the newest one on npm: `v0.5.2 ✓ 最新`, `v0.5.1 ➔ v0.5.2`, or `v0.5.2 · 检查失败`. **检查更新** forces a fresh lookup (`GET /plugins/dsh-notify/update?force=1`, authenticated); a page load reuses the host's six-hour cache. When a newer version exists the row reveals `dsh plugin --profile web add @idoall/dsh-notify@<version>` with a copy button — installing it, and restarting DSH afterwards, stays your decision.
|
|
96
96
|
|
|
97
97
|
<p align="center">
|
|
98
98
|
<img src="./assets/version-check.png" width="60%" alt="DSH notification settings with the version row: v0.4.0 newest, Check for updates, GitHub, Changelog and Issues links">
|
|
@@ -100,11 +100,13 @@ Above the cards, the page shows the running version against the newest one on np
|
|
|
100
100
|
|
|
101
101
|
## Compatibility
|
|
102
102
|
|
|
103
|
-
Current release: plugin **`0.5.
|
|
103
|
+
Current release: plugin **`0.5.2`** is verified against DeepSeek Harness **`0.2.3-alpha.2`**.
|
|
104
104
|
|
|
105
105
|
| Plugin | Verified DeepSeek Harness | What that version is |
|
|
106
106
|
| --- | --- | --- |
|
|
107
|
-
| **`0.5.
|
|
107
|
+
| **`0.5.2`** | `0.2.3-alpha.2` | Fixes the tab marker outliving the notification: closing, clearing, answering or jumping from a card now drops it from the unread set at the click, and the marker is recomputed from the cards still on screen. Stopping also stops reverting a session title the host renamed meanwhile. |
|
|
108
|
+
| `0.5.1` | `0.2.3-alpha.2` | Fixes the window covering the session toolbar: its vertical start is now measured from the conversation body (8px below it, 56px floor) instead of a hardcoded 56px offset, and follows resizes and zoom. The screen-corner placement keeps its own variable. |
|
|
109
|
+
| `0.5.0` | `0.2.3-alpha.2` | Puts the notification window in the conversation's **top-left** corner by default — the settings page keeps the top-right corner, the screen corner and off as alternatives. Adds the left-edge anchor and re-anchors it through the same sidebar-following observer. Notification content, sounds and triggers are unchanged. |
|
|
108
110
|
| `0.4.17` | `0.2.3-alpha.2` | **Fixes two breaks on the current host.** DSH moved HTTP admission into the WebServer and removed `Connection.requestRejection` — routes now declare `auth: 'required'` and call the method only when it still exists — and moved the Session status snapshot behind a `uiSession.sessionStatus` service that throws unless injected, so the toast reads the injection-free `uiSession.pendingInteractions` source instead. `0.4.16` failed every plugin endpoint and lost in-toast answering on this host. |
|
|
109
111
|
| `0.4.16` | `0.2.2-rc.5` | Declares DSH `0.2.2-rc.5` compatible — the first RC on npm `latest`. The one break since `rc.4` is a search-provider default this plugin never touches. Of the 15 packages it binds, the six that own its interfaces are byte-identical apart from their own versions; the only other changes are the same search work and release metadata (one source-location character, the displayed host version, the reported commit). No notification source changes. |
|
|
110
112
|
| `0.4.15` | `0.2.2-rc.4` | Declares DSH `0.2.2-rc.4` compatible. The one break since `rc.3` moves the DeepSeek refusal code to `CONTENT_REFUSED`, which this plugin never classifies. Of the 15 packages it binds, everything is byte-identical apart from each `package.json`'s version; only the general-settings display version and the module loader's reported commit changed at runtime. No notification source changes. |
|
|
@@ -137,7 +139,7 @@ Current release: plugin **`0.5.0`** is verified against DeepSeek Harness **`0.2.
|
|
|
137
139
|
- Two declarations decide whether the plugin loads at all: `dsh.engines.dsh` and every `@deepseek-ai/dsh-*` peer state the same requirement, `>=0.1.7-rc.1 <0.3.0` as of `0.4.1`. DSH refuses an incompatible bundle at profile load, so a range that excluded the running release would silently drop the plugin — which is exactly what the old `<0.2.0` ceiling would have done on the `0.2.0` release.
|
|
138
140
|
- **An interactive gate only withholds a completion while it is unanswered.** DSH resolves an execution approval and a plan review *inside* the turn that asked them (`approval.request()` awaits its outcome under an open turn; `exit_plan_mode` returns its verdict to the same turn), so the turn that resumes is the turn that asked, and its end is the user's task finishing. `0.4.2` makes that the rule; `0.3.2`–`0.4.1` suppressed the whole turn, which silently dropped the completion of every approval-gated task.
|
|
139
141
|
- `@deepseek-ai/schemastery` is a **peer**, not a plain dependency: DSH resolves only a linked plugin's peer dependencies from the running installation, so a `link:` install of this directory would otherwise fail to import the Host half.
|
|
140
|
-
- **Verified releases are listed, not just matched.** `dsh.compatibility.dshReleases` names every release this plugin was actually booted on (`0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-alpha.3`, `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.2`, `0.2.1-rc.3`, `0.2.1-rc.4`, `0.2.2-alpha.2`, `0.2.2-alpha.3`, `0.2.2-rc.1`, `0.2.2-rc.3`, `0.2.2-rc.4`, `0.2.2-rc.5`, `0.2.3-alpha.2` as of `0.5.
|
|
142
|
+
- **Verified releases are listed, not just matched.** `dsh.compatibility.dshReleases` names every release this plugin was actually booted on (`0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-alpha.3`, `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.2`, `0.2.1-rc.3`, `0.2.1-rc.4`, `0.2.2-alpha.2`, `0.2.2-alpha.3`, `0.2.2-rc.1`, `0.2.2-rc.3`, `0.2.2-rc.4`, `0.2.2-rc.5`, `0.2.3-alpha.2` as of `0.5.2`) and `npm run pack:check` fails when one of them falls outside the declared range. Each entry means a real boot, not a semver guess.
|
|
141
143
|
|
|
142
144
|
The screenshots below come from earlier browser verification, not a new RC visual test. This check covers interface compatibility, automated tests and live overlay registration, not a fresh visual or audio test. The layout was checked at a 390px mobile viewport: the settings controls reflow and the toast becomes full-width without falling behind the mobile sidebar.
|
|
143
145
|
|
|
@@ -170,8 +172,8 @@ npm run pack:check # publish preconditions + client registration check
|
|
|
170
172
|
Releases are tag-driven. Bump `package.json` and the lockfile root versions, synchronize both READMEs and the DSH declarations, move the matching CHANGELOG section out of `Unreleased`, write `release-notes/v<version>.md`, then push the release commit and tag:
|
|
171
173
|
|
|
172
174
|
```sh
|
|
173
|
-
git tag v0.5.
|
|
174
|
-
git push origin v0.5.
|
|
175
|
+
git tag v0.5.2
|
|
176
|
+
git push origin v0.5.2
|
|
175
177
|
```
|
|
176
178
|
|
|
177
179
|
The release workflow runs `npm run verify`, packs the plugin, publishes through npm trusted publishing (OIDC), and creates a GitHub Release with the package tarball and sha256.
|
package/README.zh.md
CHANGED
|
@@ -83,7 +83,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
83
83
|
|
|
84
84
|
| 设置项 | 默认 | 作用 |
|
|
85
85
|
| --- | --- | --- |
|
|
86
|
-
| Toast 位置 | 会话区左上(默认) |
|
|
86
|
+
| Toast 位置 | 会话区左上(默认) | 浮层贴在聊天区左边缘,起点位于会话正文上沿下方,不遮挡上方的会话工具栏,并跟随左右侧栏布局变化;会话区右上、屏幕右上与关闭页面通知为备选。 |
|
|
87
87
|
| 通知样式 | **增强版** | 增强版使用清晰状态色和短提醒条;柔和版更克制。 |
|
|
88
88
|
| 多条通知折叠显示 | **开** | 从两条开始完整显示最新一条,旧卡叠在下方;悬停或聚焦即可展开。 |
|
|
89
89
|
| 页内提示音 | **开** | 一轮轮询只要有一条或多条新 Toast 成功进入可视队列,就播放一次提示音,即使 DSH 标签在后台。内置 chime / ping / alert / 静音,也可上传自定义声音。 |
|
|
@@ -92,7 +92,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
92
92
|
|
|
93
93
|
自定义提示音保存在 profile 数据目录的 `<dataDir>/sounds/`,而非插件安装目录。上传限制 1 MB,支持 `mp3 / m4a / aac / wav / ogg / flac`,文件名必须是单段路径。
|
|
94
94
|
|
|
95
|
-
卡片上方是版本检测行:显示当前版本与 npm 上最新版本的关系——`v0.5.
|
|
95
|
+
卡片上方是版本检测行:显示当前版本与 npm 上最新版本的关系——`v0.5.2 ✓ 最新`、`v0.5.1 ➔ v0.5.2` 或 `v0.5.2 · 检查失败`。**检查更新**会强制重新查询(`GET /plugins/dsh-notify/update?force=1`,需通过鉴权);页面加载则复用宿主 6 小时缓存。检测到新版本时,行下方会展开 `dsh plugin --profile web add @idoall/dsh-notify@<版本>` 与复制按钮——是否安装、以及随后是否重启 DSH,都由你决定。
|
|
96
96
|
|
|
97
97
|
<p align="center">
|
|
98
98
|
<img src="./assets/version-check.png" width="60%" alt="DSH 通知设置中的版本检测行:v0.4.0 已是最新、检查更新、GitHub、更新日志与反馈 Issue 入口">
|
|
@@ -100,11 +100,13 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
100
100
|
|
|
101
101
|
## 兼容性
|
|
102
102
|
|
|
103
|
-
当前发布:插件 **`0.5.
|
|
103
|
+
当前发布:插件 **`0.5.2`** 已在 DeepSeek Harness **`0.2.3-alpha.2`** 上验证。
|
|
104
104
|
|
|
105
105
|
| 插件 | 已验证的 DeepSeek Harness | 这一版是什么 |
|
|
106
106
|
| --- | --- | --- |
|
|
107
|
-
| **`0.5.
|
|
107
|
+
| **`0.5.2`** | `0.2.3-alpha.2` | 修复「通知已处理、标签页提示还在」:关闭/全部清除/回答/跳转卡片时立刻把它从未读集合里移除,并按仍在屏上的卡片重算提示;同时不再把宿主期间改过的会话标题回滚。 |
|
|
108
|
+
| `0.5.1` | `0.2.3-alpha.2` | 修复浮层盖住会话工具栏的问题:起点改为量取会话正文上沿(再下移 8px,56px 为下限),不再是写死的 56px 偏移,并随窗口尺寸与缩放跟随。屏幕右上仍用自己的变量定位。 |
|
|
109
|
+
| `0.5.0` | `0.2.3-alpha.2` | 通知浮层默认改到会话区**左上角**——设置页保留「会话区右上」「屏幕右上」「关闭页面通知」作为备选。新增左边缘锚点,并复用同一套跟随侧栏的观察器实时重定位。通知内容、提示音与触发时机均未变。 |
|
|
108
110
|
| `0.4.17` | `0.2.3-alpha.2` | **修复当前宿主上的两处断裂。** DSH 把 HTTP admission 移进 WebServer 并删除了 `Connection.requestRejection`——路由改为声明 `auth: 'required'`,仅在该方法仍存在时才调用;同时把 Session 状态快照移到需要注入的 `uiSession.sessionStatus` 服务,浮层改用无需注入的 `uiSession.pendingInteractions`。在本宿主上 `0.4.16` 的所有插件端点失败,卡片内回答也失效。 |
|
|
109
111
|
| `0.4.16` | `0.2.2-rc.5` | 声明兼容 DSH `0.2.2-rc.5`——第一个进入 npm `latest` 渠道的 RC。`rc.4` 以来唯一的破坏性变更是搜索提供方默认值,与本插件无关。它绑定的 15 个包里,决定接口的六个除自身版本号外逐字节相同;其余改动也只有同一次搜索调整与发布元数据(一个源码位置字符、界面显示的宿主版本号、上报的提交号)。通知源码无改动。 |
|
|
110
112
|
| `0.4.15` | `0.2.2-rc.4` | 声明兼容 DSH `0.2.2-rc.4`。`rc.3` 以来唯一的破坏性变更把 DeepSeek 拒答错误码改为 `CONTENT_REFUSED`,而本插件从不按该错误码分类。它绑定的 15 个包里,除各包 `package.json` 的版本号外全部逐字节相同;运行时只改了设置页显示的版本号与模块加载器上报的提交号。通知源码无改动。 |
|
|
@@ -137,7 +139,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
137
139
|
- 两处声明决定插件能否加载:`dsh.engines.dsh` 与每一个 `@deepseek-ai/dsh-*` peer 都写同一条要求,自 `0.4.1` 起为 `>=0.1.7-rc.1 <0.3.0`。DSH 会在 profile 加载时拒绝不兼容的 bundle,范围写错就会静默丢掉插件——旧的 `<0.2.0` 上限在 `0.2.0` 正式版上正是如此。
|
|
138
140
|
- **交互门禁只在「还没等到人回答」时压住完成通知。** DSH 的执行审批与计划审批都是在**提问的那个回合内**解决的(`approval.request()` 必须处于打开的回合中并原地等待结果;`exit_plan_mode` 把结论交回同一回合),所以接着干活的回合就是提问的那个回合,它的结束就是用户任务的完成。`0.4.2` 以此为规则;`0.3.2`–`0.4.1` 压掉了整个回合,于是每个带审批的任务都静默丢失完成通知。
|
|
139
141
|
- `@deepseek-ai/schemastery` 是 **peer**,不是普通依赖:DSH 只会把 **link 形态**插件的 peer 解析到当前安装;若仍写成普通依赖,`link:` 安装的 Host 半会导入失败。
|
|
140
|
-
- **声明的是「实测验证过的版本」,不是语义化猜测。** `dsh.compatibility.dshReleases` 列出真正启动验证过的每个版本(截至 `0.5.
|
|
142
|
+
- **声明的是「实测验证过的版本」,不是语义化猜测。** `dsh.compatibility.dshReleases` 列出真正启动验证过的每个版本(截至 `0.5.2`:`0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-alpha.1`、`0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5`、`0.2.1-rc.2`、`0.2.1-rc.3`、`0.2.1-rc.4`、`0.2.2-alpha.2`、`0.2.2-alpha.3`、`0.2.2-rc.1`、`0.2.2-rc.3`、`0.2.2-rc.4`、`0.2.2-rc.5`、`0.2.3-alpha.2`),一旦其中某个落在声明范围之外,`npm run pack:check` 会直接失败。
|
|
141
143
|
|
|
142
144
|
以下截图来自此前的浏览器验证,并非本次 RC 的新视觉测试;本次验证覆盖接口兼容性、自动化测试与实时浮层注册,不包含新的视觉或声音实测。此前在 390px 手机视口检查:设置控件会重排,Toast 会满宽显示且不会被移动端侧栏遮挡。
|
|
143
145
|
|
|
@@ -170,8 +172,8 @@ npm run pack:check # 发布前置条件 + 客户端注册校验
|
|
|
170
172
|
发版由 tag 驱动。更新 `package.json` 与锁文件根版本、同步中英文 README 和 DSH 声明、将对应 CHANGELOG 段落移出 `Unreleased`、编写 `release-notes/v<版本>.md` 后,推送发版提交与 tag:
|
|
171
173
|
|
|
172
174
|
```sh
|
|
173
|
-
git tag v0.5.
|
|
174
|
-
git push origin v0.5.
|
|
175
|
+
git tag v0.5.2
|
|
176
|
+
git push origin v0.5.2
|
|
175
177
|
```
|
|
176
178
|
|
|
177
179
|
发版工作流会运行 `npm run verify`、打包插件、通过 npm trusted publishing(OIDC)发布,并创建附带 tarball 与 sha256 的 GitHub Release。
|
package/dist/client.js
CHANGED
|
@@ -91,6 +91,8 @@ window.__ModuleLoader__.load({
|
|
|
91
91
|
toastStackPlan: () => toastStackPlan,
|
|
92
92
|
toastTime: () => toastTime,
|
|
93
93
|
toastTone: () => toastTone,
|
|
94
|
+
toastTop: () => toastTop,
|
|
95
|
+
toastTopAnchor: () => toastTopAnchor,
|
|
94
96
|
updateChipText: () => updateChipText,
|
|
95
97
|
updateCommand: () => updateCommand,
|
|
96
98
|
updateTone: () => updateTone,
|
|
@@ -150,13 +152,27 @@ window.__ModuleLoader__.load({
|
|
|
150
152
|
const left = rect && rect.width > 0 && typeof rect.left === "number" ? Math.min(rect.left, innerWidth) : null;
|
|
151
153
|
return left === null ? Math.max(16, (innerWidth - fallbackContentWidth) / 2 + 16) : Math.max(16, left + 16);
|
|
152
154
|
}
|
|
155
|
+
var TOAST_TOP_FLOOR = 56;
|
|
156
|
+
var TOAST_TOP_GAP = 8;
|
|
157
|
+
function toastTopAnchor({ document: doc = globalThis.document, minimum = TOAST_TOP_FLOOR, gap = TOAST_TOP_GAP } = {}) {
|
|
158
|
+
const rectOf = (selector) => {
|
|
159
|
+
const rect2 = doc?.querySelector?.(selector)?.getBoundingClientRect?.();
|
|
160
|
+
return rect2 && rect2.height > 0 && typeof rect2.top === "number" ? rect2 : null;
|
|
161
|
+
};
|
|
162
|
+
const rect = rectOf("[data-conversation-content]") ?? rectOf("[data-conversation-scroll]");
|
|
163
|
+
return rect === null ? minimum : Math.max(minimum, Math.round(rect.top) + gap);
|
|
164
|
+
}
|
|
165
|
+
function toastTop({ position = "conversation-left", anchor = { top: TOAST_TOP_FLOOR } } = {}) {
|
|
166
|
+
if (position === "viewport") return "calc(env(safe-area-inset-top, 0px) + var(--dsh-toast-top-offset, 56px))";
|
|
167
|
+
return `${anchor.top ?? TOAST_TOP_FLOOR}px`;
|
|
168
|
+
}
|
|
153
169
|
function toastInsets({ narrow = false, position = "conversation-left", anchor = { right: 16, left: 16 } } = {}) {
|
|
154
170
|
if (narrow) return { insetInlineStart: "auto", insetInlineEnd: 12 };
|
|
155
171
|
if (position === "conversation-left") return { insetInlineStart: `${anchor.left}px`, insetInlineEnd: "auto" };
|
|
156
172
|
return { insetInlineStart: "auto", insetInlineEnd: `${position === "viewport" ? 16 : anchor.right}px` };
|
|
157
173
|
}
|
|
158
174
|
function toastAnchors(options = {}) {
|
|
159
|
-
return { right: toastAnchor(options), left: toastLeftAnchor(options) };
|
|
175
|
+
return { right: toastAnchor(options), left: toastLeftAnchor(options), top: toastTopAnchor(options) };
|
|
160
176
|
}
|
|
161
177
|
function toastAnchorWatchTargets(doc = globalThis.document) {
|
|
162
178
|
const nodes = [];
|
|
@@ -677,9 +693,11 @@ window.__ModuleLoader__.load({
|
|
|
677
693
|
}
|
|
678
694
|
var soundPlayer = createSoundPlayer();
|
|
679
695
|
var ATTENTION_DOT = `data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7" fill="#e5484d"/></svg>')}`;
|
|
680
|
-
function createAttentionIndicator({ document:
|
|
696
|
+
function createAttentionIndicator({ document: docSource = globalThis.document, timers = {}, intervalMs = 900, reducedMotion = globalThis.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches === true } = {}) {
|
|
681
697
|
const setTimer = timers.setInterval ?? globalThis.setInterval;
|
|
682
698
|
const clearTimer = timers.clearInterval ?? globalThis.clearInterval;
|
|
699
|
+
let doc = typeof docSource === "function" ? void 0 : docSource;
|
|
700
|
+
const target = () => doc = typeof docSource === "function" ? docSource() : docSource;
|
|
683
701
|
let timer = null;
|
|
684
702
|
let active = false;
|
|
685
703
|
let baseTitle = null;
|
|
@@ -699,8 +717,8 @@ window.__ModuleLoader__.load({
|
|
|
699
717
|
if (!active) return;
|
|
700
718
|
active = false;
|
|
701
719
|
phase = false;
|
|
702
|
-
if (doc && baseTitle !== null) doc.title = baseTitle;
|
|
703
|
-
if (iconNode && baseIcon !== null) iconNode.href = baseIcon;
|
|
720
|
+
if (doc && baseTitle !== null && (doc.title === baseTitle || doc.title === `\u{1F514} ${baseTitle}`)) doc.title = baseTitle;
|
|
721
|
+
if (iconNode && baseIcon !== null && iconNode.href === ATTENTION_DOT) iconNode.href = baseIcon;
|
|
704
722
|
if (iconNode && baseIcon === null) {
|
|
705
723
|
try {
|
|
706
724
|
iconNode.remove();
|
|
@@ -723,6 +741,7 @@ window.__ModuleLoader__.load({
|
|
|
723
741
|
stop();
|
|
724
742
|
return;
|
|
725
743
|
}
|
|
744
|
+
doc = target();
|
|
726
745
|
if (!doc) return;
|
|
727
746
|
baseTitle = doc.title ?? "";
|
|
728
747
|
iconNode = doc.querySelector?.('link[rel~="icon"]') ?? null;
|
|
@@ -739,7 +758,7 @@ window.__ModuleLoader__.load({
|
|
|
739
758
|
stop
|
|
740
759
|
};
|
|
741
760
|
}
|
|
742
|
-
var attentionIndicator = createAttentionIndicator();
|
|
761
|
+
var attentionIndicator = createAttentionIndicator({ document: () => globalThis.document });
|
|
743
762
|
function setToastConfig(config = {}) {
|
|
744
763
|
toastConfig = { ...toastConfig, ...config };
|
|
745
764
|
globalThis.dispatchEvent?.(new Event("dsh-notify:toast-config"));
|
|
@@ -824,6 +843,7 @@ window.__ModuleLoader__.load({
|
|
|
824
843
|
};
|
|
825
844
|
const forget = (eventId) => {
|
|
826
845
|
heights.current.delete(eventId);
|
|
846
|
+
unseen.current.delete(eventId);
|
|
827
847
|
};
|
|
828
848
|
const retire = (eventId) => {
|
|
829
849
|
const previous = exits.current.get(eventId);
|
|
@@ -840,6 +860,7 @@ window.__ModuleLoader__.load({
|
|
|
840
860
|
clearTimeout(success);
|
|
841
861
|
successes.current.delete(eventId);
|
|
842
862
|
}
|
|
863
|
+
unseen.current.delete(eventId);
|
|
843
864
|
if (!animate) {
|
|
844
865
|
forget(eventId);
|
|
845
866
|
commit(cardsRef.current.filter((card) => card.record.eventId !== eventId));
|
|
@@ -876,7 +897,7 @@ window.__ModuleLoader__.load({
|
|
|
876
897
|
globalThis.addEventListener?.("dsh-notify:toast-config", onConfig);
|
|
877
898
|
return () => globalThis.removeEventListener?.("dsh-notify:toast-config", onConfig);
|
|
878
899
|
}, []);
|
|
879
|
-
import_react.default.useEffect(() => watchToastAnchor((next) => setAnchor((prev) => prev.right === next.right && prev.left === next.left ? prev : next)), []);
|
|
900
|
+
import_react.default.useEffect(() => watchToastAnchor((next) => setAnchor((prev) => prev.right === next.right && prev.left === next.left && prev.top === next.top ? prev : next)), []);
|
|
880
901
|
import_react.default.useEffect(() => {
|
|
881
902
|
setAnchor(toastAnchors());
|
|
882
903
|
}, [cards.length]);
|
|
@@ -990,6 +1011,8 @@ window.__ModuleLoader__.load({
|
|
|
990
1011
|
const sync = () => {
|
|
991
1012
|
const hidden = Boolean(globalThis.document?.hidden);
|
|
992
1013
|
if (!hidden) unseen.current.clear();
|
|
1014
|
+
const live = new Set(cardsRef.current.filter((card) => !card.leaving).map((card) => card.record.eventId));
|
|
1015
|
+
for (const id of [...unseen.current]) if (!live.has(id)) unseen.current.delete(id);
|
|
993
1016
|
attentionIndicator.update({ unread: hidden && toastConfig.toastPosition !== "off" ? unseen.current.size : 0, visible: !hidden });
|
|
994
1017
|
};
|
|
995
1018
|
sync();
|
|
@@ -1132,7 +1155,7 @@ window.__ModuleLoader__.load({
|
|
|
1132
1155
|
ref: frameRef,
|
|
1133
1156
|
popover: "manual",
|
|
1134
1157
|
className: "dsh-notify-frame",
|
|
1135
|
-
style: { inset: "auto", ...toastInsets({ narrow, position: toastConfig.toastPosition, anchor }), bottom: "auto", top:
|
|
1158
|
+
style: { inset: "auto", ...toastInsets({ narrow, position: toastConfig.toastPosition, anchor }), bottom: "auto", top: toastTop({ position: toastConfig.toastPosition, anchor }), width: narrow ? "calc(100vw - 24px)" : "min(360px, calc(100vw - 32px))", height: `${frame.windowHeight + (clearAllVisible ? clearAllStrip : 0)}px`, margin: 0, padding: 0, border: 0, background: "transparent", overflow: "visible" }
|
|
1136
1159
|
},
|
|
1137
1160
|
clearAllVisible ? import_react.default.createElement(
|
|
1138
1161
|
"div",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idoall/dsh-notify",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DSH web plugin: in-page task notifications for DeepSeek Harness — enhanced or soft status toasts, a collapsible stack in the conversation top-left corner, answer buttons, background-tab attention, and a WebAudio cue that also plays while the page is hidden. Live delivery only: no history, no service worker, no web push, no OS notification matrix.",
|
|
6
6
|
"main": "./dist/index.js",
|