Menghuan1918
d035836a51
feat(tasks): 自动适配改为滑行——展开后仍保持自适应居中,且不再瞬跳
...
维护者第三轮反馈:在 fit(自适应)档位下展开后,画面也应回到自适应位置,
避免节点溢出面板 / 不在中间。上一版让折叠「接管视图」正是拿这个换的平滑。
收口方式:把视图变换本身也做成补间。
- 新增 tasks-view-glide.ts:把 fit 的算术抽成纯函数 fitTransform(用 CONTENT 盒而
非含 padding 的整张画布定缩放、双轴居中、容器未测量时返回 undefined),外加
lerpTransform 与 GLIDE_MS。这两块在 jsdom 里可达,因此有了单测(居中、上下限、
未测量、滑行中点)。
- TasksGraph:fit 拆成 fitTarget(算术)+ applyFit(animate)。布局变化且视图仍属自动
适配时→**滑行**(rAF 220ms,与卡片补间同一条缓动);切会话→直接落位(内容整体
换掉);⌂ / 背景双击→滑回。任何读者手势(pointerdown / 滚轮 / 缩放按钮)立刻取消
滑行,并照旧把视图标记为「已接管」。
- 折叠不再接管视图(去掉上一版的 markTouched 包装):展开即滑到新取景,画面保持
居中且内容完整。
测试:tests/tasks-view-glide.spec.ts(4 条:居中与缩放上限/下限、未测量返回 undefined、
滑行插值)与 tests/tasks-motion.spec.ts 第 4 条改写(布局变化必须滑行、切会话必须落位、
手势必须能取消)。全套 2252 passed / 17 skipped(194 文件)、tsc 与 eslint 零告警、
构建通过;新构建已装进 sidebar-test,:3080 挂载正常(0 pageerror)。
2026-10-11 23:35:52 +08:00
Menghuan1918
e6f9eda60f
feat(tasks): 画布动效改为布局坐标补间 + 错峰入场,FLIP 库只留流式布局
...
维护者第二轮反馈「还是突然直接出现」。上一版把 FLIP 库从画布摘掉后只留了
150ms 淡入 —— 太弱,看不出是「入场」。而且这个面本身需要的是**位置**动效,
不是入场动效,于是补上画布自己的补间:
- tasks-layout-tween.ts:rAF 逐帧插值每张卡在**画布坐标**里的 x / y / 高度。
为什么必须是坐标而不是 transform:卡片层带 fit 的 scale(k),left/top 是画布
单位,缩放对它和对终点位置一样生效;量 rect 再播未缩放 translate 的 FLIP 在
这里恒差 k 倍,auto-animate 还会把离场卡片钉上无法表达的绝对 left/top。
fromRef 跟着「已绘制」状态走 —— 中途再次变布局时接着当前位置走,不弹回。
- 连线路径与相位框改为读补间后的盒子(它们本就是盒子的纯函数),于是线跟着
卡片走,不再在卡片还在飞的时候先瞬移到终点。
- 入场改为 300ms 上浮 + 0.88→1 缩放 + 淡入(轻微过冲),按节点页序错峰 26ms,
fill-mode: backwards 让等待中的卡片先隐形;reduced-motion 下补间与入场都关。
修掉首版的一帧空档:新入场的节点在引入它的那一帧就带目标盒子渲染。
- 读者一碰折叠即接管视图(聚合卡 / 卡片 chevron / 控制条开关 → markTouched),
此后画布不再随布局自动重框;切会话重置并重新适配(顺带修掉换会话不适配的旧账)。
- FLIP 库保留在树视图与任务抽屉(那里离场是原地淡出 + 兄弟滑位的流式语义)。
守护:tests/tasks-layout-tween.spec.tsx(插值 / 缓动 / 中途位置 / 画布尺寸不中途
变化 / 入口盒子不缺席)与 tests/tasks-motion.spec.ts 扩到 5 条(画布不得 import
FLIP 库、必须在画布坐标补间、入场必须错峰、折叠必须接管视图)。
全套 2248 passed / 17 skipped(193 文件)、tsc 与 eslint 0 错误、构建通过;
新构建已装进 sidebar-test,:3080 挂载正常(0 pageerror)。
2026-10-11 23:29:51 +08:00
Menghuan1918
34671dcb34
fix(tasks): 画布不再跑 FLIP 库(真机「折叠展开动效特别怪」的根因)
...
维护者反馈折叠/展开展开的动效特别怪,比预期严重。读 @formkit/auto-animate
源码后确认两处几何错误在缩放层里都不可修:
- remove(el) 把离场元素重新插入 DOM 并钉上由 getBoundingClientRect 换算的
绝对 left/top/width/height —— 卡片层带 fit 的 transform: scale(k),这个钉位
在缩放层里根本无法表达,离场卡片直接跳位;
- 移动项用 el.animate 播未缩放的 translate,而量测是缩放过的,行程差 k 倍。
再叠加连线(SVG path)与相位框本来就不同步,观感必然崩。
处置:画布改为 .node 上的纯 CSS 入场(150ms、mount-only、离场即时,与不动的
连线一致),auto-animate 只保留在流式布局的树视图与任务抽屉 —— 那两处的 FLIP
语义正确(离场原地淡出、兄弟滑位)。新增 tests/tasks-motion.spec.ts 钉死边界:
画布不得 import use-auto-animate,树与抽屉必须有;同时守护 .node 的入场关键帧
与 reduced-motion 关闭。
全套 2241 passed / 17 skipped(192 文件)、tsc 与 eslint 0 错误、构建通过、新
构建已装进 sidebar-test 并在 :3080 挂载正常(0 pageerror)。
2026-10-11 23:20:03 +08:00
Menghuan1918
9ccc147e00
feat(tasks): 第二轮真机反馈——聚合条动作行、模式 chip、弹窗用量/耗时、原生侧栏转录、动效
...
用户在自己跑的 3080 实例上测完报回六条,逐条修:
1. 「已完成的聚合卡下方空荡荡」= 上一轮把计数收进徽标后那条只剩一个
chevron(我的取舍造成)。小条改为动作行:组图标 + 「展开」(新词条
tasksFoldExpandShort × 20 词典)+ 出错尾注 + 展开箭头。
2. 「展开后的子代理点不回去」= 真缺陷:expandedGroups 压过了 foldedIds,
展开组内卡片的 chevron 失效。改成手动折叠优先(手动 → 页级规则 →
组展开),补模型 + 组件两层判别性用例。
3. 「一次性一直显示」→ 模式词搬进徽标行成 chip(用户口径)。智能体卡不再
有 mono 元信息行,卡片高度预算拆成 GRAPH_AGENT_NODE_H / GRAPH_NODE_H
(只有 workflow run 卡保留元信息行),rowStrideFor(nodes) 按模型里有没有
run 选行距。
4. 动效:接入 @formkit/auto-animate(用户选定,~3KB、无依赖无安装脚本)+
useAutoAnimateRef 包装(WAAPI 守卫 → jsdom 空转、尊重 reduced-motion),
挂到画布卡片层 / 树视图 / 任务抽屉;详情卡另加 140ms 入场关键帧。核心
bundle +56KB(未压缩 CJS)。
5. 弹窗多两项:Token 用量(宿主 tokenUsage 四桶求和,悬停给明细)+ 耗时
(宿主 subagentTiming,按 3s 轮询刷新)。SidebarProjectionSnapshot 镜像
补两个键、模型新增 metrics 入参;**按存在性渲染**,没有测量就不显示这一
行(0 是投影初始态,与「没工作过」不可区分)。
6. 「查看转录」改为在原生右侧栏打开:宿主 ui-subagent 的 subagentchat tab
类型(宿主自己的子代理列表就是点行=主窗、点 chevron=侧栏)。插件照抄其
地址公式并调 openResource(..., { kind, preferNewPane: true }),三级降级回
主窗;页脚变「主按钮 + caret 菜单(在主窗口中打开)」。
测试 2238 passed / 17 skipped(191 文件)、tsc 0 错误、eslint 0 错误、构建
通过;新构建已装进 sidebar-test profile,:3080 上挂载正常、0 pageerror。
动效观感与真实数据的两行数值未在真机逐帧核验(右栏在无头上下文里被
transform 移出视口,合成点击不稳)——已如实记进设计文档的第二轮偏差段。
2026-10-11 23:15:40 +08:00
Menghuan1918
ba9dc57f56
docs(tasks): README 的卡片与折叠两条按当前行为改写(维护者确认)
...
用户确认「现在就改写」那四条(README.md 的 v0.22.0 节 + README_EN 对应两条):
- 双段式节点卡:小条是状态点 + 原生状态文本,运行中/已结算都由活动行取代
状态词(不再念两遍),空闲与出错保留状态词、无数据时回退状态词。
- 折叠:徽标写真实计数、小条只留出错尾注与展开箭头;点聚合只展开该组,
页级展开/折叠仍在右下控制条且收起时会清掉按组展开。
设计文档的偏差条目随之改写为完整过程(先报偏差 → 维护者选择改写),
并补上「自查抓到判据反了 + 判别性用例」的记录。
2026-10-11 22:13:14 +08:00
Menghuan1918
79ee383c5e
feat(tasks): 小条只说原生状态、聚合按组展开、浮窗活动行移到标题下
...
用户 brief:下方条不再显示「运行中」而是原生状态;「最近活动」以小字号写到
标题下方;展开不要点一个全开;顺带修其他的。
四条用户确认的口径:
- 小条(图模式 CardBar):运行中/已结算都由**活动行取代状态词**,措辞取宿主
`chat` 命名空间(正在分析请求 / 正在读取文件 · main.ts / 正在准备读取文件 /
正在运行命令 · npm run build),与主对话逐字一致。**`空闲` 与 `出错` 保留
状态词**(不被任何活动措辞蕴含),**没有活动数据时回退状态词**,小条不空。
状态点、执行扫光、折叠 chevron、22px 高度全不变 → 画布几何零改动。
- 根节点接上 live:live 路由一直把拓扑根的 fold 放进 `live[rootSessionId]`,而
模型从未挂到根节点上——主代理卡片的状态文本因此恒为 thinking 兜底(这就是
「大部分时间一直显示正在分析请求」的真因),树模式根行也恒为「思考中…」。
- 节点详情:删掉「最近活动 | 值」那一行(键值格的值列在 280px 被省略、标签又
占三分之一宽),改为标题下的 10px 活动行 + 夹两行的实时文本;**无数据不渲染
这一块**(此前每个浮窗都显示「最近活动:正在分析请求」,已结算节点也一样)。
新增共享规则 `activityLine(node)`:running → 宿主 live 措辞,其余 → 宿主
done.* 措辞,无 summary → undefined(调用方回退状态词,不谎报)。删 `tasksNodeActivity`(20 份词典)。
- 按组展开:模型新增 `expandedGroups`(键 = 新增的导出 `foldGroupId`,哈希
`fold:<parentId>[:idle]`),只覆盖「本来就要折」的分支——点聚合只开该组,兄弟组/
页级规则/手工折叠都不动。页面侧 `expandGroup` 同时把该组成员从 `foldedIds` 摘掉,
**控制条收起时清空按组展开**(判据写在收起分支,自查时抓到一次反了并补了判别性
用例:翻回去即红)。树里的聚合行同一语义,行内副文案固定为「展开」。
- 聚合卡计数只说一次:待命组徽标此前印**字面量字母 N**(`tasksFoldIdleGroup` 在 20 份
词典里都没有 `{count}` 插值),现在插值真实计数;小条只留 `出错 N` 尾注 + 展开箭头,
完整 tally 仍是 `aria-label` 与 tooltip(屏幕阅读器看不到徽标)。
- 树模式实时行图标按活动类别取:`tool-icons.tsx`(工具名映射,只有一处写死 bash 的
调用)换成 `activity-icons.tsx` 的 `activityGlyph(kind)`,`Record<ProcessActivity, …>`
让上游新增类别编译失败而不是静默兜底。
测试 2227 passed / 17 skipped(190 文件)、tsc 0 错误、eslint 0 错误、构建通过。
tasks-page 新增 FakeChatLocale(挂宿主 chat 命名空间,否则只能断言到 fallback 的
detail,钉不住契约)。设计文档 docs/plans/2026-10-11-tasks-status-and-group-fold.md,
其中记录了「README 的 v0.22.0 发布说明不改」的偏差理由(git log -L 显示那四条自发布
提交后再未被碰过,进行中通道是 CHANGELOG 的 Unreleased)。
2026-10-11 22:04:28 +08:00
Atlas Zeng
64a61ccfe4
Merge pull request #904 from omdsh-dev/dev
...
v0.25.0:适配 DSH 0.2.0-rc.2(npm latest)+ 本批全部修复与功能。CI 三条 lane 全绿。
2026-10-10 01:34:46 +08:00
Menghuan1918
1184d063c9
fix(release): 版本号同步到 dsh.plugin.json 与 SIDEBAR_SERVICE_VERSION
...
v0.25.0 的 bump 漏了两处与 package.json 必须同步的声明,CI 上
`manifest-consistency.spec.ts`(registry 清单的 version 对齐)与
`service.spec.ts`(服务上报的 version 对齐)因此变红:
- `dsh.plugin.json` 的 `version`:0.24.1 → 0.25.0(registry 通道形状,由
`manifest-consistency.spec.ts` 守护)
- `src/client/service.ts` 的 `SIDEBAR_SERVICE_VERSION`:0.24.1 → 0.25.0
(消费插件用它与 `features` 做能力探测,由 `service.spec.ts` 守护)
两条守护就是为这次漏项准备的:它们在**本地**全量里也该红,是我上一批只跑了
typecheck/lint + 全量却把这两条读成了「通过」——实际是那次全量跑在 bump 之前。
现补:受影响四条 spec 82/82 绿。
2026-10-10 01:25:22 +08:00
Menghuan1918
e7b911593e
merge chore/release-0.25.0 into dev(v0.25.0:支持线前移到 DSH 0.2.0-rc.2,peer/CI/挂载 lane/31 个 devDeps 与 lockfile 同批抬版,AGENTS/README/指南的活跃提法同步;CHANGELOG 落版并逐位致谢本版贡献者)
2026-10-10 01:16:38 +08:00
Menghuan1918
a0cfd30b48
chore(release): v0.25.0 —— 支持线前移到 DSH 0.2.0-rc.2(npm latest)
...
- 版本 0.24.1 → 0.25.0;CHANGELOG 的 Unreleased 段落成 v0.25.0。
- **支持线**:peer 下限 `^0.2.0-rc.1` → `^0.2.0-rc.2`,CI 与挂载 lane 的钉版同步 →
`@deepseek-ai/dsh@0.2.0-rc.2`(`latest` 现在正是这一版),31 个 `@deepseek-ai/*`
devDependencies 与 lockfile 同批抬到 rc.2,`dsh.plugin.json` 的 engines 同步。
- **0.2.0-rc.1 及更早(含 0.1.7 线)请固定 v0.24.1**:caret 范围跨不过预发布元组,
`^0.2.0-rc.2` 对 rc.1 判定为 false,会被宿主启动预检整行静默禁用。
- 文档同步:AGENTS §2/§3.0、README / README_EN 的徽章与支持线、接入指南的活跃提法
(历史发布记录与 docs/plans 里的 rc.1 保留原样,那是记录不是声明)。
- 本版内容与贡献者致谢见 CHANGELOG 的 v0.25.0 段。
门禁:rc.2 上 typecheck / lint 干净,全量 189 文件 2213 通过(唯一红是
`fs-watch.spec.ts` 真起 fs.watch 的并行负载 flake,单跑 6/6 绿,与本版无关)。
2026-10-10 01:16:38 +08:00
Menghuan1918
b1d3e9d105
merge feat/dock-hide-on-right-panel into dev(右侧面板展开时不显示底部入口:头部入口与备用入口都退场,收起后回来——这条规则把「展开态该把入口摆哪儿」整个去掉,让位只需服务收起态;判据按可见性而非属性存在,含判别性用例,e2e 真机通过)
2026-10-10 00:40:02 +08:00
Menghuan1918
20307d5f6a
feat(dock): 右侧面板展开时不显示底部入口(按用户口径重做)
...
上一版把「没展开」理解成了**底栏**(在 `BottomDockToggle` 里判 `bottomOpen`),
方向反了;先 `8e3447b` 整个 revert,再按真实口径重做:**宿主右侧面板展开时不显示
这个按钮**。
- 新增 `src/client/sidebar/right-panel-open.ts` 的 `useRightPanelOpen()`:
首帧同步读取 + 每 500ms 复核。
- `BottomDockToggle`(会话头入口)与 `DockFallback`(空白会话备用入口)都在展开态
返回 null —— 备用入口连 portal 空壳一起省掉。
**判据必须是「可见」,不能是「在不在 DOM 里」**:实测宿主把两个角落控件都留在文档里
(落屏时 `[data-sidebar-right-expand]` 与 `[data-sidebar-right-toggle]` 各 1 个,而面板
明明已经展开),只有可见性区分得开 —— 展开时可见的是 Collapse、收起时可见的是 Open。
早先按属性存在与否判定会一直读成「没展开」,按钮照旧出现在宿主编簇旁边(真机实测到)。
判据的方向也刻意取安全侧:宿主哪天换命名 → 读成 false(不隐藏),按钮照旧可用、
位置由让位逻辑兜住,而不是把按钮永久藏掉。
测试:`tests/dock-fallback.spec.tsx` 新增「右侧栏展开时一个入口都没有」(造一个**可见**的
Collapse 控件;**还原门即红** `右侧栏展开时不该有备用入口: expected <span…> to be null`),
并把两条定位用例改回「收起形态」的锚点 —— 展开态已经不渲染,那两条原先为之写的
「打开形态锚点」用例随之删除(规则把那个状态整个去掉了)。既有 8 条全绿。
`tests/e2e/blank-session-dock-entry.e2e.ts` 在真机跑过:1 passed。
2026-10-10 00:40:02 +08:00
Menghuan1918
8e3447b27a
revert: 回退「只在未展开时显示底部入口」——把「没展开」理解成了底栏,实际是指右侧面板
2026-10-10 00:35:46 +08:00
Menghuan1918
f7a70d1aae
merge fix/dock-expand-only into dev(底部入口只在未展开时出现:展开态由面板自己的 × 收起,头部入口退场——顺带把「展开态该把入口摆哪儿」这个与宿主 chrome 争位置的状态整个去掉;单测 + e2e 均按新语义改写并在真机跑过)
2026-10-10 00:33:32 +08:00
Menghuan1918
31b11ef3b8
feat(dock): 底部入口只在未展开时出现(展开态交给面板自己的 ×)
...
产品决定(用户提的):底栏展开后不再显示头部入口 —— 收起由面板页签条右端那个 ×
负责,头部再来一个「收起」既冗余,又多一个「展开态该把入口摆哪儿」的状态。
- `BottomDockToggle`:`bottomOpen === true` 时返回 null(不再切 aria-label /
aria-pressed,那个「收起」形态整个去掉)。
- `DockFallback`:同样在展开态不渲染(连空壳也省掉)。
顺带的效果:备用入口与宿主 chrome 争位置这件事,只在**未展开**这一个状态下需要处理。
测试:
- `tests/dock-fallback.spec.tsx` 新增「展开态一个入口都没有」用例(9 条全绿)。
- `tests/e2e/blank-session-dock-entry.e2e.ts` 按新语义改写 —— 原先断言展开后
`data-active='true'`,现在断言**入口退场、屏上 0 个**,并补上「用面板自己的 ×
收起后,会话头入口回来且仍只有一套」。**真机跑过:1 passed**。
全量 189 文件 / 2215 通过,typecheck / lint 干净。
2026-10-10 00:33:32 +08:00
Menghuan1918
f42c6c5c1a
chore: 移除误提交的探针截图
2026-10-09 23:10:23 +08:00
Menghuan1918
a9a27da868
merge fix/dock-toggle-hittest into dev(占位判定改用 elementsFromPoint 命中测试 + 5 点水平采样:页签芯片不是 button/[role=button],按角色筛会让让位停在芯片上(tab 多时位置就错);不透明小控件算占位、整行背景板不算,步长收到 4px;真机复测入口落在宿主编簇左侧、零相交,含判别性用例)
2026-10-09 23:09:53 +08:00
Menghuan1918
570bebc85e
fix(dock): 占位判定改用命中测试 + 多点采样(修「tab 多的时候位置也错误」)
...
两个真问题:
1. **页签芯片筛不出来**。原先把「占位」定义成 `button, [role="button"]` 的 rect
相交,而右侧栏的页签芯片不是这两者 —— 页签一多,让位会**停在芯片上**。
改用 `document.elementsFromPoint`:直接问页面「这一格下面有什么」,
与宿主用什么标签、什么类名无关。判定为占位的是**不透明的小控件**
(≤300px 宽:页签芯片、图标胶囊);整行的不透明背景板(会话头 titleRow、
面板 tabStrip、面板本体)不算 —— 把它们算进去会让入口一路退到屏幕中间
(实测退到 x=530)。
2. **只测中心点不够**。槽位宽 28px,中心空着不代表右缘不压着邻居:
实测中心判空、box 却与 Split/Fullscreen 相交。现在沿水平方向采 **5 个点**
(2 / 8 / 14 / 20 / 26),整格全空才算空;让位步长同时收到 4px。
真机复测(2200px 视口、右侧栏打开、开过页签):
入口落在 `2066`,宿主整簇从 `Split@2094` 起 —— **rect 相交为零**。
判别性:`tests/dock-fallback.spec.tsx` 的芯片用例把命中测试桩成「x > 430 被页签盖住」,
断言入口退到 `404px`;**关掉命中测试即红**
(`expected '464px' to be '404px'`,464 正是压在页签上的位置)。全 8 条绿,
全量 189 文件 / 2214 通过,typecheck / lint 干净。
2026-10-09 23:09:53 +08:00
Menghuan1918
c6ce873608
merge fix/dock-toggle-clearance into dev(备用入口让位改为逐个槽位左移直到与任何宿主按钮都不相交:宿主角落控件是肩并肩一簇,只挪固定 36px 会精确压住下一个按钮(实测压住 Fullscreen 28x28px);真机复测两种右侧栏状态都零重叠,含判别性用例)
2026-10-09 21:36:31 +08:00
Menghuan1918
225d814ce5
fix(dock): 备用入口让位要逐个槽位试探,不能只挪一个固定偏移
...
`fix/dock-toggle-anchor` 让锚点认出了宿主角落控件的**打开形态**
(`data-sidebar-right-toggle`),但当右侧栏打开时那个座位旁边还有同伴:宿主的角落控件
是肩并肩一簇。真机实测(2200px 视口):
打开态:Split@2094 Fullscreen@2130 Collapse@2166 (各 28px,间隔 8px)
`measure()` 只往锚点左侧挪 `GAP + BUTTON_SIZE = 36px`,于是从 Collapse(2166) 让到
2130 —— **精确压住 Fullscreen**(28x28px 全重叠)。
改为:先按锚点算槽位,然后**逐个槽位左移,直到该槽位与任何宿主按钮都不相交**
(竖直方向真的相交才算占位,最多退 8 格;极窄窗口下停在最左,宁可贴边也不叠)。
真机复测(同一探针、同一视口):
关闭态:入口 2124..2152,宿主 Open right sidebar@2160 → 零重叠
打开态:入口 2058..2086,宿主整簇 Split@2094/Fs@2130/Col@2166 → 零重叠
判别性:`tests/dock-fallback.spec.tsx` 再加一条 —— 锚点在 500、紧邻左侧 464..492
站着 Fullscreen,断言入口落在 `428px`;**关掉步进即红**
(`expected '464px' to be '428px'`,即停在 Fullscreen 上)。既有 6 条保持绿;
全量 189 文件 / 2213 通过;typecheck / lint 干净。
2026-10-09 21:36:31 +08:00
Menghuan1918
01c98b1c29
merge fix/dock-toggle-anchor into dev(备用入口锚点要认宿主角落控件的两种形态:右侧栏打开时 data-sidebar-right-expand 整个消失、同一座位换成 data-sidebar-right-toggle,只认前者就会落到视口兜底坐标 innerWidth-44——那里正是宿主自己的角落按钮群,实测重叠 18px;含判别性用例)
2026-10-09 21:33:39 +08:00
Menghuan1918
0dcdb414b9
fix(dock): 备用入口的锚点要认宿主角落控件的两种形态(修压在「收起右侧栏」上)
...
现象:右侧栏打开时,右上角出现**两个图标叠在一起**——插件的「展开底部面板」压在
宿主的「收起右侧栏」上(用户截图)。
根因:备用入口按宿主角落控件的 rect 左移 `GAP + BUTTON_SIZE = 36px` 定位,但锚点只查
`[data-sidebar-right-expand]`。实测宿主那个座位有两种形态:
- 右侧栏**关闭**:`data-sidebar-right-expand`(aria-label「Open right sidebar」);
- 右侧栏**打开**:该属性**整个消失**,同一座位换成 `data-sidebar-right-toggle`
(aria-label「Collapse right sidebar」)。
于是右侧栏一打开,`measure()` 找不到锚点、落到视口兜底坐标 `innerWidth - 44` ——
而那里正是宿主自己的角落按钮群(Split / Fullscreen / Collapse)。2200px 视口实测:
入口 = `2156..2184`,宿主 Collapse = `2166..2194` → **重叠 18x26px**,并切到 Fullscreen
2px。与用户截图逐字一致。
修法:锚点选择器同时认两种形态
(`'[data-sidebar-right-expand], [data-sidebar-right-toggle]'`)。
判别性:`tests/dock-fallback.spec.tsx` 新增一条 —— 只挂 `data-sidebar-right-toggle`
的宿主按钮 + 桩掉它的 rect,断言备用入口的 `left` 是 `464px`(= 500-8-28);
**还原锚点即红**:`expected '980px' to be '464px'`(980 = jsdom `innerWidth 1024 - 44`
的兜底值)。全量 189 文件 / 2212 通过;typecheck / lint 干净。
2026-10-09 21:33:39 +08:00
Menghuan1918
36f944be55
merge fix/dock-toggle-duplicate into dev(修「展开底部面板」按钮叠成两个:两套入口的互斥原先只靠 1s 轮询的 session.phase,而会话头入口由宿主自行决定渲染时机、相位失读还会按非 blank 降级——而备用入口与会话头入口在版面上就是同一位置,同时在场即精确重叠;现加一条与相位无关的兜底:会话头那套入口只要真在 DOM 里,备用入口就让位,含判别性用例)
2026-10-09 10:29:10 +08:00
Menghuan1918
85736b5294
fix(dock): 会话头入口在场时,空白会话的底部入口让位(修「展开底栏」叠成两个)
...
现象:右上角出现**两个**「展开底部面板」按钮,精确重叠成一团(用户截图)。
根因:两套入口的互斥只靠 `session.phase`,而相位是**每 1s 轮询**来的、会话头入口
由宿主自行决定何时渲染 —— 两者之间必然有窗口;更糟的是相位路由失读时按「非 blank」
降级,一个从未成功读到的会话可能长期停在 blank。而两套入口在版面上**就是同一个
位置**(备用入口按宿主「Open right sidebar」的 rect 左移 8+28px),同时在场即重叠。
修法:在相位之外再加一条**与相位无关**的兜底 —— 只要 DOM 里存在一个不在
`[data-dsh-dock-fallback]` 内的 `[data-dsh-bottom-toggle]`(即会话头那套入口真的
渲染了),备用入口就让位。判定挂在既有的 500ms 位置对齐节拍上(resize 时也刷新),
因此最多 500ms 的让位延迟。
判别性:`tests/dock-fallback.spec.tsx` 新增「造出『相位说 blank + 会话头入口在场』
的不一致状态」用例 —— **还原守卫即红**(`会话头入口在场时备用入口必须让位:
expected <span…> to be null`);另 4 条既有用例(blank 渲染 / 非 blank 不渲染 /
相位未知不渲染 / 路由不支持降级)保持绿。typecheck / lint 干净。
2026-10-09 10:29:10 +08:00
Menghuan1918
d588cff0af
merge fix/editor-host-render-wait-2 into dev(慢 runner 假失败再收一刀:mount helper 只 drain 微任务,负载下 React 可能把树的那次 flush 整个推迟到微任务之后——上一版 5s 条件预算被整整耗光(5044ms 红,下一轮同样代码就绿);现在条件等待前先让出一个宏任务边界,预算抬到 10s,仍在套件 15s testTimeout 之下,真正列不出该行照样红在断言上)
2026-10-08 22:46:31 +08:00
Menghuan1918
e656d5ba11
test(editor-host): 条件等待前先给一个宏任务边界,预算抬到 10s
...
`05d259cc` 把 `waitForTreeRow` 换成显式条件预算后,CI 上仍然红了一次,而且这次
**整整耗光了 5s**(5044ms,`vi.waitFor.timeout tests/editor-host.spec.tsx:89`),
下一轮同样的代码又是绿的 —— 说明问题不只是「预算太小」,而是那一轮里树的那次
flush 根本没被排上。
mount helper(`mountHostWithTreeWithCwd` 等)只 drain 两个微任务,而负载下 React
把异步 `fs.trees` 应答引发的 `setState` + flush 整个推迟到微任务之后是完全可能的
(`630d10f` 的提交信息已经记下这个机制)。所以现在在条件等待之前先让出一个**宏任务
边界**,给那次被推迟的 flush 一个真正运行的机会,再把预算放在 10s(仍在套件
`testTimeout: 15s` 之下,真正列不出该行时照样红在断言上,而不是红在测试时钟上)。
纯测试改动;本机 `tests/editor-host.spec.tsx` 14/14 绿。
2026-10-08 22:46:27 +08:00
Menghuan1918
45285014d9
merge fix/826-file-link-line-jump into dev(#826 第二半:行号不再被解析完就扔掉。两种写法合流到同一个字段——#L131 由宿主解析成 navigation.params.line、path:131 由插件在 path-line.ts 切出,都落到 SidebarTab.line,再经 FileViewerProps.line 交给 viewer;TextEditor 到达时定位一次并高亮,越界钳到最后一行,区间只取起始行。line 是瞬态(sanitizePersistedTab 白名单不含它,刷新不把读者拽回旧行);markdown/html 收到行号先强制切到编辑态再定位,避开预览自己的挂载滚动恢复。公开面是纯增量:FileViewerProps.line?: number)
...
# Conflicts:
# docs/external-plugin-guide.md
2026-10-08 22:20:45 +08:00
Menghuan1918
331508e2a4
docs(changelog): 记录 #890(编辑器显现即重新测量)与 #859(桌面壳 HTTP 走页面基址)
2026-10-08 21:58:42 +08:00
Menghuan1918
698721eb34
merge fix/desktop-shell-http-base into dev(桌面壳的 HTTP 与 WebSocket 需要不同基址:壳把页面放在 dsh-app://app/、注入的 streamBaseUrl 指向另一个 origin,而壳的 protocol.handle 会把非静态 dsh-app 路径同源转发给宿主——插件的 JSON 路由不带 CORS 头,发到注入 origin 就是跨源、被浏览器直接拒(满屏 Failed to fetch);于是 HTTP 改骑页面基址 hostHttpBase()(document.baseURI,反代前缀也带在里面),WebSocket 继续用注入 origin。含 base-path 三种场景的用例)
2026-10-08 21:58:34 +08:00
Menghuan1918
d241faf8ea
merge fix/editor-reveal-remeasure into dev(#837 后续:宿主用 MOVED 的方式 park/还原 tab body,移动节点不改变 border box,所以只看 box 变化的 ResizeObserver 永远不触发——一个在隐藏宿主里被打开的编辑器会把视口量成 0 并一直留着空白的虚拟视口(行号槽还在画,正文空)。改为每次「显现」都重新测量:IntersectionObserver 报显现本身、rAF 兜住与挂载同帧的那次显现,另接 visibilitychange / window resize;全部可缺省且逐个 dispose)
2026-10-08 21:58:34 +08:00
Menghuan1918
a735567b55
merge fix/editor-host-render-wait into dev(修 editor-host 在慢 runner 上的渲染等待:vi.waitFor 的 1000ms 默认超时与套件的 testTimeout:15s 无关,负载 runner 上树的行还没渲染出来就先超时——dev 与 #890/#859/#893 三条 lane 同时红在同一个用例上;改为显式 5s 条件预算,仍是「等条件」而不是「等固定时长」)
2026-10-08 21:58:13 +08:00
Menghuan1918
5d259cca61
test(editor-host): 慢 runner 上给「等树渲染出行」一个 5s 条件预算
...
CI(ubuntu lane,2 核、与 184 个文件并行)稳定红在
`tests/editor-host.spec.tsx > EditorHost native-tab context-menu actions >
keeps the bottom-workbench split for a tab that lives there`,签名是
`AssertionError: expected false to be true`、落在 **spec:74**(`waitForTreeRow`
里的 `expect(found).toBe(true)`),耗时 ~1026ms —— 正好是 `vi.waitFor` 的
**默认 1000ms**。
根因不是产品缺陷,而是预算错配:`vi.waitFor` 的默认超时与套件的
`testTimeout`(15s,当年为 Windows lane 的真实子进程抬的)**互不相干**,仍是 1s。
上次 `630d10f` 已经把这个 helper 从「drain 微任务」改成「等真实渲染条件」,但条件
等待的预算没跟着抬,于是一旦 `fs.trees` 的应答 + React flush 越过 1s(满载的
2 核 runner 上很容易),断言还是先超时。
本机复现(往 `fs.trees` mock 注入 1200ms):
- 默认 1s 预算 → 1049ms 红,签名与 CI 逐字相同;
- 5s 预算 → 1296ms 绿。
仍是**条件**等待而不是固定时长:行一渲染出来就返回;树永远列不出该行时用例照样
失败(只是从 1s 变成 5s),`630d10f` 的反判别性检查继续成立。测试改动,产品代码
零改动。同一暴露面还有 7 处 `vi.waitFor` 未给预算(`zip.spec.ts` ×4 /
`dock-fallback.spec.tsx` ×2 / 本文件外),暂未在 lane 上翻车,未一并改动。
2026-10-08 21:58:13 +08:00
Menghuan1918
657f75c1be
merge fix/session-scope-write-guard into dev(#848 会话切换不再把上一个项目的写操作带进新项目:文件树选中集/菜单/内联编辑器/确认框随会话与 cwd 一起失效,批量删除与打包构建按 generation 退役结算;含收尾修正——删除确认与拖拽上传改在**调用点**复核 armed scope,关掉「swap 已提交、passive effect 未 flush」之间那个仍会把 B 的 scope 配 A 的绝对路径发出去的丢数据窗口)
...
# Conflicts:
# src/client/FileTree.tsx
2026-10-08 21:56:03 +08:00
Menghuan1918
62c1a0cc63
fix(safety): 删除确认与拖拽上传在调用点校验自己的 scope(#848 收尾)
...
独立正确性评审在 PR #853 上复现出一个**仍然丢数据**的窗口,本提交把它关掉:
**HIGH|单行删除**:`confirmDelete` 只装 `{path, isDir, name}`,scope 在确认时现读。
换会话的清理写在 **passive** effect 里,而点击可以落在「swap 已提交、effect 尚未
flush」之间 —— 此时 `propsRef.current` 已经是新会话。实测(`flushSync` 提交 swap
后立刻点那个仍挂在 DOM 上的 Confirm):
```
fsRemove({sessionId:'s2',cwd:'/projects/beta'}, '/projects/alpha/a.ts')
```
宿主对绝对路径原样执行(包含性检查是刻意移除的),于是**删掉的是上一个项目的文件**,
正是本 PR 要修的那件事。批量走的第一次 `fsRemove` 同样直接发在点击处理器里。
修法是把「armed 时的 scope」随确认一起存下来,并在**调用点**复核(`sameScope`):
单行删除存进 `confirmDelete.scope`,批量把 `confirmDeleteSelected` 从 boolean 换成
`FsScope | null`;不一致就整条请求不发(fail closed),请求本身用 armed scope,
scope 与 path 因此永远属于同一个项目。同时在途结算也按 `scopeGenRef` 退役,
不再把结果写进已经换过的项目。
**MEDIUM|拖拽上传**:`reportDrop` 的 `uploadItemsFromDrop(...).then` 里用的是**最新**
props 的 `onUploadRequest`,而 `dir` 是拖拽开始时的旧路径 —— 一次落点会把这批文件
传进新项目的树里。现在同样 armed/复核,不一致即丢弃。
测试:`tests/file-tree-session-scope.spec.tsx` 新增两条 —— 上面那条窗口的判别性用例
(**还原守卫即红**:`expected "vi.fn()" to not be called at all, but actually been
called 1 times`)与一条正向对照,钉住「请求里的 scope 与 path 必须同源」(只数调用
次数抓不到 scope 被换掉的回归)。typecheck / lint 干净,该 spec 6/6 绿。
2026-10-08 21:55:12 +08:00
Menghuan1918
06dff2f56e
merge fix/871-preserve-eol into dev(#871 保存保持文件原有行尾:宿主侧在 fs.write 的唯一咽喉点先按盘上内容嗅探行尾(4096 字符多数表决,与宿主 dsh-fs-local 的 detectLineEndings 同判据),写回时按同一判定归一化,CRLF 文件不再被写成 LF 而产出整文件 diff;mtime 冲突基线、fs-conflict 横幅与 #855 的 dirty/编辑态跳过语义均不变)
...
# Conflicts:
# CHANGELOG.md
2026-10-08 21:52:00 +08:00
Menghuan1918
90a88670de
docs(plans): 给工作区围栏设计文档补「后续偏差」(围栏已于 v0.23.0 移除、fs.search 现在会越界)
...
这份 2026-08-29 的设计文档状态仍写着「已实现」,末句「`fs.search` 不动——它锚定
cwd 向下走,本来就不会越界」两处都已失真:
- 围栏本身在 v0.23.0 被用户要求整体移除(`path-security.ts` 只剩解析语义,
`isWithin` 退化为客户端词法工具、不再是安全边界);
- #879 之后 `fs.search` 新增指名目标的直开分支,命中确实会返回工作区外路径。
按 AGENTS §6「docs/plans 逐特性设计,含实施偏差记录」补一节「后续偏差」,
并把状态行改为「已实现、随后整体移除」。纯文档改动。
2026-10-08 21:48:56 +08:00
Menghuan1918
ec26c6892b
fix(fs-search): 合并收尾——点前缀手势的反斜杠按平台门控(#879)
...
`isDirectPathQuery` 的 `/^\.+[/\\]/` 没有做平台门控:POSIX 上 `.\notes` 是
**合法文件名**(点 + 反斜杠,两部分都是名字字符),却被判成「点前缀相对路径」
送进 `resolveTarget`,stat 一个不可能存在的路径 → 必然空结果,同时丢掉名字查询
与引擎资格。现改为平台门控的 `DOT_ANCHORED_RE`(win32 才收 `\`),并把分隔符
判定收敛到共享的 `SEPARATOR_RE`,`hasSeparator` 与它同源、不会再分叉。
判别性:新增用例 `a dot-prefixed POSIX name with a backslash stays a name query`,
还原实现即红(`matches` 由 `['.\\notes.md']` 变 `[]`、`probed` 由 true 变 false)。
`tests/fs-search.spec.ts` 31 条 + `tests/search-engines.spec.ts` 38 条全绿。
顺带:`src/search-engines.ts` 的 `close` 结算注释原写「timeout/error 的结算
在下面」,实际两者注册在上面(:282/:283),改正方向。
2026-10-08 21:48:13 +08:00
Menghuan1918
e655bf2e44
merge fix/879-fs-search-path-query into dev(#879 搜索框粘贴路径结构性零命中:searchFiles 按查询形态分流——指名单一目标(绝对路径 / ~ / ./ / ../)经 resolveTarget stat 直取、缺失立即空结果不再烧 10 万预算,含分隔符的相对片段按根相对路径匹配,普通名字查询原样不变;SKIP_DIR_NAMES 补 .worktrees/.worktree/target/venv/.venv/__pycache__,walk 与两条引擎 argv 共用。含客户端「工作区外目录命中行只清空查询」守卫)
...
# Conflicts:
# CHANGELOG.md
2026-10-08 21:47:02 +08:00
Menghuan1918
c241f8336c
merge fix/883-streamlines-close into dev(#883 streamLines 结算事件 exit→close:Node 的 exit 在进程死亡瞬间触发、stdout 管道可能仍有未排空数据,负载高时 Promise 带着空 lines resolve,fd 的 --type d 第二路因此偶发返回 matches 完好 + dirs 空;同时删掉 runChild fd 分支把 rejection 吞成「目录恰好为零」的 catch,让失败流进 runEngine 既有的 broken + JS 回退。含 setEngineHooks 的 spawner 缝隙与两条确定性用例)
2026-10-08 21:46:48 +08:00
finley08
fc61cddc16
fix(routes): HTTP routes ride the page base again — the desktop shell is cross-origin to the injected transport origin
...
The prefix fix routed every route through `__DSH_TRANSPORT__.streamBaseUrl`.
For WebSockets that base is required (a custom scheme cannot host `ws:`, and
the shell page's host is the literal `app`, whose DNS lookup never completes),
but for HTTP it is a DIFFERENT origin than the page: the Electron shell serves
the GUI from `dsh-app://app/` while `streamBaseUrl` is the Host's
`http://127.0.0.1 :<port>` (`streamBaseUrl: new URL(hostUrl).origin` in the
shell's `main.js`, via `DESKTOP_IPC.boot`).
Measured on DSH 0.2.0-rc.2 + Electron shell:
- `OPTIONS /sidebar/api/fs.trees` (Origin: dsh-app://app, preflight for the
plugin's JSON POSTs) → `405 method not allowed`, no `Access-Control-Allow-*`
header; the actual POST answers `400` with no CORS header either.
- The shell's `protocol.handle('dsh-app', …)` forwards every NON-STATIC
`dsh-app://app` path to the Host (`forwardWebRequest(request, hostUrl,
hostCookie)`), so `dsh-app://app/sidebar/api/…` reaches the Host same-origin —
the exact shape `fetch('/sidebar/api/…')` produced before the prefix fix.
Consequence in the desktop window: every plugin request is blocked by the
browser and surfaces as "Failed to fetch" — file tree (the whole sidebar body),
git, editor, uploads, archive, chunk loading. The web profile in a browser is
unaffected (there the page origin IS the transport origin), which is why the
mount lane cannot see it.
HTTP now resolves against `document.baseURI` — which carries a reverse-proxy
directory prefix too, so one rule covers both deployments — and falls back to
the transport base when no page base exists (specs / SSR). WebSockets keep the
transport base. `tests/base-path.spec.ts` pins the split per transport,
including the shell case and the no-page-base fallback.
2026-10-08 11:39:11 +08:00
finley08
b0d354f209
fix(editor): re-measure a revealed editor even when its host is only MOVED
...
The native right sidebar parks a `keepMounted` tab body through the host's
`retainTab` path, which moves the body into a hidden seat and back. Moving a
node never changes its border box, so the `ResizeObserver` added in #837
(d3df20e / db563ca ) is never called for that path: a CodeMirror view created
while its host was hidden keeps the zero-sized viewport it measured, and the
editor stays visually blank — gutter line numbers drawn, document body empty —
until the tab is remounted. Observed on DSH 0.2.0-rc.2 + the Electron shell
with a `.yaml` file opened from the file tree while another tab was active: the
buffer holds the text (select-all copies it), only the paint is missing.
Three additive recoveries, next to the existing measure:
- `IntersectionObserver` on the host — reports the reveal itself, so a body
that was merely moved is re-measured (the box need not change).
- a `requestAnimationFrame` follow-up after mount — a reveal that lands in the
mount's own frame happens after CodeMirror's first measure read a zero box.
- `visibilitychange` / `window resize` — the document-level equivalents.
A non-intersecting report spends nothing, so pane scrolling does not queue
measures. `tests/text-editor-visibility.spec.tsx` gains a case for the
size-preserving reveal (and pins that the invisible report is ignored); the
existing ResizeObserver cases are unchanged.
2026-10-08 08:14:34 +08:00
NolanHo
6497046c9e
fix(search-engines): settle streamLines on close, propagate fd dirs-run failures ( #883 )
...
streamLines settled its promise on the child's 'exit' event. Node fires
'exit' the moment the process dies, while the stdout pipe may still hold
undrained data — under host load the exit event can win that race and the
promise resolved with a still-empty lines array. fd's second --type d run
was the common victim (both children race, the match run usually drains
first), so the observable signature was matches intact with dirs: [] —
directory hits silently degraded into open-as-file errors, the exact
error surface #801 fixed, now intermittent.
Settlement moves to 'close' (process dead AND stdio drained, so every
readline line event has fired). The truncation kill, the timeout and the
spawn-error paths keep their semantics: whichever finish() ran first
sets the closed flag and the close handler is idempotent. The --version
probe keeps 'exit' — its stdio is 'ignore', the exit code is the only
signal it reads.
The fd branch also no longer swallows the directory run's failure: the
.catch(() => empty dir list) is deleted, so a rejection now reaches
runEngine's existing broken-marking and this one search falls back to
the plain walk — symmetric with the main run, where the old catch
degraded every failure into an invisible "zero directories".
Evidence: on an fd-equipped Linux host the real-engine suite reproduced
7/30 runs on clean dev (signature constant), 0/30 after the one-line
close change; upstream CI never saw it (ubuntu lane has no fd; ci-windows
runs serially). Two deterministic cases now pin the contracts through the
new spawner hook (scripted PassThrough children replay the racy event
order directly); each was verified red by temporarily reverting the
corresponding half of the fix.
2026-10-06 10:50:51 -07:00
NolanHo
0d9fee85b8
fix(fs-search): direct-open for pasted paths + fragment path matching ( #879 )
...
A query carrying a path separator can never match an entry NAME — names
never contain separators — so pasting any path into the search box was
structurally guaranteed to return {matches:[],truncated:true} while the
walk burned its full 100k-visit budget (measured: 1.9s on a Rust repo
whose two worktree forests alone held 97k entries; real directories were
never reached).
searchFiles now routes by query shape, all three modalities sharing one
result contract:
- A query naming one path (absolute, ~/…, ./x, ../x) resolves through
resolveTarget — the SAME primitive fs.read uses, so ~ expands (#713 ),
dot-anchored spellings join onto the session cwd, and win32
WSL/dsh-remote namespaces reinterpret — then stats the target. The hit
is the RESOLVED path (resolve() strips shell-completion trailing
separators, which the client's exact-string row comparisons could never
match); a missing target answers empty immediately. Directory targets
ride the #801 dirs contract. The exclude pref does not apply: a pasted
path is explicit intent, same as the fs.read the click performs.
- A separator-carrying relative fragment (records/exp1) matches by
root-relative PATH in the walk; the engines are name matchers (fd has
no --full-path here, rg's globs are single-segment) so argv
construction is untouched.
- Plain name queries are unchanged, and no NAME query is stolen: on
POSIX a backslash is a name character (the ~\ gesture counts only on
win32; util.ts~ / ~$doc.docx / .env stay name queries).
SKIP_DIR_NAMES gains the budget-eating forests seen in the wild:
.worktrees/.worktree (git worktree layouts), target, venv/.venv and
__pycache__ — shared by the walk and both engine argvs as before.
Client: a directory hit OUTSIDE the cwd (newly reachable via the paste
branch) only clears the query — the tree is cwd-rooted, and the old
ancestorDirs call synthesized junk expanded entries for foreign paths.
Verified: vitest fs-search/smoke/search-persist suites green; full run
2171 passed with one failure proven pre-existing on the clean tree
(git.spec checkout case, host git lacks --end-of-options; #841 );
typecheck/lint clean.
2026-10-06 08:25:30 -07:00
ymac
419d1c4b67
fix(editor): 保存保持文件原有行尾,不再把 CRLF 文件写成 LF(#871)
...
编辑器传送的永远是 LF 文档(CodeMirror 没有别的行模型),`fs.write` 原样落盘,
于是在 Windows 检出上「改一行」= 整文件 diff。
- `text-encoding.ts`:`encodingOfFile` 扩成 `fileFormatOf(path)`,同一趟 64 KiB sniff
同时给出 `{ encoding, eol }`;新增 `detectEol` / `restoreEol`(口径与宿主
dsh-fs-local 的 detectLineEndings / restoreLineEndings 一致:前 4096 字符多数票、
孤立 \r 不计票也不改写、还原前先归一化以免 \r\r\n)。
- `index.ts` 的 `fs.write`:落盘改为 `encodeText(restoreEol(content, eol), encoding)`。
客户端零改动,所有保存入口自动覆盖;新文件仍是 UTF-8 + LF(项目级行尾约定另议)。
- 测试:text-encoding 补 3 条、fs-write-route 补 3 条端到端;拿掉 restoreEol 调用即 2 条红。
- 文档:设计文档 docs/plans/2026-10-06-preserve-eol-on-save.md、CHANGELOG、AGENTS §5 保存语义。
顺带核实(写进设计文档):宿主 `edit` 工具会保住行尾(editText 走 restoreLineEndings),
宿主 `write` 工具不会(writeText 原样写模型文本),那一半插件无权干预。
2026-10-06 15:36:36 +08:00
Menghuan1918
4e51e0789c
merge fix/editor-host-mount-race into dev(修 editor-host 在慢 runner 上的文件树加载竞态:等真实渲染条件而非 drain 微任务;纯测试改动,含反判别性检查与 300ms 注入下的 A/B 对照)
2026-10-06 01:19:39 +08:00
Menghuan1918
630d10fb54
test(editor-host): 等文件树真的渲染出该行再断言(修慢 runner 上的加载竞态)
...
两个 mount helper 只 drain 微任务,而文件树层级缓存由异步 fs.trees 应答填充:一旦那次刷新
被排成宏任务,helper 返回时树仍在 loading 行,断言就找不到 [class*="explorerName"](CI 上
names= 为空 / 本地注入延迟时 names=tmp,CI 只报了第一个挂掉的用例,同一模式实际影响 3 个)。
改为 vi.waitFor 等待真实渲染条件(不是调大固定超时):树真列不出该行时仍按 1s 超时失败——
反判别性检查(把 mock 里的 a.ts 换成永不出现的 b.ts)确认 3 个用例仍会在 1.0s 内失败。
300ms 宏任务注入下:修复前 5/5 轮全红(各 3 用例)→ 修复后 5/5 轮全绿 14/14。
纯测试改动,产品代码零改动(与 #855 无关:把 EditorHost.tsx 单独 revert 到 #855 之前,
同一探针仍 3/3 轮全红、文本逐字相同)。
2026-10-06 01:19:38 +08:00
Menghuan1918
91f9910ad6
docs(changelog): 记录 CRLF 三层 \r 误判与预览双拼写渲染的修复及未修的保存侧归一
2026-10-06 00:59:49 +08:00
Menghuan1918
0ee870ade2
merge fix/crlf-markdown-surface into dev(修 CRLF 输入下的三层 \r 误判与预览双拼写渲染:markdown-html 的 isBlank / mermaid-blocks 的 CLOSE_FENCE_RE / markdown-code 的 closesFence 把 \r 当内容,导致 HTML 段永不终止、mermaid 围栏吞掉余下文件、链接改写从第一个围栏起全部失效;TextEditor 的 draft 快照把 CodeMirror 归一化后的 LF 文档覆盖预览源,使挂载那一趟写入的标题 id 被丢弃。含测试脚手架 CRLF 安全化与 9 条 CRLF≡LF 判别性用例)
2026-10-06 00:57:35 +08:00
Menghuan1918
4fdbaa158a
merge feat/855-editor-auto-refresh into dev(#855 P1 编辑器预览在 LLM 改完文件后自动刷新:信号源用既有 changes.ops 增量流、每会话一条共享消费者 + 成员选举(N 个 tab 每 tick 仍 1 个请求)、只刷新命中且未命中零重读、dirty/编辑态一律跳过不覆盖用户输入、含 14 条判别性用例)
...
# Conflicts:
# CHANGELOG.md
2026-10-06 00:56:50 +08:00
Menghuan1918
34ce191981
docs: 修正 #855 的用例数、脏态出口口径与轮询叠加口径
...
- **[硬数字]** CHANGELOG 的 `tests/editor-auto-refresh.spec.tsx` 用例数
11 → 14(原本就少 1,加上本批新增 2 例);同批核对:既有 #167 的 4 条、
2.5s 节奏、「N 个编辑器 tab 每 tick 1 个请求」均属实。
- **[用户可见承诺]** 删掉「dirty / 编辑态由既有的『编辑 → 预览』边沿补刷」
这句不成立的话:该边沿**自身带 dirty 守卫**(`EditorHost.tsx` 的边沿判定
要求 `dirty !== true`,`tests/editor-refresh.spec.tsx` 的 B 例两半都钉住了:
干净时 fsRead 1→2,dirty 时仍是 1)。按事实改写为:未 dirty 时点页头
「预览」会重载并拿到新内容;dirty 时该边沿被抑制,真正的两条出口是**页头
刷新按钮**(`window.confirm` 后重载)与**「保存 → `fs-conflict` 横幅的
reload」**(保存带 `mtimeMs` 基线,不会静默覆盖模型字节)。结论句:dirty
期间保持旧内容直到用户显式动作,**不存在看不到新内容的死路**。指南 §5.2、
指南行为差异表、CHANGELOG、设计文档 §4.2 四处同步。
- **[叠加口径]** 同一会话同时开着文件变动页(会话透镜)与编辑器时,该会话
每 tick 是 **2 个** `changes.ops` 请求——「每 tick 1 个」只算编辑器这一份。
一次性探针实测:会话透镜单独 1/tick、编辑器单独 1/tick、两者同开 2/tick
(记进 CHANGELOG、指南行为差异表与设计文档 §4.1)。
- 设计文档 §5/§6 的用例数与门禁数字同步为本次实测(184 文件 2152 通过 /
13 跳过 / 0 失败)。
2026-10-06 00:55:52 +08:00