dsh-session-superagent 0.9.160 → 0.9.161
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 +20 -0
- package/README.md +1 -1
- package/client.js +21 -3
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
格式参照 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [0.9.161] - 2026-11-03 —— 弹层每次打开都重钉一遍样式表
|
|
6
|
+
|
|
7
|
+
### 为什么
|
|
8
|
+
0.9.159/0.9.160 把注入提到了 `apply()`,但那是**挂载时一次**。如果宿主热重载、
|
|
9
|
+
路由切换或任何机制把 `<head>` 里的 `<style id="dsh-zhuli-ported-css">` 清掉,
|
|
10
|
+
之后打开弹层仍然是无样式裸文字 —— 而且没有任何报错。
|
|
11
|
+
|
|
12
|
+
### 改法
|
|
13
|
+
- `ensurePortedCss(force)`:`force=true` 时**移除旧标签并重建**,默认仍是幂等;
|
|
14
|
+
- 弹层 `open` 变 true 时调一次 `ensurePortedCss(true)` —— 弹层是"一开就要好看"的东西,
|
|
15
|
+
不能等下次渲染才发现没样式;
|
|
16
|
+
- 面板与圆环的挂载调用保持幂等(正常路径零开销)。
|
|
17
|
+
|
|
18
|
+
### 为什么不是每次都强制
|
|
19
|
+
重建会让样式表在两个 `<style>` 之间存在极短的空窗(旧已移除、新未插入),
|
|
20
|
+
所以只在"即将显示"和"首次挂载"这两种时机做。
|
|
21
|
+
|
|
22
|
+
### 测试
|
|
23
|
+
静态断言再补一条:`StatusOrbit` 源码里必须出现 `ensurePortedCss(true)`。合计 **264 例**。
|
|
24
|
+
|
|
5
25
|
## [0.9.160] - 2026-11-03 —— 样式表在 apply() 里注入一次,从结构上消灭"某个入口没样式"
|
|
6
26
|
|
|
7
27
|
### 为什么
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<img src="assets/icon-180.png" width="88" height="88" alt="">
|
|
4
4
|
|
|
5
5
|
[](LICENSE)
|
|
6
|
-
[](https://github.com/MYCF711/dsh-session-superagent/releases)
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-session-superagent)
|
|
8
8
|
[](https://github.com/topics/dsh-plugin)
|
|
9
9
|
|
package/client.js
CHANGED
|
@@ -14,7 +14,7 @@ window.__ModuleLoader__.load({
|
|
|
14
14
|
const { useCallback, useEffect, useRef, useState } = React
|
|
15
15
|
|
|
16
16
|
// 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
|
|
17
|
-
const CLIENT_VERSION = '0.9.
|
|
17
|
+
const CLIENT_VERSION = '0.9.161'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -154,9 +154,23 @@ window.__ModuleLoader__.load({
|
|
|
154
154
|
.sa-dock-foot { padding: 8px 14px 10px; border-top: 0.5px solid var(--dsw-alias-border-l3); color: var(--dsw-alias-label-caption); }
|
|
155
155
|
`
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
/**
|
|
158
|
+
* 注入设计系统样式表。
|
|
159
|
+
*
|
|
160
|
+
* `force = true` 时**无条件重建**:弹层每次打开都调一次,用来兜住
|
|
161
|
+
* 「宿主热重载 / 路由切换把 <head> 清掉」这种情况 —— 那时标签不在了,
|
|
162
|
+
* 弹层就会变成一堆无样式裸文字(2026-11-03 真机复现过)。
|
|
163
|
+
* 正常渲染路径用默认的幂等模式,只有"就快显示了"时才付出重建代价。
|
|
164
|
+
*/
|
|
165
|
+
function ensurePortedCss(force) {
|
|
158
166
|
try {
|
|
159
|
-
if (
|
|
167
|
+
if (!force) {
|
|
168
|
+
const existing = document.getElementById('dsh-zhuli-ported-css')
|
|
169
|
+
if (existing) return
|
|
170
|
+
} else {
|
|
171
|
+
const stale = document.getElementById('dsh-zhuli-ported-css')
|
|
172
|
+
if (stale && stale.parentNode) stale.parentNode.removeChild(stale)
|
|
173
|
+
}
|
|
160
174
|
const style = document.createElement('style')
|
|
161
175
|
style.id = 'dsh-zhuli-ported-css'
|
|
162
176
|
style.textContent = PORTED_CSS + DOCK_CSS
|
|
@@ -697,6 +711,10 @@ window.__ModuleLoader__.load({
|
|
|
697
711
|
return () => { alive = false; clearInterval(timer) }
|
|
698
712
|
}, [])
|
|
699
713
|
|
|
714
|
+
// 弹层每次打开都把样式表钉一遍:宿主热重载可能把 <style> 清掉,
|
|
715
|
+
// 而弹层是"一开就要好看"的东西,不能等到下次渲染才发现没样式
|
|
716
|
+
useEffect(() => { if (open) ensurePortedCss(true) }, [open])
|
|
717
|
+
|
|
700
718
|
useEffect(() => {
|
|
701
719
|
if (!open) return undefined
|
|
702
720
|
const onDown = (event) => {
|
package/lib/index.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
|
|
41
41
|
export const name = 'dsh-session-superagent'
|
|
42
42
|
/** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
|
|
43
|
-
export const SERVER_VERSION = '0.9.
|
|
43
|
+
export const SERVER_VERSION = '0.9.161'
|
|
44
44
|
export const inject = ['tools', 'agents', 'webServer']
|
|
45
45
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
46
46
|
// 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.161",
|
|
4
4
|
"description": "Session-level superagent for DeepSeek Harness: watch a GitHub repository and wake a session when something needs doing. Credentials never reach the model.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|