@tanzz/dsh-explore 0.2.0 → 0.3.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/README.md +22 -8
- package/README.zh-CN.md +21 -6
- package/client.js +1138 -404
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -29,15 +29,18 @@ A branch is not a prompt with history pasted into it. It is a real DSH session c
|
|
|
29
29
|
|
|
30
30
|
- **Infinite canvas** — drag to pan, scroll to zoom (20%–200%), fit to canvas; the minimap in the bottom-right corner shows the current viewport and jumps on click. On supported DSH layouts, the canvas extends behind the title and composer.
|
|
31
31
|
- **Both tree directions** — the toolbar carries a two-way layout switch: **top to bottom** or **left to right**. Both options are visible at once and the active one is pressed, so the current direction never has to be guessed from the shape of the canvas. The choice is saved in this browser and applies to other conversations.
|
|
32
|
+
- **Adjustable card density** — the toolbar offers three card presets: compact (288px), standard (320px) and roomy (448px). A preset sets both the card width and how many lines of the answer a preview draws; the tree reflows to the chosen width and the choice is remembered. Switch to roomy when the cards feel too small to show a useful answer.
|
|
32
33
|
- **Host appearance** — the interface follows DSH in eight languages (Chinese, English, German, Spanish, French, Japanese, Portuguese, Russian) and in both the light and the dark theme: elevation, overlay surfaces, scrollbars and native form controls are all theme-aware.
|
|
33
34
|
- **Fork from any answer** — the `+` in the corner of a finished card opens an inline composer; press Enter and the new node appears immediately.
|
|
34
35
|
- **Concurrent branches** — several branches can run at once. A running card carries a live progress row (spinner, "Thinking… / Calling read / Writing…", step N, elapsed seconds), renders streamed tokens as Markdown while they arrive, and offers Stop.
|
|
35
|
-
- **You can see what it is thinking** — an elapsed time says the agent is busy, not what it is doing. A running card carries
|
|
36
|
+
- **You can see what it is thinking** — an elapsed time says the agent is busy, not what it is doing. A running card carries one line of the model's newest thinking; settled, that line becomes "Reasoning · N chars". It is a readout, not a button: the card has exactly one way to enlarge ("Read full screen"), and the reader switches between the final answer and the reasoning inside the same card. The line is always one line, so the card does not move while tokens stream. A model that does not think shows none of this.
|
|
36
37
|
- **Waiting on you** — a branch parked on a question or an approval says so on its card ("Waiting for your answer…" / "Waiting for your approval…") with an accent ring; the canvas expands the path to it and centres it, and the toolbar chip "N waiting on you" jumps there. The path to a running or waiting node is never hidden by the default fold.
|
|
37
38
|
- **Jump to latest** — expands the ancestor path of the newest node and centres that card; newest is judged by creation time, so out-of-order completions cannot send you to a stale card.
|
|
38
39
|
- **Fold and search** — branches at depth 3 and deeper start folded, except on the path to a running or waiting node; `Ctrl/Cmd+F` focuses the search box, and Enter steps through matches, revealing their ancestor paths.
|
|
39
|
-
- **
|
|
40
|
-
- **
|
|
40
|
+
- **Prompt images stay on the card** — an image attached to a prompt renders as a 48px thumbnail on that card and, in the reader, at its own aspect ratio across the body (60vh tall at most), so a screenshot stays readable. The thumbnail reserves its frame from the image's own dimensions, so the card does not jump when the bytes arrive. A prompt that is only an image still gets a card: the picture is the question, so no "no question" placeholder is printed.
|
|
41
|
+
- **The card previews, the reader reads** — the card keeps the answer to a fixed number of lines with a fade, and there is no in-card "expand answer" any more: expanding there turned the card into a very long strip. The answer, the progress row and the thinking line share one content window: while a branch runs the window has a fixed height, and it settles to its content afterwards, so the canvas does not shake when several branches stream at once. The "Read full screen" button at the bottom is the card's only way in: Esc, the backdrop, or × closes the reader, and the reader itself switches between the final answer and the reasoning, and between a standard and a wider measure.
|
|
42
|
+
- **Branch rows stay out of the workspace** — every new branch is a real session, so DSH lists it as its own row by default. One toolbar chip switches the tree between "Branch rows: in workspace" and "Branch rows: archived" (listed by default; one click archives what already finished and new finished branches follow): archiving moves this tree's finished branch sessions into DSH's archive (the canvas still reads them; the workspace keeps the main session), and switching back restores them. Only finished branches are archived — a running or waiting branch always stays promptable.
|
|
43
|
+
- **Delete and restore** — deleting writes a tombstone and archives the fork's session; the toolbar restores them in one click. The session log itself is never rewritten. A branch the row policy quieted is not owned by that restore: the tombstone brings the node back on the canvas, and switching the branch rows back to the workspace brings its session back to the list.
|
|
41
44
|
|
|
42
45
|
## Requirements
|
|
43
46
|
|
|
@@ -100,12 +103,17 @@ test/motion.cjs camera interpolation, gesture interruption, nav
|
|
|
100
103
|
test/wheel-scroll.cjs the canvas yields the wheel to inner scroll areas and stops at their ends
|
|
101
104
|
test/live-clock.cjs the running card counts wall clock, and only one timer exists
|
|
102
105
|
test/reader-dialog.cjs the reader is a native modal: no hand-built focus trap, contained scroll
|
|
106
|
+
test/card-display.cjs three card densities, no in-card expand, reader width presets and geometry
|
|
107
|
+
test/card-reading.cjs a card that does not move while it streams, one enlarge entry, two reader panes
|
|
108
|
+
test/card-attachments.cjs prompt images: attachment refs projected and persisted, card thumbnails, image-only prompts
|
|
109
|
+
test/branch-sessions.cjs branch archive policy: finished only, switchable, unarchived around a fork
|
|
110
|
+
test/branch-archive-flow.cjs archive flow end to end: only after the turn, both switch directions, tombstone isolation
|
|
103
111
|
test/markdown-table.cjs GFM tables: alignment, escaped pipes, scrollable wrapper
|
|
104
112
|
test/markdown.cjs the whole supported Markdown surface, plus what it refuses
|
|
105
113
|
test/layout-direction.cjs horizontal and vertical geometry, unequal heights, collapsed branches
|
|
106
114
|
test/host-overlay.cjs conversation overlay, chrome measurement, reader and fallback
|
|
107
115
|
test/locale-parity.cjs all eight dictionaries: same key set, aligned {placeholders}, no cross-script leakage
|
|
108
|
-
test/reasoning.cjs the reasoning card: live
|
|
116
|
+
test/reasoning.cjs the reasoning card: live line, reader panes, no-reasoning, retry, cap, truthful count
|
|
109
117
|
test/reasoning-persist.cjs reasoning stays out of the snapshot and is re-derived after a reload
|
|
110
118
|
test/real-log.cjs end-to-end harness over a real session.v4.jsonl.zstd
|
|
111
119
|
docs/design.md design doc: data model, trade-offs, known gaps
|
|
@@ -121,17 +129,18 @@ The view is a single client plugin; the full design — data model, trade-offs,
|
|
|
121
129
|
- **Copy follows the host language.** Every visible string is a key in the `dsh-explore` namespace resolved through the client locale service, so switching language swaps the tab title and the whole view. A profile without the locale plugin falls back to the built-in Chinese/English tables, chosen by `document.documentElement.lang`.
|
|
122
130
|
- **Nodes are projections.** The view reads a session's `entries` (durable events plus the transient `assistant/live-chunk`) and projects one turn onto one card. Nothing extra is recorded, so continuing the chat in Chat simply grows the tree.
|
|
123
131
|
- **"Waiting on you" has no event of its own.** In the host, `ask_user_question` and approvals are just "a tool that has not returned yet": no `turn/end` is emitted while waiting and `running` stays `true`. The plugin derives the state from `tool/call` (`ask_user_question`, settled by `callId` in `tool/result`) and `approval/asked → approval/decided`, and relabels the card from calling a tool to waiting. `user/message` only ever carries `source.kind: 'user'` or `'user-question-reply'`, and both are projected.
|
|
124
|
-
- **Reasoning is visible, and it is already in the event window.** The model writes its thinking as `reasoning` content blocks — live as a `reasoning-delta` chunk on the transient `assistant/live-chunk`, settled as `{ type: 'reasoning', text }` inside the durable `assistant/message`. Both reach the plugin unchanged, so one projection covers "thinking now" and "done thinking": while a branch runs the card shows the newest line
|
|
132
|
+
- **Reasoning is visible, and it is already in the event window.** The model writes its thinking as `reasoning` content blocks — live as a `reasoning-delta` chunk on the transient `assistant/live-chunk`, settled as `{ type: 'reasoning', text }` inside the durable `assistant/message`. Both reach the plugin unchanged, so one projection covers "thinking now" and "done thinking": while a branch runs the card shows the newest line, and once it settles that line becomes the character count; the whole chain is one deliberate switch away in the reader. A model that does not think renders nothing. A retry reuses the same turn/step, so the failed attempt's thinking is dropped first. Each card keeps at most 12000 characters, and the dropped count is derived from the bytes each block delivered (`received − kept`) rather than accumulated, because a block is trimmed more than once. Reasoning is **not** persisted to `localStorage`: it is re-derived from the log, and that snapshot also holds the parent links, which cannot be rebuilt.
|
|
133
|
+
- **Attached images are content blocks, not text.** A `user/message` carries `content` as an array. Text is one kind of block and an attachment is another: `{ type: 'image', attachment: { attachmentId, mediaType, width, height, bytes, name } }` sits beside the text, so `textOf` never sees it. The projection keeps the refs in content order, an image-only prompt is admitted as a real question, and the refs ride in the snapshot because each one is a few hundred bytes while the image itself stays with the host. Rendering asks the host's authorized reader for the node's session: `peekImageUrl` first, which is why a re-opened card paints its thumbnails without a flash, then `imageUrl` when nothing is cached. That service is read defensively and stays out of the plugin's `inject` list, so a host without it loads the view with no thumbnails rather than failing.
|
|
125
134
|
- **The path to an active node is never folded.** Layout only walks unfolded nodes, and a folded node has no position and is never drawn — that was the root cause of "the canvas does not show the node that is running". So the ancestor path of a running or waiting node skips the default fold; a node entering the running state also expands and persists that path, and a node that starts waiting moves the canvas onto itself. The toolbar's running count and "waiting on you" count are both jump buttons.
|
|
126
135
|
- **Sessions get re-bound.** Leaving a conversation drops the host's reference; at zero the scope is collected and the `Session` instance is discarded together with its event window. On the way back, `materializeScope` mints a new `eventSource` and the window starts empty. Subscriptions therefore follow `eventSource` (the old one unsubscribes), an empty window is never treated as "the session is empty" and pruned, and a cold session is `open()`ed once — otherwise returning straight to the tab gives a blank canvas while Chat-then-tab works. `test/session-rebind.cjs` pins this.
|
|
127
|
-
- **Forks are real sessions.** `ctx.sessions.fork({ sessionId, atSeq })` gives the child the prefix context up to that answer. Each branch also lands in the session list, so it is renamed `⟂ parent question · new question` to stay recognisable.
|
|
136
|
+
- **Forks are real sessions.** `ctx.sessions.fork({ sessionId, atSeq })` gives the child the prefix context up to that answer. Each branch also lands in the session list, so it is renamed `⟂ parent question · new question` to stay recognisable. A client plugin cannot make that row a nested "subtask" — only host subagent sessions get hidden/nested rows — so the tree offers the one supported lever: a finished branch can be archived (readable, no longer listed, no longer promptable) and the toolbar switches the whole tree between listed and archived. `quieted` is tracked separately from the deletion tombstones so restoring a deleted node never surfaces a branch the policy quieted.
|
|
128
137
|
- **Parent links live locally.** This DSH build does not record `parentSession`, so the plugin keeps the tree in `localStorage`, alongside fold state, tombstones and the layout preference. Card heights are measured at runtime.
|
|
129
138
|
- **Theme.** All colours are `--dsw-alias-*` variables, so light and dark follow the host and no literal value is written. `--dsw-alias-brand-primary` inverts between themes, so primary-button text must use the matching `--dsw-alias-label-primary-foreground` rather than `#fff`; inline code is tinted with 7% `label-primary` because the official inline-code token is nearly white in light mode. Fonts read the composed `--dsw-font-family` / `--ds-font-family-code` tokens, which already join the user's font with the built-in fallback stack. `test/theme-tokens.cjs` guards all of it.
|
|
130
139
|
|
|
131
140
|
## Development
|
|
132
141
|
|
|
133
142
|
```bash
|
|
134
|
-
npm test #
|
|
143
|
+
npm test # every command below (scripts.test in package.json)
|
|
135
144
|
|
|
136
145
|
node --check client.js # syntax
|
|
137
146
|
node test/render-smoke.cjs # render the whole view with a fake React; assert both language tables
|
|
@@ -142,12 +151,17 @@ node test/motion.cjs # camera moves, gesture interruption, navigation r
|
|
|
142
151
|
node test/wheel-scroll.cjs # the wheel belongs to the reasoning box, not the canvas zoom
|
|
143
152
|
node test/live-clock.cjs # the elapsed time advances between events, from one timer
|
|
144
153
|
node test/reader-dialog.cjs # the reader is a native <dialog>: showModal, close mirroring, backdrop scroll containment
|
|
154
|
+
node test/card-display.cjs # three card densities, no in-card expand, reader width presets and reflow geometry
|
|
155
|
+
node test/card-reading.cjs # a card that does not move while it streams, one enlarge entry, two reader panes
|
|
156
|
+
node test/card-attachments.cjs # prompt images: attachment refs projected and persisted, thumbnails, image-only prompts
|
|
157
|
+
node test/branch-sessions.cjs # finished branches only, switchable policy, unarchived around a fork
|
|
158
|
+
node test/branch-archive-flow.cjs # archive flow end to end: only after the turn, both directions, tombstone isolation
|
|
145
159
|
node test/markdown-table.cjs # GFM tables in answers
|
|
146
160
|
node test/markdown.cjs # every Markdown construct the renderer supports
|
|
147
161
|
node test/layout-direction.cjs # geometry in both directions, unequal heights, collapsed branches
|
|
148
162
|
node test/host-overlay.cjs # host overlay, chrome measurement, reader, fallback
|
|
149
163
|
node test/locale-parity.cjs # all eight dictionaries agree on keys, placeholders and script
|
|
150
|
-
node test/reasoning.cjs # reasoning: live
|
|
164
|
+
node test/reasoning.cjs # reasoning: live line, reader panes, no-reasoning, retry, cap, truthful count
|
|
151
165
|
node test/reasoning-persist.cjs # reasoning stays out of the snapshot; re-derived after reload; parent links survive
|
|
152
166
|
```
|
|
153
167
|
|
package/README.zh-CN.md
CHANGED
|
@@ -29,15 +29,18 @@ DSH 探索在每个会话里加一个 **「无限探索」** 页签:把一轮
|
|
|
29
29
|
|
|
30
30
|
- **无限画布** —— 拖拽平移、滚轮缩放(20%–200%)、适应画布,右下角小地图可点击跳转并显示当前视口。在支持的 DSH 页面布局中,画布延伸到标题和输入框后方。
|
|
31
31
|
- **两个方向都支持** —— 工具栏上是双向的布局开关:**从上到下** 或 **从左到右**。两个选项同时可见,当前那个是按下态,所以不用靠画布形状去猜现在朝哪个方向。选择保存在当前浏览器中,对其他会话也生效。
|
|
32
|
+
- **卡片信息量可调** —— 工具栏「卡片信息量」三档:紧凑(288px)/ 标准(320px)/ 宽松(448px)。档位同时决定卡片宽度和预览的行数,整棵树按新宽度重排并记住你的选择;觉得卡片太小、看不到几句回答时,切到宽松。
|
|
32
33
|
- **跟随宿主外观** —— 界面跟随 DSH 的八种语言(中、英、德、西、法、日、葡、俄)和浅色 / 深色主题:层级阴影、浮层背景、滚动条和原生表单控件都随主题走。
|
|
33
34
|
- **任意回答开新枝** —— 卡片右上角的 `+` 就是追问入口,就地长出一张输入卡,回车发送后新节点立刻出现。
|
|
34
35
|
- **并行分支** —— 几条枝可以同时跑。正在回答的卡片带实时进度行:转圈指示器 +「正在思考… / 正在调用 read / 正在输出…」+ 第 N 步 + 已用秒数,正文按流式 token 边写边渲染,并带「停止」。
|
|
35
|
-
- **看得见在想什么** ——
|
|
36
|
+
- **看得见在想什么** —— 光有耗时看不出智能体在忙什么。正在跑的卡片底部有一条单行思考行,实时显示模型最新写下的一行;停下来之后同一行改成「思考过程 · N 字」。它是状态,不是按钮——卡片上唯一能放大的是「全屏阅读」,阅读层里用「最终结果 / 思考过程」在一张卡片里读两面。这一行永远只有一行,所以流式输出时卡片高度不跳。模型不思考就不显示。
|
|
36
37
|
- **等你回答** —— 分支停在提问或审批时,卡片改说「等你回答… / 等你授权…」并带一圈强调边框;画布自动展开到它并居中,工具条上的「N 个在等你」可点击跳转。正在跑的节点所在路径不会被默认折叠藏起来。
|
|
37
38
|
- **定位最新** —— 一键展开到最新节点的祖先路径并把那张卡片居中;最新按创建时间判定,并行完成顺序打乱也不会跳错。
|
|
38
39
|
- **折叠与搜索** —— 第三层起默认折叠,但通往「正在跑 / 在等你」节点的路径始终展开;`Ctrl/Cmd+F` 聚焦搜索框,回车逐个跳转命中节点并自动展开祖先路径。
|
|
39
|
-
-
|
|
40
|
-
-
|
|
40
|
+
- **提示里的附图会留在卡片上** —— 附在提示里的图片在卡片上是高 48px 的缩略图,在阅读层里铺在正文顶部、按图片自身比例缩放(最高 60vh),截图也读得清;缩略图按图片自身尺寸预留占位框,图片到达前后卡片不会跳一下。只带图片、没有文字的提示同样有卡片:图就是问题,不再印「(无问题)」。
|
|
41
|
+
- **卡片只做预览,全文进阅读层** —— 卡片上的回答按档位截到固定行数并淡出,不再有「展开回答」——在卡片里展开会把卡片拉成很长的竖条。回答、进度行和思考行装在同一个内容窗里:跑的时候窗口有固定高度,落定后收成内容高度,所以几条枝同时流式时画布不抖。点底部的「全屏阅读」按钮打开阅读层(卡片上唯一的放大入口):Esc / 点背景 / × 关闭,阅读层里能在「标准宽 / 较宽」之间切换,长回答不必挤在窄栏里。
|
|
42
|
+
- **分支记录不占工作区** —— 每根新枝都是一个真实会话,所以 DSH 默认会在工作区里为它列一行。工具栏的「分支记录:在工作区 / 已归档」一键切换(默认在工作区,点一下即收起本树已完成的记录,之后新完成的枝也自动归档):切到已归档会把本树已完成的分支会话收进 DSH 归档(画布照常读取,工作区只留主会话),切回来再逐条恢复;归档只针对已完成的分支,正在跑或等你的分支始终留在外面。
|
|
43
|
+
- **删除与恢复** —— 删除只写墓碑并归档对应的 fork 会话,工具栏可一键恢复;会话日志本身从不改写。被「分支记录」收进归档的分支不归恢复管——恢复墓碑只还原画布上的节点,要让它回到工作区列表,把「分支记录」切回在工作区即可。
|
|
41
44
|
|
|
42
45
|
## 环境要求
|
|
43
46
|
|
|
@@ -100,12 +103,18 @@ test/motion.cjs 动效:镜头插值、手势中断、导航
|
|
|
100
103
|
test/wheel-scroll.cjs 滚轮归属:内层能滚就滚,滚到头也不缩放画布
|
|
101
104
|
test/live-clock.cjs 运行中的卡片按墙钟计时,且全插件只有一个定时器
|
|
102
105
|
test/reader-dialog.cjs 阅读层是原生 modal:不再手写焦点陷阱,背景滚动被隔离
|
|
106
|
+
test/card-display.cjs 卡片信息量三档、卡片不再就地展开、阅读层宽度与几何
|
|
107
|
+
test/branch-sessions.cjs 分支会话归档策略:只收已完成的分支、可整体切换、fork 前临时解档
|
|
108
|
+
test/branch-archive-flow.cjs 归档流程端到端:回合结束后才归档、双向切换、墓碑不误放
|
|
109
|
+
|
|
103
110
|
test/markdown-table.cjs GFM 表格:对齐、转义竖线、横向滚动容器
|
|
104
111
|
test/markdown.cjs 受支持的 Markdown 全集,以及刻意不支持的那些
|
|
105
112
|
test/layout-direction.cjs 双向布局、不等高节点与折叠分支
|
|
106
113
|
test/host-overlay.cjs 宿主覆盖层、区域测量、阅读层与回退
|
|
107
114
|
test/locale-parity.cjs 八套语言表:键集合一致、{占位符} 对齐、不串字符集
|
|
108
|
-
test/reasoning.cjs
|
|
115
|
+
test/reasoning.cjs 思考过程:实时尾巴、阅读层两面、无思考不显示、重试清空、封顶与真实截断计数
|
|
116
|
+
test/card-reading.cjs 卡片高度不随流式变化、唯一放大入口、阅读层的两面
|
|
117
|
+
test/card-attachments.cjs 提示里的附图:引用投影并落盘、卡片缩略图、纯图片提示也有卡
|
|
109
118
|
test/reasoning-persist.cjs 思考不落盘、重开从日志里回来、父子连线不丢
|
|
110
119
|
test/real-log.cjs 真实日志端到端检查(可选,吃一个 session.v4.jsonl.zstd)
|
|
111
120
|
docs/design.md 设计文档:数据模型、取舍、已知缺口
|
|
@@ -122,6 +131,7 @@ docs/releasing.md CI、Release Please 与 npm 发布
|
|
|
122
131
|
- **节点是日志的投影**:读取会话的 `entries`(持久事件 + 暂态 `assistant/live-chunk`),把一个 turn 投影成一张卡片;不额外写记录,所以在 Chat 里继续聊,树上就会自然长节点。
|
|
123
132
|
- **等待态没有专门事件**:宿主里 `ask_user_question` 与审批都只是「工具还没返回」——等回答期间不发 `turn/end`,`running` 也保持 `true`。插件用 `tool/call` 的 `ask_user_question`(`callId` 在 `tool/result` 里结清)和 `approval/asked → approval/decided` 算出「在等你」,把卡片从「正在调用工具」改成「等你回答 / 等你授权」。`user/message` 的 `source.kind` 只有 `user` 与 `user-question-reply` 两种,投影两端都认。
|
|
124
133
|
- **思考过程已经在事件窗口里**:模型把思考写进 `reasoning` 内容块——实时是暂态 `assistant/live-chunk` 上的 `reasoning-delta`,落定后是持久 `assistant/message` 里的 `{ type: 'reasoning', text }`。两者都原样到达插件,所以一次投影同时覆盖「正在想」和「想完了」:在跑时卡片显示最新一行做「思考尾巴」,落定后收进可展开的「思考过程」(折叠时仍写出最后一段,并在被截断时说明)。没有思考的模型不渲染这一节。重试会复用同一个 turn/step,所以先把上一次尝试的思考清掉。每张卡最多保留 12000 字,丢了字数按「每个块送达过的字节 − 保留长度」算出来,而不是累加计数器——同一个块会被裁不止一次。思考**不写进 `localStorage` 快照**:它能从日志重建,而快照里还放着重建不出来的父子连线。
|
|
134
|
+
- **附图是内容块,不是文字**:`user/message` 的 `content` 是一个块数组,文字只是其中一种,附图是另一种——`{ type: 'image', attachment: { attachmentId, mediaType, width, height, bytes, name } }` 与文字并排,所以 `textOf` 永远看不到它。投影按内容顺序保留这些引用,只带图片的提示也算一个真问题,并且引用跟着节点一起落盘:一条引用几百字节,图片本身留在宿主那边。渲染时按节点所属会话向宿主的受权读取器要 URL——先 `peekImageUrl`(重开的卡片因此不会先闪一下空白),没缓存再 `imageUrl`。这个服务是防御式读取的,也没有进插件的 `inject` 列表:宿主没有它时视图照常加载,只是没有缩略图。
|
|
125
135
|
- **正在跑的路径不折叠**:布局只走「未折叠」的节点,被折叠的节点连位置都没有、根本不会被画。所以通往「正在跑 / 在等你」节点的祖先路径一律不套用默认折叠;节点进入运行态时还会把路径展开并持久化,停在等用户时再把画布移过去。工具条上的运行计数与「在等你」计数都是跳转按钮。
|
|
126
136
|
- **会话会被重新绑定**:离开对话后宿主会释放它的引用,引用归零时 scope 被回收、`Session` 实例连同事件窗口一起丢掉;再进来时 `materializeScope` 会造一个新的 `eventSource`,窗口从空开始。所以订阅跟着 `eventSource` 换(旧的自动退订)、空窗口不当作「会话是空的」去剪枝、冷会话主动 `open()` 一次——否则直接在「无限探索」页签上切回来会得到一张空画布,而先点「回对话」再切回来又正常。`test/session-rebind.cjs` 守住这条。
|
|
127
137
|
- **分叉是真实会话**:`ctx.sessions.fork({ sessionId, atSeq })`,子会话天然继承到该回答为止的前缀上下文;每根枝会出现在会话列表里,插件会把它改名成 `⟂ 父问题 · 新问题` 便于辨认。
|
|
@@ -131,7 +141,7 @@ docs/releasing.md CI、Release Please 与 npm 发布
|
|
|
131
141
|
## 开发
|
|
132
142
|
|
|
133
143
|
```bash
|
|
134
|
-
npm test #
|
|
144
|
+
npm test # 下面每一条一起跑(package.json 里的 scripts.test)
|
|
135
145
|
|
|
136
146
|
node --check client.js # 语法
|
|
137
147
|
node test/render-smoke.cjs # 渲染冒烟:把整个视图真渲染一遍,并断言中英两套文案
|
|
@@ -142,12 +152,17 @@ node test/motion.cjs # 动效:画布移动、手势中断、导航替
|
|
|
142
152
|
node test/wheel-scroll.cjs # 滚轮归属:思考框能滚就滚,滚到头也不缩放画布
|
|
143
153
|
node test/live-clock.cjs # 耗时按墙钟每秒走,事件之间也不停;只有一个定时器
|
|
144
154
|
node test/reader-dialog.cjs # 阅读层用原生 <dialog>:showModal、close 回灌、背景滚动隔离
|
|
155
|
+
node test/card-display.cjs # 卡片信息量三档、无就地展开、阅读层标准宽/较宽与重排几何
|
|
156
|
+
node test/card-reading.cjs # 卡片高度不随流式变化、唯一放大入口、阅读层的两面
|
|
157
|
+
node test/card-attachments.cjs # 附图:引用进投影并落盘、卡片缩略图、纯图片提示也有卡片
|
|
158
|
+
node test/branch-sessions.cjs # 分支会话:只归档已完成的分支、可整体切换、fork 前临时解档
|
|
159
|
+
node test/branch-archive-flow.cjs # 归档流程端到端:回合结束才归档、双向切换、墓碑不误放
|
|
145
160
|
node test/markdown-table.cjs # 回答里的 GFM 表格
|
|
146
161
|
node test/markdown.cjs # 渲染器支持的每一种 Markdown 语法
|
|
147
162
|
node test/layout-direction.cjs # 双向布局、不等高节点和折叠分支
|
|
148
163
|
node test/host-overlay.cjs # 宿主覆盖层、区域测量、阅读层与回退
|
|
149
164
|
node test/locale-parity.cjs # 八套语言表的键、占位符与字符集
|
|
150
|
-
node test/reasoning.cjs #
|
|
165
|
+
node test/reasoning.cjs # 思考过程:实时思考行、阅读层两面、无思考不显示、重试清空、封顶与真实截断计数
|
|
151
166
|
node test/reasoning-persist.cjs # 快照策略:思考不落盘,重开从日志里回来,父子连线不丢
|
|
152
167
|
```
|
|
153
168
|
|