dsh-quick-toc 0.7.1 → 0.7.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.en.md +131 -121
- package/CHANGELOG.md +122 -112
- package/README.en.md +5 -4
- package/README.md +5 -4
- package/lib/client.js +209 -30
- package/lib/index.js +65 -26
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,230 +2,240 @@
|
|
|
2
2
|
|
|
3
3
|
**dsh-quick-toc** 的重要变更都记录在这里。英文版见 [CHANGELOG.en.md](CHANGELOG.en.md)。
|
|
4
4
|
|
|
5
|
+
## [0.7.3] - 2026-09-23
|
|
6
|
+
|
|
7
|
+
### 变更
|
|
8
|
+
- **兼容 DSH 0.1.5-rc.3 与 0.1.7-alpha.2**:两个新版本上逐项实测通过(面板与幕布、点行跳转与翻历史、标题/全文/跨会话三档检索、跨会话命中切换会话、设置卡片与设置文档的读写),代码无需改动;兼容声明与 README 兼容表已随之更新。
|
|
9
|
+
- 文档里对两条宿主线的实现说明补齐:设置服务与配置卡片槽位各写清 rc 线与 alpha 线两套(此前只写了 rc 线那一套)。
|
|
10
|
+
|
|
11
|
+
## [0.7.2] - 2026-09-22
|
|
12
|
+
|
|
13
|
+
### 新增
|
|
14
|
+
- **幕布缩放**:设置卡片新增「幕布缩放」滑块(50%–200%、每档 5%),把幕布里的文字、图标与按钮按比例缩放,幕布本身的尺寸不变;与「面板缩放」互相独立。幕布内容的默认大小比改动前小一档——滑块的 100% 即改动前的 90%。
|
|
15
|
+
- **支持 DSH 0.1.7-alpha.1**:同一份安装包在 0.1.5-rc.x 与 0.1.7-alpha.x 上都能用(设置接口、配置卡片槽位与会话切换各按宿主实际提供的那一套走),0.1.5-rc.2 与 0.1.7-alpha.1 上都实测通过。
|
|
16
|
+
|
|
5
17
|
## [0.7.1] - 2026-09-19
|
|
6
18
|
|
|
7
19
|
### 新增
|
|
8
|
-
-
|
|
20
|
+
- **「回到我滚到的位置」浮动按钮**:关闭面板或幕布时记录列表顶部的那一行,再次打开时在右上角显示向上的按钮,可回到该行原来的位置。两个界面分别记录;使用一次或自行滚回该处后按钮消失,直到下次关闭重新记录。
|
|
9
21
|
|
|
10
22
|
### 变更
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
23
|
+
- **打开面板或幕布时,正在阅读的那一行落在列表顶部**(原先只有幕布如此,面板显示上次停留的位置)。
|
|
24
|
+
- **面板的收起/展开改为位移过渡**,不再逐帧重排整个面板,长会话中的收起动画不再变形。
|
|
25
|
+
- **顶部图标的几何与线宽调整**:幕布钮改为横矩形、箭头朝下;层级筛选与「只看提问」的线条加粗;✕ 与放大镜不再用平移微调位置。
|
|
26
|
+
- 设置卡片中「记住阅读位置」「自动加载历史」两行不再显示说明文字。
|
|
15
27
|
|
|
16
28
|
### 修复
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
29
|
+
- **自动加载速度较慢**:视野中出现未加载的占位行时改为一次加载到位,只在接近预取范围时逐页加载;并修正把「正在加载」判断为「已经是最早的消息」的误报。
|
|
30
|
+
- **加载历史记录时向上滚动被拉回**:高度补偿改为与内容变化同帧完成,锚点取视野中第一个已加载的行,宿主自身翻页时同样补偿。
|
|
31
|
+
- **使用一段时间后出现卡顿**:自动跟随不再对会话中的每条消息逐个测量高度。
|
|
32
|
+
- **自动加载历史时中间的对话向上移动**:翻页前不再抬升对话区。
|
|
33
|
+
- **一次向上滚动会连续加载多页**:预取判断改为从视野中最近的占位行起算,并加入迟滞。
|
|
34
|
+
- **幕布展开时列表先停在偏上的位置、向上跳转的落点不准、打开时先自上而下滚动**:统一为「正在阅读的那一行对齐列表顶部、瞬时完成」。
|
|
35
|
+
- **顶部液滴下压到底后仍留有一线厚度,随后整体消失**:改为压到底即完全没入分割线。
|
|
24
36
|
|
|
25
37
|
## [0.7.0] - 2026-09-19
|
|
26
38
|
|
|
27
39
|
### 新增
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
- **键盘导航**:↑/↓
|
|
34
|
-
-
|
|
40
|
+
- **全屏「幕布」大纲**:对话顶边的标签条中嵌入一枚液滴把手,点击后大纲以整幅宽度从标签条下方展开,高度取对话区的剩余部分、下沿圆角,不遮挡也不压暗下方的对话。点击任意条目、按 Esc 或点右上角 ✕ 收起;面板标题栏的「幕布」圆钮是另一个入口。它是把面板本体搬入容器,因此翻页、搜索、悬停预览、键盘光标与阅读位置都是同一套。
|
|
41
|
+
- **幕布中的宽版排版**:一行三段——层级徽标、更大的标题、该节正文的开头;层级筛选排成一行。点击放大镜,搜索栏从右侧展开。
|
|
42
|
+
- **每行末尾的「跳到本节末尾」按钮**:指针停在标题行、组头或搜索结果上时,右端显示圆钮,点击跳到该节的结束位置(标题行停在下一个同级或更高级标题之前,组头停在整轮对话的末尾)。
|
|
43
|
+
- **跨会话检索**:搜索范围增加第三档「会话」,用宿主的全文索引搜索其他会话的正文(只搜正文,一次最多 20 条),点击结果切换到该会话并继续查找。无法打开的会话会被略过并报出条数,宿主未开启索引时直接说明。
|
|
44
|
+
- **记住每会话阅读位置**(默认开启):重新打开会话时回到上次读到的那一轮;记录带 seq,该轮不在对话窗口中时也会自动加载。位置只保存在本机,超过半小时不再恢复。
|
|
45
|
+
- **键盘导航**:↑/↓ 在大纲中移动光标,Enter 激活当前行,Home / End 到首尾,Esc 收起面板;点击面板任意位置后即可使用,不必先 Tab 进入。
|
|
46
|
+
- **只看提问**:标题栏的语音气泡按钮把大纲折叠为每轮的时间与提问首行;切换为渐隐渐显,开启时层级筛选不可用。
|
|
35
47
|
|
|
36
48
|
### 变更
|
|
37
|
-
-
|
|
49
|
+
- **收起后的边缘把手改为沿边线滑入**:展开时把手先淡出、面板随后滑入;收起时把手沿边线滑回并被裁切。
|
|
38
50
|
|
|
39
51
|
### 修复
|
|
40
|
-
-
|
|
52
|
+
- **面板不再覆盖其他插件的浮层**:层级改为插入应用层叠序中的空档(把手 12、面板 14、幕布 16、悬停预览 18),仍在对话内容之上,但在宿主与其他插件的浮层之下。
|
|
41
53
|
|
|
42
54
|
## [0.6.3] - 2026-09-15
|
|
43
55
|
|
|
44
56
|
### 修复
|
|
45
|
-
-
|
|
57
|
+
- **配置卡片的展开箭头与宿主不一致**:原先使用文本字符 `⌄`,比宿主的 14×14 图标更细,旋转时位置偏移;现改为与宿主相同的内联 SVG 箭头,绕自身中心翻转。
|
|
46
58
|
|
|
47
59
|
## [0.6.2] - 2026-09-15
|
|
48
60
|
|
|
49
61
|
### 新增
|
|
50
|
-
-
|
|
62
|
+
- **收起把手的垂直位置**:设置卡片新增滑块(0%–100%、每档 1%),决定面板收起后把手在对话区中的高度:0% 在最下、100% 在最上,默认 50%。
|
|
51
63
|
|
|
52
64
|
### 变更
|
|
53
|
-
-
|
|
65
|
+
- **写入默认值等于「未自定义」**:卡片中的字段回到默认值后会从设置的用户层移除,「已自定义」与「重置」标记随之消失。
|
|
54
66
|
|
|
55
67
|
### 修复
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
68
|
+
- **面板尺寸有时无法保存**:尺寸写入有 0.4 秒去抖,而台账在发起写入时即被标记——拖动后 0.4 秒内再次调整会取消前一次的写入,该尺寸此后不再保存。现在台账只在真正写入时标记。
|
|
69
|
+
- **偏小的面板尺寸无法保存**:读回的下限(180×160)与拖动的下限(120×60)不一致,现统一为 120×60。
|
|
70
|
+
- **高度为「自动」时第一次拖动会使面板跳动**:拖拽起点改为面板的实测高度。
|
|
59
71
|
|
|
60
72
|
## [0.6.1] - 2026-09-15
|
|
61
73
|
|
|
62
74
|
### 新增
|
|
63
|
-
-
|
|
64
|
-
-
|
|
75
|
+
- **面板缩放滑块**:设置卡片新增「面板缩放」(50%–200%、每档 5%),把面板内容等比缩放,面板本身的尺寸不变。拖动时只更新读数,松手后写入设置。
|
|
76
|
+
- **窄面板的顶栏**:面板变窄时四颗按钮保持在一行——先压缩中间的空白,挤满后整行可横向滚动,顶部灰色拖拽条随之渐隐。
|
|
65
77
|
|
|
66
78
|
### 变更
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
- **面板缩放只作用于内容**(见上):缩放因子作用在面板内部,面板自身的宽高、位置、折叠裁剪与其折叠动画都不受影响。
|
|
79
|
+
- **跳转动画改为浏览器自身的平滑滚动**(按真实时间推进,60Hz 与 240Hz 屏幕上时长一致);目标在滚动过程中移位或动画被打断时会重新瞄准,仅当浏览器把该调用执行为瞬移时才改用逐帧绘制。
|
|
80
|
+
- **面板尺寸取消上下限**:只保留仍能拖回的 120px 宽 / 60px 高下限。
|
|
70
81
|
|
|
71
82
|
### 修复
|
|
72
|
-
- **长距离跳转在 240Hz
|
|
73
|
-
-
|
|
83
|
+
- **长距离跳转在 240Hz 屏幕上过快**:原动画按帧数计时,240Hz 下仅约 190ms。现在按真实时间推进,与刷新率无关。
|
|
84
|
+
- **拖动面板尺寸后会自动回到原尺寸**:面板把「传出改动」与「采纳外部改动」记录在同一份台账中,拖动期间一旦有设置写入,就会用尚未保存的旧值把面板拉回。现在两条路径分开记录。
|
|
74
85
|
|
|
75
86
|
## [0.6.0] - 2026-09-14
|
|
76
87
|
|
|
77
88
|
### 新增
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
89
|
+
- **界面中英双语**:语言设置可选 `跟随宿主`(默认)、`中文`、`English`;中文时间戳保留「昨天 / 前天」,英文使用 `yesterday` 与日期形式。
|
|
90
|
+
- **插件配置卡片**:**设置 → 插件 → 插件配置** 中的「对话大纲」卡片集中管理语言、默认停靠边缘、显示的标题层级、模糊搜索、悬停预览与诊断开关;改动过的字段标有「已自定义」并支持单独重置。
|
|
91
|
+
- **面板与卡片实时同步**:两者读写同一份偏好,任一侧改动后另一侧立即生效,无需刷新。
|
|
92
|
+
- **偏好保存到 DSH 设置**:偏好写入宿主设置文档(跟随配置),浏览器本地保留一份镜像供无法写入设置的页面使用;0.5.x 的本地值在宿主层首次应答时导入一次。
|
|
82
93
|
|
|
83
94
|
### 变更
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
- **诊断开关进入设置卡片**:可以在卡片里点选,而且打开后当下就会打印一行挂载诊断,不再需要手动改 `localStorage` 再刷新。
|
|
95
|
+
- **长距离跳转恢复动画**:由插件逐帧绘制(按时长而非帧数),每帧重新瞄准目标、落点后短暂复检,跨页远跳不再半途停止。
|
|
96
|
+
- **面板拉高后大纲自动填满**,最新一组下方不再留白。
|
|
97
|
+
- **「正在阅读」蓝框的渐显渐隐时间加长到 0.4 秒**。
|
|
98
|
+
- **顶边距、宽度、高度移出设置**,改为只能拖拽调整。
|
|
99
|
+
- **偏好写入合并**:不再在指针移动时反复写入存储,改为合并后延迟写入;诊断开关进入设置卡片,打开后立即打印。
|
|
90
100
|
|
|
91
101
|
### 修复
|
|
92
|
-
-
|
|
102
|
+
- **面板在部分会话中崩溃(React #310)**:渲染路径上的 hook 数量不一致,面板连同槽位一起消失。现在拆分为不调用 hook 的外层守卫与内层组件。
|
|
93
103
|
|
|
94
104
|
## [0.5.1] - 2026-09-13
|
|
95
105
|
|
|
96
106
|
### 新增
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
107
|
+
- **「回到底部」浮动按钮**:列表不在底部时显示,点击回到最新一条,到底后隐藏。
|
|
108
|
+
- **回合时间带日期**:昨天、前天分别显示「昨天 / 前天 + 时间」,更早显示 `YY-MM-DD HH:MM`(按自然日判定)。
|
|
109
|
+
- **失败回合的报错**:请求超时、上游报错等回合在组头下显示 `请求失败` 与报错原文,点击跳到该位置,报错原文也可被搜索命中。
|
|
100
110
|
|
|
101
111
|
### 变更
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
112
|
+
- **标题栏改为一边两个按钮**(左:层级筛选、停靠切换;右:搜索、收起),并移除左侧的三条杠。
|
|
113
|
+
- **层级筛选弹层改为左对齐按钮**。
|
|
114
|
+
- **挂载诊断日志默认静默**,需要时把 `dsh-quick-toc.debug` 设为 `1` 后刷新。
|
|
115
|
+
- **长距离跳转改为即时定位**,落地后进行短暂校验。
|
|
106
116
|
|
|
107
117
|
### 修复
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
118
|
+
- **失败或中止的回合被误标为「未加载」**:现在这些回合按已加载处理,失败回合额外显示报错行。
|
|
119
|
+
- **从大纲向上加载更早消息时,对话区会回到最新一条**:翻页前先把对话区移出贴底区域。
|
|
120
|
+
- **无标题回合的组头格式与其他组头不一致**:现在共用同一套样式。
|
|
111
121
|
|
|
112
122
|
## [0.5.0] - 2026-09-12
|
|
113
123
|
|
|
114
124
|
### 新增
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
|
|
123
|
-
### 变更
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
125
|
+
- **全量回合索引**:接入宿主投影后大纲覆盖整段会话,未加载的回合带「未加载」标记与宿主提供的预览,点击后加载该回合并滚动过去。
|
|
126
|
+
- **标题行副标题**:每个标题下方显示该节正文的第一句,便于区分同名标题。
|
|
127
|
+
- **悬停预览**:指针停在标题行约 0.26 秒后显示预览卡片(标题、时间、层级路径、该节开头);面板停靠右侧时显示在左侧。
|
|
128
|
+
- **搜索归一化(常开)**:大小写、全角半角与空白差异视为同一个匹配。
|
|
129
|
+
- **「模糊」开关**:允许关键字中间夹少量其他文字,状态会被记住。
|
|
130
|
+
- **未加载的回合也可被搜索到**:全文范围同时搜索这些回合的预览文本。
|
|
131
|
+
- **边界提示**:搜索结果下方提示可加载更早的消息;滚动到最早或最后仍继续滚动时,面板底部显示提示,停留约 2.6 秒。
|
|
132
|
+
|
|
133
|
+
### 变更
|
|
134
|
+
- **自动跟随更及时**:移除人为延时、改为瞬时定位、缩短高亮过渡;跟随不再依赖挂载时获取的滚动容器,改为在 document 捕获阶段监听并在每次运行时重新查询。
|
|
135
|
+
- **正在阅读的回合改用封闭蓝框**标记,其余回合的暗度减弱,面板静止透明度提高到 0.72。
|
|
136
|
+
- 无标题回合的时间行提升为正文级字号与字重。
|
|
137
|
+
- 界面激活态配色统一到单一色源。
|
|
138
|
+
- 向上滚动时的「加载更早」加入节流,避免连续触发分页。
|
|
139
|
+
- 界面文案统一到一张字符串表,为后续双语做准备。
|
|
130
140
|
|
|
131
141
|
### 修复
|
|
132
|
-
-
|
|
133
|
-
-
|
|
142
|
+
- **用对话右侧的回合轨道跳转后,大纲不再跟随、也不再点亮**(滚动监听绑定在被替换的容器上):改为在 document 捕获阶段监听并重新查询容器。
|
|
143
|
+
- **没有 Markdown 标题的回合不会被标记为「正在阅读」**(映射只登记了带标题的消息):现在该回合的所有节点都会登记。
|
|
134
144
|
|
|
135
145
|
## [0.4.0] - 2026-09-11
|
|
136
146
|
|
|
137
147
|
### 新增
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
148
|
+
- **搜索结果列表**:有搜索词时大纲切换为结果列表(标题高亮、层级路径、回合时间、重复次数,全文模式附片段),最新的命中在底部,点击任一行即设为当前命中并在对话中高亮滚动;`n/N` 回车逐处跳保留
|
|
149
|
+
- **组头吸顶**:当前回合的组头固定在面板顶部
|
|
150
|
+
- **层级筛选行可收起**:标题栏的「层级」按钮收起/展开 `1`–`6` 那一行
|
|
151
|
+
- **位置面包屑**:面板顶部显示正在阅读的章节路径,点击跳到该标题
|
|
152
|
+
- **标题层级筛选**:`1`–`6` 芯片各自独立,可任意组合;全部关闭时恢复显示六级
|
|
143
153
|
|
|
144
154
|
### 变更
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
- `countOccurrences`
|
|
155
|
+
- **性能**:标题解析与文本提取按节点缓存,流式更新只重算真正变化的节点
|
|
156
|
+
- 组头(时间行)点击改为跳到该回合模型回答的开头
|
|
157
|
+
- 声明兼容 DSH `0.1.5-rc.1` 与 `0.1.5-rc.2`
|
|
158
|
+
- `countOccurrences` 增加空查询守卫
|
|
149
159
|
|
|
150
160
|
### 修复
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
161
|
+
- **首次载入没有定位到最新回合**:副作用的依赖写在声明之前,只执行了一次
|
|
162
|
+
- **拖动顶部横条后记录的位置是拖动前的**,刷新后面板回到原位
|
|
163
|
+
- **同一文本节点中的第二处命中不被高亮**,跳转到该处时只滚动、不高亮
|
|
164
|
+
- **围栏代码块中的 `#` 行被当作标题**,使其后真标题的序号错位
|
|
155
165
|
|
|
156
166
|
## [0.4.1] - 2026-09-12
|
|
157
167
|
|
|
158
168
|
### 变更
|
|
159
|
-
-
|
|
160
|
-
-
|
|
169
|
+
- **层级筛选改为弹出选择**:标题栏新增圆形按钮,点击后从按钮中心弹出 H1–H6 选择层,收回时缩回并渐隐,不再单独占一行
|
|
170
|
+
- 移除面板顶部的位置面包屑行(0.4.0 新增)
|
|
161
171
|
|
|
162
172
|
## [0.3.3] - 2026-09-10
|
|
163
173
|
|
|
164
174
|
### 新增
|
|
165
|
-
-
|
|
175
|
+
- 中间列切换到其他视图时,大纲面板与边缘把手渐隐,切回对话视图时渐显
|
|
166
176
|
|
|
167
177
|
### 变更
|
|
168
|
-
- 兼容性只声明 DSH `0.1.5-rc.1
|
|
169
|
-
- README
|
|
170
|
-
-
|
|
178
|
+
- 兼容性只声明 DSH `0.1.5-rc.1`
|
|
179
|
+
- README 补充搜索与跳转相关说明;兼容表列出最近两个版本各自支持的 DSH 版本
|
|
180
|
+
- CHANGELOG 拆分为中英两份;Release 描述默认取中文段,英文段折叠在下方
|
|
171
181
|
|
|
172
182
|
## [0.3.2] - 2026-09-08
|
|
173
183
|
|
|
174
184
|
### 变更
|
|
175
|
-
- 文档整理:README 的兼容表与功能列表更新,npm
|
|
185
|
+
- 文档整理:README 的兼容表与功能列表更新,npm 描述补充关键字搜索与对话内高亮
|
|
176
186
|
|
|
177
187
|
## [0.3.1] - 2026-09-08
|
|
178
188
|
|
|
179
189
|
### 修复
|
|
180
|
-
- 面板与收起把手不再浮在 DSH
|
|
181
|
-
- 圆形控件在 DSH 0.1.5-rc.1
|
|
190
|
+
- 面板与收起把手不再浮在 DSH 弹层之上(z-index 改为 500)
|
|
191
|
+
- 圆形控件在 DSH 0.1.5-rc.1 上恢复为正圆:该主题的 `corner-shape` 会把 50% 圆角变为方圆角
|
|
182
192
|
|
|
183
193
|
### 变更
|
|
184
|
-
- 兼容声明加入 DSH `0.1.5-rc.1
|
|
194
|
+
- 兼容声明加入 DSH `0.1.5-rc.1`
|
|
185
195
|
|
|
186
196
|
## [0.3.0] - 2026-08-24
|
|
187
197
|
|
|
188
198
|
### 修复
|
|
189
|
-
-
|
|
190
|
-
- 对话数据访问由 `useSession
|
|
191
|
-
- 面板挂载改到会话作用域的 `conversation.input.overlay`
|
|
199
|
+
- 适配 DSH 0.1.2-rc.1:不再因 `dsh-client-runtime` 被移除而加载失败,运行时 hook 改由会话作用域槽位的 props 注入
|
|
200
|
+
- 对话数据访问由 `useSession` 改为会话作用域的 `useChat`
|
|
201
|
+
- 面板挂载改到会话作用域的 `conversation.input.overlay` 槽,解决子槽始终空渲染
|
|
192
202
|
|
|
193
203
|
### 变更
|
|
194
|
-
- `dsh.client.inject` 改为列出 `dsh-client-ui-chat` /
|
|
195
|
-
- 从客户端 inject
|
|
204
|
+
- `dsh.client.inject` 改为列出 `dsh-client-ui-chat` / `-conversation` / `-layout`,替代已移除的运行时包
|
|
205
|
+
- 从客户端 inject 列表移除未使用的 `sessions` 服务
|
|
196
206
|
|
|
197
207
|
### 新增
|
|
198
|
-
-
|
|
208
|
+
- 版本守卫:声明 `dsh.compatibility.dshReleases` 与 `engines.dsh` 供市场做安装前兼容预检,并以 peerDependencies 约束相关 DSH 包;`chat` hook 不可用时优雅降级
|
|
199
209
|
|
|
200
210
|
## [0.2.2] - 2026-08-24
|
|
201
211
|
|
|
202
212
|
### 新增
|
|
203
|
-
-
|
|
213
|
+
- 关键字搜索:放大镜打开搜索框,回车逐处跳转(`n/N` 计数),Esc 或再次点击放大镜关闭
|
|
204
214
|
- 搜索范围切换:仅标题,或同时搜索用户消息与 AI 回复正文
|
|
205
215
|
- 对话内高亮:命中的关键字在对话中高亮,当前命中单独标亮并滚动到视口中上部
|
|
206
216
|
- 同一条消息内的多次命中都计入 `n/N`
|
|
207
|
-
-
|
|
217
|
+
- 无标题的回合也有独立的时间条目;所有组头显示该回合首行预览
|
|
208
218
|
|
|
209
219
|
### 变更
|
|
210
|
-
-
|
|
220
|
+
- 两种停靠的面板收起动画统一(沿侧栏/屏幕边缘裁切,移除阴影)
|
|
211
221
|
- 非激活的大纲组降到 0.6 不透明度
|
|
212
222
|
|
|
213
223
|
## [0.1.1] - 2026-08-17
|
|
214
224
|
|
|
215
225
|
### 变更
|
|
216
|
-
- 发布流程额外上传稳定命名的 tarball(`dsh-quick-toc.tgz
|
|
226
|
+
- 发布流程额外上传稳定命名的 tarball(`dsh-quick-toc.tgz`),让 `/releases/latest/download/` 始终指向最新版本
|
|
217
227
|
|
|
218
228
|
## [0.1.0] - 2026-08-17
|
|
219
229
|
|
|
220
230
|
### 新增
|
|
221
231
|
- 按回合分组的大纲:每条用户消息与其后续 AI 回复为一组,组头显示该组的结束时间
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
-
|
|
226
|
-
-
|
|
227
|
-
-
|
|
228
|
-
-
|
|
232
|
+
- 自动跟随高亮:对话视口内的回合在大纲中点亮,大纲自动滚动保持可见
|
|
233
|
+
- 平滑跳转:点击标题平滑滚动到对话中该标题的位置
|
|
234
|
+
- 左右停靠、拖拽调整大小、收起为边缘把手
|
|
235
|
+
- 滚动条随停靠方向(停靠左侧时在左,右侧时在右)
|
|
236
|
+
- 分页渲染:默认显示最新的若干组,向上滚动加载更早的组
|
|
237
|
+
- 自动「加载更早」:大纲到达顶部且已全部加载时,会点击对话自身的加载按钮
|
|
238
|
+
- 组头时间跳转:点击时间标签跳到该回合开头
|
|
229
239
|
- Markdown 感知标题:剥离 `**加粗**`、`*斜体*`、`` `代码` ``、`[链接](url)`、`~~删除线~~`
|
|
230
240
|
- 面板状态持久化(停靠边、位置、尺寸),并从旧键名自动迁移
|
|
231
241
|
- 对话无标题时自动隐藏;支持亮/暗主题
|
package/README.en.md
CHANGED
|
@@ -31,6 +31,7 @@ A conversation TOC plugin for [DeepSeek Harness](https://github.com/deepseek-ai/
|
|
|
31
31
|
- **Back to where I left** — closing the panel or the curtain remembers the row that was at the top (each surface keeps its own, and neither overwrites the other); the next time that surface opens, a floating button in the list's upper-right corner returns that row to **where it sat**. It fades out — and forgets the record — once it is used, or as soon as you scroll back there yourself, until the next close. Under the same rule, opening the panel or the curtain puts the **row being read** at the top of the list (when that turn is one of the newest few the list is already at its end, so the row lands at the bottom)
|
|
32
32
|
- **Dockable and resizable** — drag the top bar to move the panel, ◀ / ▶ to dock left or right, drag an edge to resize (no upper bound, down to 120px wide), and collapse it into an edge handle (its height is set by the card's "Handle position"); position and size are remembered per browser (top offset, width and height are adjusted by dragging only)
|
|
33
33
|
- **Panel scale** — a slider in the settings card scales the **content** (text, icons, buttons and their spacing) from 50% to 200% in 5% steps while the **panel's own size stays exactly as dragged**; dragging only moves the readout, and the settings document is written once you let go. A narrow panel keeps its four header buttons on one line: the empty middle gives way first, then the whole row scrolls sideways (wheel over the header), and the grey grab bar fades out
|
|
34
|
+
- **Curtain scale** — a second slider scales the **curtain's content** from 50% to 200% in 5% steps while the curtain's own size stays as it is; the panel scale and the curtain scale are independent of each other. The curtain's content starts one notch smaller than before (100% on the slider is 90% of the previous size), and only the outline inside the curtain is scaled — the conversation itself is untouched
|
|
34
35
|
- **Paging** — the most recent groups show first; scrolling up both expands the index and loads older conversation
|
|
35
36
|
- **Edge hints** — a brief hint at the bottom of the panel when you keep scrolling past the first or the last entry
|
|
36
37
|
- **Markdown-aware** — inline markup in headings is stripped; `#` lines inside fenced code blocks are not headings
|
|
@@ -41,7 +42,7 @@ A conversation TOC plugin for [DeepSeek Harness](https://github.com/deepseek-ai/
|
|
|
41
42
|
|
|
42
43
|
| Plugin | Supported DSH |
|
|
43
44
|
| --- | --- |
|
|
44
|
-
| **0.7.x** (latest, 0.7.
|
|
45
|
+
| **0.7.x** (latest, 0.7.3) | 0.1.5-rc.1, 0.1.5-rc.2, 0.1.5-rc.3, 0.1.7-alpha.1, 0.1.7-alpha.2 |
|
|
45
46
|
| 0.6.x (0.6.3) | 0.1.5-rc.1, 0.1.5-rc.2 |
|
|
46
47
|
| 0.5.x (0.5.1) | 0.1.5-rc.1, 0.1.5-rc.2 |
|
|
47
48
|
| 0.4.x (0.4.1) | 0.1.5-rc.1, 0.1.5-rc.2 |
|
|
@@ -50,7 +51,7 @@ A conversation TOC plugin for [DeepSeek Harness](https://github.com/deepseek-ai/
|
|
|
50
51
|
|
|
51
52
|
Each major line lists only its newest patch (the defects a new feature introduces are fixed in the patches that follow, so within one major line the newest patch is the one to use; older patches keep working — the plugin does not break existing interfaces).
|
|
52
53
|
|
|
53
|
-
`engines.dsh`
|
|
54
|
+
`engines.dsh` is declared as **`>=0.1.5-rc.1 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0`**, with the peer ranges shaped the same way (a prerelease must be given an explicit branch: node-semver admits one only when some comparator in the range sits on that version's exact `major.minor.patch` tuple and carries a prerelease tag of its own, so a plain `>=0.1.5-rc.1` never matches `0.1.7-alpha.1`). 0.7.3 was tested on **0.1.5-rc.3** and **0.1.7-alpha.2** (the panel and the curtain, row jumps and older-history loading, the title/full-text/cross-session searches, switching sessions from a cross-session hit, the configuration card and the host settings document's reads and writes were each exercised), and neither release needed a code change — checked offline as well: rc.3 differs from rc.2 only in each package's `package.json` version (plus two sidebar files), and alpha.2's changes sit in the session controller and the chat renderer while every interface and node shape this plugin uses is still there (`turnOutline`, `turn-error`, `useChat`, `data-chat-anchor-key`, `sessions.search`, `loadThrough`, `settings.*` and both card slots; the two extra `data-conversation-scroll` hits in alpha.2 are stylesheet text, not a second scroll container). 0.7.2 was tested on **0.1.5-rc.2** (the curtain scale was confirmed point by point: at three factors the curtain box keeps its width, height and position while only the content scales, both slider ends, the write-on-release behaviour and the default rendering were exercised, and the two scales were confirmed independent); 0.7.1 was tested on **0.1.5-rc.2** (the "back to where I left" floating button, the leave positions the panel and the curtain record separately, the row being read landing at the top when a surface opens, and the absence of the button after closing at the bottom were each confirmed); 0.7.0 was tested on the same release (the full-width curtain and its droplet handle, the jump-to-section-end buttons, cross-session search, keyboard navigation, the questions-only view and the remembered reading position were each exercised in a real browser; the panel scale, a dragged size reaching storage and coming back, and the collapsed handle's position had been measured before that); on **0.1.5-rc.1** the plugin's loading and client-module delivery were tested for real (the host boots without errors, `--dump-config` carries the quick-toc entry, the combined client bundle URL lists `dsh-quick-toc/client.js`, and the bytes it serves contain this release's curtain handle, jump-to-section-end and reading-position markers). The host interfaces it relies on — the `turnOutline` projection, the session-scoped `useProjection`, the client `sessions` service and its `loadThrough` jump loader (since 0.5.0), the `turn-error` node used for failed turns (since 0.5.1), and the host `settings` service (`installSection`), the client `settingsScope` and the `settings.plugin.item` card slot added in 0.6.0, and the client `sessions.search` that 0.7.0's cross-session search calls — were checked one by one against the installed 0.1.5-rc.1 and 0.1.5-rc.2 bundles, whose code is byte-identical between the two releases (`dsh-client-ui-chat` differs by a single CSS declaration unrelated to this plugin, and the package that carries `search`, `dsh-api-session-controller`, is byte-identical down to the same limits: at most 20 hits per search, 240 code points per snippet), so both releases are claimed. Older DSH versions are unverified and therefore not claimed; on an older DSH the newest usable plugin version is **0.3.2**. **0.1.7-alpha.1 passes too**, in a real instance inside an isolated `DSH_HOME`: the host boots without errors, and the panel and curtain, row jumps and older-history loading, the title/full-text/cross-session searches and switching sessions from a cross-session hit were each exercised in a real browser, with the settings document's reads and writes confirmed as well. To that end 0.7.2 speaks both host lines — on 0.1.5-rc.x it uses the host's `settings.installSection`, the client `settingsScope` and the `settings.plugin.item` card slot; on 0.1.7-alpha.x it uses `settings.configure`, the client `configForms` and the `plugins.bundle.config` card slot, and switches sessions through `uiWorkspace.openSession`. The plugin picks whichever exists at runtime, and **declares no settings service in `inject` at all** (declaring one a host does not provide parks the whole package, which on 0.1.7-alpha.1 stopped the entire web boot from finishing). On install or update, the market (dshmarket) reads `engines.dsh` (or `dsh.engines.dsh`) and the `@deepseek-ai/dsh-*` peer ranges present in the local install from the npm `latest` manifest, shows the host requirement a plugin declares on its card, and offers an optional filter that hides only entries confirmed to mismatch the running host; `dsh.compatibility.dshReleases` is this repository's own record, read by neither DSH nor the market.
|
|
54
55
|
|
|
55
56
|
## Install
|
|
56
57
|
|
|
@@ -112,9 +113,9 @@ A missing `turnOutline` means the host has no such projection, and the staged `j
|
|
|
112
113
|
- The "unloaded turn" capability needs two host facilities: the `turnOutline` projection (the whole-session turn index, each entry carrying its `turn/start` seq) and the turn-jump loader (the client `sessions` service's `binding(sessionId).session.loadThrough(seq)`, reached through the client ctx's declaration-free `ctx.get("sessions")` lookup). Each degrades on its own: without the projection the outline lists loaded turns only, without the loader unloaded entries are shown but not jumped to, and nothing else in the panel is affected.
|
|
113
114
|
- The failure row reads the host's `turn-error` conversation node (published when `turn/end` carries an `error` reason, with `message` and an optional `code`); on a host without that node the row is simply absent and nothing else changes.
|
|
114
115
|
- Interface text lives in one string table at the top of `lib/client.js` (`DICTS`, one Chinese and one English copy) and the language setting picks between them: on `follow the host` the host's translate function (`ctx.locale.bind("dsh-quick-toc")`, fed by the same `DICTS` tables) is asked first and the built-in table is only the fallback. The two tables must stay key-aligned; the only Chinese-only entry is `time.beforeYesterday` (English carries the date for anything older than yesterday), while `time.yesterday` exists in both (`yesterday`).
|
|
115
|
-
- Preferences sit in two layers behind one module-level store: the Host settings document (
|
|
116
|
+
- Preferences sit in two layers behind one module-level store: the Host settings document (language, docked edge, levels, scale, handle position, remembered reading position, fuzzy, hover and diagnostic; authoritative on a loopback page) and `localStorage` (the mirror, plus the real storage for top offset / width / height, which describe this screen and are saved per browser). **The host layer itself is one of two dialects, whichever the running host offers**: on 0.1.5-rc.x it is `ctx.settingsScope.bind({ namespace: "dsh-quick-toc" })` (addressed by namespace), while on 0.1.7-alpha.x it is `ctx.configForms.get(<profile entry id>)` (addressed by profile entry id, the client recognising its own entry by the schema the host serves). Both expose the same methods over the same snapshot fields, so the store stays one. Writes are routed per field: host fields go through `scope.mutate` (folded in locally, reconciled when the host answers), everything else goes to `localStorage`; a value that IS the field's default is written by removing that entry from the user layer instead (the same thing as "not customized"). On a non-loopback page DSH marks settings read-only, so those nine preferences fall back to the mirror and behave exactly as in 0.5.x; values left by a 0.5.x install are imported into the host layer once, the first time it answers (and only while the user layer is empty). Once the host has answered, that layer is authoritative — which is why a local key such as `localStorage['dsh-quick-toc.debug']` no longer takes effect on a loopback page: use the switch in the card.
|
|
116
117
|
- The curtain and the docked panel **share one list DOM**: the curtain only moves the panel itself into a full-width container that drops from the lower edge of the tab strip (in curtain mode the panel swaps to a different geometry — relative positioning, 100% width and height, no panel scale), and that container stays mounted as a zero-size pass-through while the curtain is up, so opening or closing it never rebuilds the list or loses the scroll position. Cross-session search goes through the client `ctx.get("sessions")` service's `search(query, signal)` (the host's session full-text index, at most 20 hits per search); each session's reading position lives in this browser (`dsh-quick-toc.readPos.v1`, valid for half an hour).
|
|
117
|
-
- The configuration card
|
|
118
|
+
- The configuration card is registered into one of two slots, whichever the running host offers: on 0.1.5-rc.x it is `settings.plugin.item` (keyed on the plugin's namespace; the slot is dispatched only for namespaces the Host actually serves, so a deployment without the host half simply shows no card and the panel is unaffected), and on 0.1.7-alpha.x it is `plugins.bundle.config` (keyed on the npm package name, so the card appears on that bundle's page in the sidebar's Plugins list). Both registrations happen only once a settings scope has bound, and the card and the panel share the store above, which is what makes the two live in both directions.
|
|
118
119
|
- Changes to `lib/client.js` show up after a page refresh (client modules are served under a content hash and DSH's client HMR pushes reloads); changes to `lib/index.js` (the host half) need a DSH restart
|
|
119
120
|
|
|
120
121
|
## License
|
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
- **回到我离开的位置** —— 关闭面板或幕布时记住列表顶部那一行(两者各记各的、互不覆盖),下次打开时列表右上角出现向上的浮动按钮,一步回到那一行的**原位置**;用过一次或自己滚回该处就渐隐并忘掉,直到下次关闭再记。同一规则下,打开面板或幕布时**正在阅读的那一行**会落在列表顶部(读的就在最新几轮时列表已经到底,那一行自然停在底部)
|
|
32
32
|
- **可停靠、可缩放** —— 拖顶部横条移动,◀ / ▶ 切换左右停靠,拖边缘调宽高(尺寸没有上限,最窄可到 120px),收起后成为边缘把手(停在什么高度由设置里的「把手位置」决定);位置与尺寸按浏览器记住(顶边距、宽度、高度只通过拖拽调整)
|
|
33
33
|
- **面板缩放** —— 设置里的滑块把**内容**(文字、图标、按钮及其间距)在 50%–200% 之间按 5% 一档缩放,**面板本身的尺寸不变**;拖动滑块时只移动读数,松手才写入设置。面板变窄时顶栏四颗按钮保持一行:先挤掉中间的空白,挤满后整行可横向滚动(在顶栏上滚滚轮即可),此时顶部的灰色拖拽横条渐隐消失
|
|
34
|
+
- **幕布缩放** —— 另一个滑块,把**幕布内容**在 50%–200% 之间按 5% 一档缩放,幕布本身的尺寸不变;与面板缩放各自独立、互不影响。幕布内容的默认大小比此前小一档(滑块的 100% 即此前的 90%),且只缩放幕布里的大纲,不改变对话本体
|
|
34
35
|
- **分页** —— 默认显示最近的若干组,向上滚动既展开索引也加载更早的对话
|
|
35
36
|
- **边界提示** —— 滚到最早或最新再继续滚动时,面板底部短暂提示
|
|
36
37
|
- **Markdown 感知** —— 标题中的行内标记会被剥离;围栏代码块里的 `#` 行不算标题
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
|
|
42
43
|
| 插件版本 | 支持的 DSH 版本 |
|
|
43
44
|
| --- | --- |
|
|
44
|
-
| **0.7.x**(最新,0.7.
|
|
45
|
+
| **0.7.x**(最新,0.7.3) | 0.1.5-rc.1、0.1.5-rc.2、0.1.5-rc.3、0.1.7-alpha.1、0.1.7-alpha.2 |
|
|
45
46
|
| 0.6.x(0.6.3) | 0.1.5-rc.1、0.1.5-rc.2 |
|
|
46
47
|
| 0.5.x(0.5.1) | 0.1.5-rc.1、0.1.5-rc.2 |
|
|
47
48
|
| 0.4.x(0.4.1) | 0.1.5-rc.1、0.1.5-rc.2 |
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
|
|
51
52
|
每个大版本只列该系列最新的一个补丁版本(新功能引入的缺陷都在其后的补丁里修掉了,所以同一个大版本内直接用最新补丁即可;旧补丁仍可继续用,插件不破坏既有接口)。
|
|
52
53
|
|
|
53
|
-
`engines.dsh`
|
|
54
|
+
`engines.dsh` 声明为 **`>=0.1.5-rc.1 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0`**,peer 范围同形(预发布版本必须显式留分支:node-semver 只在一个范围的某个比较符与该版本落在同一个 `major.minor.patch` 元组、且自身带预发布标签时才放行它,所以写成 `>=0.1.5-rc.1` 是匹配不到 `0.1.7-alpha.1` 的)。0.7.3 在 **0.1.5-rc.3** 与 **0.1.7-alpha.2** 上实测通过(面板与幕布、点行跳转与翻历史、标题/全文/跨会话三档检索、跨会话命中切换会话、设置卡片与宿主设置文档的读写都逐项跑过),这两版不需要任何代码改动——离线核对:rc.3 相对 rc.2 只有各包 `package.json` 的版本号差异(外加侧边栏两个文件),alpha.2 的改动集中在会话控制器与聊天渲染,但插件依赖的接口与节点形状逐项核对后仍在(`turnOutline`、`turn-error`、`useChat`、`data-chat-anchor-key`、`sessions.search`、`loadThrough`、`settings.*` 与两张卡片槽位都在,`data-conversation-scroll` 在 alpha.2 里新增的两处命中是样式表文本、不是第二个滚动容器)。0.7.2 在 **0.1.5-rc.2** 上实测通过(幕布缩放逐项确认:三档因子下幕布盒子的宽高与位置不变、只有内容按比例缩放,50%–200% 两端、松手写入、以及默认值渲染都比对过;面板与幕布两套缩放各自独立);0.7.1 在 **0.1.5-rc.2** 上实测通过(「回到我离开的位置」浮动按钮、面板与幕布分别记录的离开位置、打开时落在正在阅读的那一行、以及在底部关闭再打开不出按钮都逐项确认);0.7.0 在同一版本上实测通过(全屏幕布与液滴把手、跳到本节末尾、跨会话检索、键盘导航、只看提问、记住阅读位置都在真实浏览器里逐项跑过;面板缩放、尺寸的落盘与读回、收起把手的位置等既有能力此前已实测);**0.1.5-rc.1** 上实测了插件加载与客户端模块下发(宿主启动无报错、`--dump-config` 里有 quick-toc 条目、客户端组合包 URL 里列出 `dsh-quick-toc/client.js`,取回的下发内容包含本版新增的幕布把手、跳到本节末尾与阅读位置等标记),它依赖的宿主接口——`turnOutline` 投影、会话级槽位的 `useProjection`、客户端 `sessions` 服务与 `loadThrough` 跳转加载器(0.5.0 起)、失败回合所用的 `turn-error` 节点(0.5.1 起)、以及 0.6.0 新增的宿主 `settings` 服务(`installSection`)、客户端 `settingsScope` 与 `settings.plugin.item` 配置卡片槽位、以及 0.7.0 跨会话检索所用的客户端 `sessions.search`——在 0.1.5-rc.1 与 0.1.5-rc.2 的安装包中逐个核对存在(这些宿主包的代码在两版之间逐字节相同,`dsh-client-ui-chat` 仅差一条与本插件无关的 CSS 声明;`search` 所在的 `dsh-api-session-controller` 两版逐字节相同,含「一次最多 20 条、片段上限 240 字符」的同一套上限),因此两版都声明兼容。更早的 DSH 版本未经验证,不作声明;在更早的 DSH 上可安装的最新插件版本是 **0.3.2**。**0.1.7-alpha.1 上也实测通过**(隔离的 `DSH_HOME` 里跑真实实例):宿主启动无报错、面板与幕布、点行跳转与翻历史、标题/全文/跨会话三档检索、跨会话命中切换会话,都在真实浏览器里逐项跑过,设置文档的读写也逐项确认。为此 0.7.2 同时支持两条宿主线——0.1.5-rc.x 上是宿主的 `settings.installSection` + 客户端 `settingsScope` + `settings.plugin.item` 卡片槽位,0.1.7-alpha.x 上换成 `settings.configure` + 客户端 `configForms` + `plugins.bundle.config` 卡片槽位、并用 `uiWorkspace.openSession` 切换会话;插件在运行时按服务是否存在二选一,且**不再把任一设置服务写进 `inject`**(声明一个宿主没有的服务会让整个包停在 pending,0.1.7-alpha.1 上这曾让整页 Web 起不来)。安装或更新时,市场(dshmarket)读取 npm 上 `latest` 版本的 `engines.dsh`(或 `dsh.engines.dsh`)与本机存在的 `@deepseek-ai/dsh-*` peer 范围,在卡片上显示该插件声明的宿主要求,并提供「只显示与当前宿主确认匹配的条目」这一可选过滤;`dsh.compatibility.dshReleases` 是本仓库自己的记录,DSH 与市场都不读取。
|
|
54
55
|
|
|
55
56
|
## 安装
|
|
56
57
|
|
|
@@ -112,9 +113,9 @@ dsh plugin --profile web add <插件目录路径>
|
|
|
112
113
|
- 「未加载回合」能力依赖宿主的两样东西:`turnOutline` 投影(整段会话的回合索引,每条含 `turn/start` 的 seq)与会话跳转加载器(客户端 `sessions` 服务的 `binding(sessionId).session.loadThrough(seq)`,通过客户端 ctx 的 `ctx.get("sessions")` 免声明查找取得)。两者各自独立降级:没有投影时只列已加载回合,没有加载器时未加载条目只展示、不跳转,面板其余功能不受影响。
|
|
113
114
|
- 失败回合的报错行读的是宿主的 `turn-error` 会话节点(宿主在 `turn/end` 的原因为 `error` 时发布,含 `message` 与可选的 `code`);宿主不提供该节点时只是不显示这一行,其余功能不受影响。
|
|
114
115
|
- 界面文字来自 `lib/client.js` 顶部的一张字符串表(`DICTS`,中英各一份),语言设置决定用哪一份:`跟随宿主` 时优先问宿主的翻译函数(`ctx.locale.bind("dsh-quick-toc")`,注册的表就来自 `DICTS`),拿不到才回退到内置表。中英两份表的键必须对齐(仅 `time.beforeYesterday`(前天)是中文独有——英文对更早的时间直接用日期;`time.yesterday` 两语言都有,英文作 `yesterday`)。
|
|
115
|
-
- 偏好存储分两层,由一个模块级 store
|
|
116
|
+
- 偏好存储分两层,由一个模块级 store 统一读出:宿主设置文档(语言/停靠边/层级/缩放/把手位置/记住阅读位置/模糊/悬停/诊断九项,回环页面上是权威层)与 `localStorage`(镜像 + 顶边距/宽度/高度三项的正式存储——它们描述"这一块屏幕",按浏览器保存)。**宿主那一层按运行中的宿主二选一**:0.1.5-rc.x 上是 `ctx.settingsScope.bind({ namespace: "dsh-quick-toc" })`(按命名空间寻址),0.1.7-alpha.x 上改成 `ctx.configForms.get(<profile entry id>)`(按 profile 条目 id 寻址,客户端按宿主实际服务的 schema 认出自己那一条);两者暴露的方法与快照字段相同,所以 store 只有一套。写入按字段路由:宿主字段走 `scope.mutate`(本地同步折叠、宿主应答后对账),其余写 `localStorage`;写入的值若正好是该字段的默认值,则改为把用户层里的这一项删掉(等同于"未自定义")。非回环页面 DSH 将设置标记为只读,此时这九项偏好退回本地镜像,行为与 0.5.x 一致;0.5.x 留下的本地值会在宿主层首次应答时导入一次(仅当用户层为空)。宿主应答之后宿主层就是权威层,因此 `localStorage['dsh-quick-toc.debug']` 这类本地键在回环页面上不再生效——诊断开关请用卡片里那一条。
|
|
116
117
|
- 幕布与停靠面板**共用同一份列表 DOM**:幕布只是把面板本体搬进一个从标签条下沿落下的整宽容器(面板在幕布态换一套几何:相对定位、宽高 100%、不套用面板缩放),容器本身常驻挂载、收起时是一个 0×0 的直通盒,所以开关幕布不会重建列表、也不会丢掉滚动位置。跨会话检索走客户端 `ctx.get("sessions")` 的 `search(query, signal)`(走宿主的会话全文索引,一次最多 20 条);每个会话的阅读位置存在浏览器本地(`dsh-quick-toc.readPos.v1`,半小时内有效)。
|
|
117
|
-
-
|
|
118
|
+
- 插件配置卡片也按宿主二选一注册:0.1.5-rc.x 上挂 `settings.plugin.item` 槽(`key` 为插件命名空间,该槽按宿主实际提供的命名空间派发,宿主半未加载时卡片自然不出现,面板不受影响);0.1.7-alpha.x 上改挂 `plugins.bundle.config` 槽(`key` 为 npm 包名,卡片出现在侧边栏「插件」页该 bundle 的页面上)。两条注册都只在设置作用域绑定成功后才做,卡片与面板共享上面那个 store,因此两边实时互通。
|
|
118
119
|
- 修改 `lib/client.js` 后刷新页面即可看到变化(客户端模块按内容哈希发版,DSH 的客户端 HMR 也会推送重载);改 `lib/index.js`(宿主半)需重启 DSH
|
|
119
120
|
|
|
120
121
|
## License
|