Commit Graph
1351 Commits
Author SHA1 Message Date
Menghuan1918 80fe1abfde merge chore/release-0.28.1: prepare v0.28.1 (OOM single-flight + README/screenshots) 2026-10-26 17:51:40 +08:00
Menghuan1918 4023927a64 merge fix/cwd-single-flight: 同键冷读 single-flight(OOM 修复) 2026-10-26 17:51:33 +08:00
Menghuan1918 7ecf6a14af perf(host): share one cold cwd read across concurrent /sidebar requests
cwdOf() resolves the session cwd for all twelve /sidebar routes. On a
detached session every call runs one host observation — the whole log read
plus decode — and the host's cold cache only helps AFTER a read completes,
so a session-switch burst decoded the same multi-MB log N times in parallel
(0.28.0: 39 MB × 44 requests ≈ 1.7 GB, OOM). Concurrent asks for the same
session + client cwd hint now share ONE resolution; there is no TTL (the
host already caches completed cold reads by persistence revision), and the
hint stays in the key so different fallbacks never leak across each other.

tests/smoke.spec.ts pins 12 concurrent calls → 1 observeSession (red before
this change: expected 12 to be 1) and the per-hint key. The dock-fallback
reserve test now clears localStorage per case — a previous case persisted
bottomOpen and made the new click toggle it closed.
2026-10-26 17:51:30 +08:00
Menghuan1918 8ee6e8de27 chore(release): prepare v0.28.1
- bump package.json / dsh.plugin.json / SIDEBAR_SERVICE_VERSION to 0.28.1
- CHANGELOG: 未发布 → v0.28.1; CHANGELOG_EN gains the v0.28.1 summary
- README / README_ZH: install commands target 0.28.1; Recent Updates
  trimmed to v0.28.1 / v0.28.0 / v0.27.0; Git screenshot alt + tags note
- refresh docs/screenshots/files-tree.png and changes-tree.png from a
  neutral demo workspace (git colors + tag pills in the commit graph)
- AGENTS + external-plugin-guide: current stable version is v0.28.1
2026-10-26 17:43:39 +08:00
Menghuan1918 bf5844207b docs(plans): record the e2e reconciliation and the green CI run 2026-10-26 15:46:28 +08:00
Menghuan1918 6e29d91bec test(e2e): 选区引用改为 chip 后更新 @ 引用 e2e 断言
#1052 把「添加到对话」的多行选区改成引用 chip(正文只在发送时展开),
#1002 留下的 mount e2e 仍按旧的 plain-text 围栏断言(3 chips + 围栏正文),
合并后 plugin-mount 在真实 DSH 上红:实际 4 chips。改为断言第 4 枚 chip
落地、label 带来源文件、且不产生 plain-text reference;围栏正文的逐字
载荷由 tests/selection-payload.spec.ts 在单测层钉住。

验证:本地 (真实 DSH 0.2.1-rc.1)1 passed。
2026-10-26 15:39:40 +08:00
Menghuan1918 c7d0e12341 docs: record the UX triage batch and file #983/#992/#1059 under 未发布
- CHANGELOG: add the #992 dock-fallback entry
- docs/plans: scan inventory, per-batch merge/close evidence, deferred PR
  verdicts (#1040 #1019 #1048), gates and known local flakes
- issue-triage: #983/#992/#1059 are dev-fixed pending release
2026-10-26 15:30:46 +08:00
Menghuan1918 fd8a09d96b merge #992: 桌面壳兜底入口避开标题栏左侧系统按钮(红绿灯) 2026-10-26 15:26:46 +08:00
Menghuan1918 c908959f3d fix(sidebar): 桌面壳兜底入口避开标题栏左侧系统按钮(#992)
macOS 桌面壳的原生红绿灯不在 elementsFromPoint 命中栈里,旧走查退到
视口左缘 left=4 时会把它压住。现在 darwin(非全屏、标题栏行)把左移
下限抬到宿主标题栏保留区 88px;下限之上仍无空位时接受与宿主内容重叠,
不隐藏空白会话唯一的底部工作台入口。web 行为仍是原来的 100 步有界走查。

tests/dock-fallback.spec.tsx 补 3 例:桌面占满时 left >= 88 且入口可点、
原生控件不在命中栈时同样避开保留区、web 占满时仍停在原位置。
2026-10-26 15:26:44 +08:00
Menghuan1918 73fed1689d merge #1059: 重新载入后不再死锁在 fs-conflict(仅 mtime 变化就地更新保存基线)
# Conflicts:
#	CHANGELOG.md
2026-10-26 15:20:23 +08:00
Menghuan1918 a1dd6b0eb8 merge #983: 提交图显示 tag(独立 tag 预算 + 分页指纹)
# Conflicts:
#	CHANGELOG.md
2026-10-26 15:20:04 +08:00
Menghuan1918 44007061bb fix(editor): 重新载入后不再死锁在 fs-conflict(#1059)
根因:保存基线 mtimeRef 只在 [content] effect 里刷新;重新载入返回同样
文本时 content 不变,effect 不跑,下一次保存继续发送旧 expectedMtimeMs。

修复:
- props.mtimeMs 变化时也更新 mtimeRef(只动基线,模式/草稿/脏标记的
  文件切换重置语义保持不动);
- 冲突横幅「Reload from disk」先探测磁盘文本:与上次载入/保存的字节
  一致时说明只有 mtime 变了,就地采用新基线、保留草稿、不经过脏确认;
  文本确实变化时才交回宿主的带确认重载(脏保护不变);
- 记录最近一次成功保存的文本作为比较点:编辑态保存不会重新载入,单靠
  props.content 会滞后于磁盘。

tests/text-editor-conflict.spec.tsx 的横幅回调断言跟随异步探测调整:
探测失败时仍在下一微任务回落宿主重载。
2026-10-26 15:19:12 +08:00
Menghuan1918 5bacf5fa0c 修复提交图标签缺失并校验标签分页快照 2026-10-26 15:19:02 +08:00
Menghuan1918 0dfee1dd84 test(editor): 覆盖仅 mtime 变化的重新载入保存基线(#1059)
两个判别性用例:
- TextEditor 同实例收到新 mtimeMs、content 不变时,保存必须发送新基线;
- 冲突横幅重载:dirty + 仅 mtime 变化 + confirm=false 时就地更新基线并保留草稿;
  磁盘文本确实变化时脏保护仍然生效。

修复前第一个文件的首例失败(100 vs 200),第二个文件的首例失败
(confirm 被调用、横幅不清除)。
2026-10-26 15:17:32 +08:00
Menghuan1918 9d973ccf8c docs: file the merged batch under 未发布 and refresh the version matrix
- CHANGELOG: move #929/#1013/#1020 entries out of released sections and add
  the remaining merged-batch entries (#999 #956 #981 #965 #1012 #1002 #1052)
- README/README_ZH: DSH npm latest is now 0.2.1-rc.2; spell out the old-host
  pin and the marketplace latest-vs-host mismatch
- issue-triage: the 0.26.0/0.28.0 fixes are released; only #915 is still
  dev-fixed-pending-release
2026-10-26 15:12:01 +08:00
Menghuan1918 1eeec0c27e merge #1053: fix(sidebar): keep the bottom workbench toggle while the right panel is open
# Conflicts:
#	CHANGELOG.md
2026-10-26 15:07:36 +08:00
Menghuan1918 6b4f9652f6 merge #1055: fix(markdown): 本地链接里的 Windows 反斜杠统一为正斜杠
# Conflicts:
#	CHANGELOG.md
2026-10-26 15:07:15 +08:00
Menghuan1918 5311467060 merge #981: fix(builtins): archive sidechat sessions when their tabs close 2026-10-26 15:07:01 +08:00
Menghuan1918 01a6fa573b merge #1057: perf(sidebar): 页签内容的会话 scope 改为按内容稳定,消除无关重渲染导致的整文件重读 2026-10-26 15:03:28 +08:00
Menghuan1918 25fd296f99 merge #1052: feat(editor): 「添加到对话」改用引用 chip,正文只在发送时展开
# Conflicts:
#	src/client/conversation-draft.ts
#	src/context-types.ts
#	tests/conversation-draft.spec.ts
#	tests/reference-in-chat.spec.ts
#	tests/sidebar-workspace-reference.spec.tsx
2026-10-26 15:03:28 +08:00
Menghuan1918 f74369d2b6 merge #1002: fix(client): 草稿插入不再整份重写,chip 不再被展平(@ 提及两段式) 2026-10-26 15:02:38 +08:00
Menghuan1918 ad078e4ea4 merge #965: fix(editor): remember the edit scroll position across tab re-seating 2026-10-26 15:02:38 +08:00
Menghuan1918 042ae22bf4 merge #1012: fix(float): 浮窗右下角缩放手柄不再被 tab 内容压住 2026-10-26 15:02:36 +08:00
Menghuan1918 01f126e866 merge #1020: fix: export the plugin icon subpath
# Conflicts:
#	CHANGELOG.md
2026-10-26 15:02:36 +08:00
Menghuan1918 8c08758afd merge #956: fix(sidebar): worktree 会话的根选择与地址基准(#947 / #950 / #952) 2026-10-26 15:00:57 +08:00
Menghuan1918 22eb6ebddf merge #929: fix(tree): 改名/删除的调解覆盖后台会话的页签 + 标题只在派生自文件名时跟随(#915 后续) 2026-10-26 15:00:55 +08:00
Menghuan1918 28566625b3 merge #1018: fix: 分支过多时继续显示提交历史 (#1013) 2026-10-26 15:00:52 +08:00
Menghuan1918 c45cea1f77 merge #999: fix(git): harden runGit's output caps — latch, killTree, stderr budget 2026-10-26 15:00:42 +08:00
unsc9 31dc3b4572 perf(sidebar): give every consumer one stable session scope
A tab body keys memos and effects off `scope` (the diff pane resolves its
media/html routes from it, the editor restores its preview scroll, the side
chat rebuilds its prose-rewrite cache), but the tab cell built
`{ sessionId, cwd }` fresh on every render. Every such dependency therefore
looked changed whenever the cell re-rendered — which the memo comparator
allows exactly when a COMPARED field moves: `expanded` on a directory toggle,
plus `revealed`, `localeRevision`, `tabsVersion`. The diff preview then
re-ran its whole-document rewrite and its content tab re-issued a whole-file
`fs.read`, flashing its loading row.

`useSessionScope` is now the one place a scope for a component tree is built;
the tab cell, the diff tab, the native tab adapter, and the shell's badge /
rightActions / `+` menu / lifecycle-callback seams all use it. Those last
ones are documented external plug-in surfaces, so a plug-in memoizing on
`scope` stops churning on every unrelated re-render too.

Stabilizing the object removes the only path the diff pane's `content` tab
had to re-read after the file changed on disk, so the header's refresh button
now drives it explicitly (the pane owns the gesture; the loader no longer
leaks its internal counter).

Seven comments asserted that the scope object's identity churns on every
render; that premise is gone, so the ones that still apply say what they
actually guard.
2026-10-25 20:41:54 +08:00
wumingguren 828452ae77 fix(markdown): 本地链接里的 Windows 反斜杠统一为正斜杠
Markdown 把 `\_` 当作转义,`[x](C:\ws\_analysis\r.md)` 解析后路径少一个分隔符(变成 `C:\ws_analysis\r.md`),点击时报 ENOENT(issue #1037)。

- rewriteDestination 对所有本地 destination 的路径部分用正斜杠输出(Windows 接受两种写法);无 fragment / line fragment / heading fragment 三条分支都覆盖
- UNC 前缀保持 `\\`,避免被解析成协议相对的 `//host/share`
- 新增 6 条断言:绝对/相对 Windows 路径、heading/line fragment、远程链接、幂等

验证:tsc --noEmit 与 eslint 通过;同一组用例用 Node 直跑通过(本机 vitest 配置打包在 Windows 上失败,CI 执行该 spec)。
2026-10-25 11:57:13 +08:00
WinterXMQ f2ad4b1af8 Merge branch 'dev' into fix/bottom-toggle-with-right-panel 2026-10-25 02:25:33 +08:00
WinterXMQ a3630a4bd2 docs(changelog): note the bottom workbench toggle staying visible
The header toggle no longer hides while the host's right panel is expanded.
2026-10-25 02:19:37 +08:00
WinterXMQ 788c5149c0 fix(sidebar): keep the bottom workbench toggle while the right panel is open
The header toggle bailed out whenever the host's right sidebar was expanded,
so opening that panel first left the bottom workbench unreachable until it was
collapsed again. The session header's utilities seat and the panel's own
Split / Fullscreen / Collapse cluster sit in two different columns, so they
never overlap.

The blank-session fixed fallback keeps its guard: that entry anchors to the
left of the panel controls and would cover panel content while expanded.

tests/bottom-toggle.spec.tsx pins both behaviours.
2026-10-25 01:31:21 +08:00
unsc9 4c2d34fce4 refactor(editor): 待插入引用改名 PendingReference,去掉泛型默认值
宿主导出的 DraftReference 是「草稿里已有的气泡」(带 offset/length),
插件这个类型是「准备插入的引用」(只有 label/text)。两者同名不同义,
按名字 grep 会拿到完全不同的形状。改名为 PendingReference 区分。

selection-popup 的 T = string 默认值生产环境已无人使用(唯一调用方
显式写了类型),只为迁就测试里不写类型的旧写法。去掉默认值后类型仍能
从实参推断,测试无需改动。
2026-10-24 21:53:24 +08:00
unsc9 9598278094 refactor(editor): 删掉真机上永不生效的 DOM 光标探测
宿主 composer 是 Lexical contenteditable,真机页面里 0 个 textarea
(已用无头浏览器核对)。probeComposerCaret / placeComposerCaretAfterInsert
永远返回 null,spliceInsert 的中间插入分支也永远走不到——三段死代码,
连同它们的 jsdom 测试一起删除。appendToDraft 只剩追加语义。

同时清掉 review 指出的注释与文档问题:
- 模块头还写着「从 textarea 探光标」,与同文件后文自相矛盾。
- clipboardText 取短形态的理由写错了:宿主持久化的是 {text, references},
  气泡能跨重挂载恢复。真正的理由是它是草稿串的对外投影。
- 同一句「宿主自带相位/rev 守卫」在 conversation-draft 与 context-types
  各写一遍,后者改为引用。
- 设计文档 §2/§4/§6 已与实现脱节(insertFileReference 已删、phase 语义
  已变、命令气泡是新坑),按当前实现重写。
2026-10-24 21:45:47 +08:00
unsc9 b7d17e8c0a fix(editor): 气泡插入补左侧分隔,并覆盖命令气泡与冻结期
code review 挖出的六处行为问题:

- 宿主只在气泡之后补空格,之前不补,所以往 hello 后插气泡会读成
  hello[chip]。插入前先用同一条 span 通道占一个分隔位。
- 命令气泡(/goal)不在 occurrences 里(宿主只收引用气泡),但它在
  detect 投影里同样只占一个字符。补上按 claim.token 折叠,否则 span
  越界、引用插不进去;setDraft 分支也会把命令气泡碾成字面文本并丢掉
  claim,所以 claimed 状态同样走 span 通道。
- 选区气泡的 ref 是围栏正文而非路径,标成 appearance:file 会让宿主
  把它当可点开的文件,点一下拿整段正文去开文件。改为由调用方决定。
- 宿主可能已经应用了编辑再抛异常,此时报 false 会让调用方再插一份纯
  文本。异常分支先重读 revision 再判断。
- 冻结期(adjudicating/submitting)直接拒绝,不回退。

顺带删掉 insertReferenceOrText 没人覆盖的 fallbackText 参数,修掉
insertWorkspaceReference 对同一路径重复调用 mentionFor。
2026-10-24 21:39:14 +08:00
unsc9 26be90d66f test(e2e): composer 定位改用宿主的 composer slot
首屏占位符名字(Describe what you want to build)在会话有内容后就消失了,
拿它查 composer 会一直超时。改锚定 [data-slot=conversation.composer.bar]:
这是宿主自己的稳定属性,且天然把插件里同样 contenteditable 的 CodeMirror
排除在外,不用再靠 DOM 顺序猜。
2026-10-24 20:50:07 +08:00
unsc9 9067e2cac4 test: 夹具跟上 insertReference facade,e2e 复用权威 composer 定位器
- conversation-draft 的两份 composer 假件合成一个 composerCtx,删掉从未
  被调用或断言的成员(setDraft / snapshot / phase 选项)。
- reference-in-chat、sidebar-workspace-reference 改为断言 facade 调用,
  不再断言 emit 事件。
- mount.e2e 用 host.ts 导出的 composerLocator,不再用
  [contenteditable=true].first() —— 插件自己的 CodeMirror 也是
  contenteditable,按 DOM 顺序取首个会取错。
- 修正设计文档里一条与实现相反的结论(ref 存的是发送正文,不是 label)。
2026-10-24 20:29:59 +08:00
unsc9 b3b316b457 refactor(editor): 气泡插入直连宿主 facade,共用一份分隔规则
宿主 SessionInput 上本来就有带返回值的 insertReference(native @ 选择器
的监听器就是转调它),之前绕道 emit 事件是多余的一层:手抄了相位白名单、
还得靠前后 draftRev 比对推断成败。改为直接调用后,这两样都交回宿主。

顺带收拢三处重复:
- 左侧分隔空格规则原本 spliceInsert 与气泡分支各写一遍,抽成 leadFor;
  气泡分支不再算完整条草稿再丢弃。
- 「先试气泡、失败退化纯文本」的策略在 TextEditor 与 explorer 按钮各写
  一遍,收进 insertReferenceOrText。
- 测试里两份几乎相同的 composer 假件合并成一个 composerCtx。

无行为变化:气泡仍只在宿主支持时插入,其余情况照旧退化纯文本。
2026-10-24 20:29:53 +08:00
unsc9 1ed872268c test(e2e): 选区气泡探针改用真实拖拽与正确的选择器
三击/合成点击会在 mouseup 之前丢掉选区,浮层不弹;改用 mouse.move/down/up
的真实拖拽。气泡是 composer 里的兄弟装饰节点,不是 role=textbox 的后代,
选择器改按 label 文本在整页范围内定位。

真机 mount lane 已验证通过(23s):预览里选中一行 → 点按钮 → composer
里出现 diagram.md:12 气泡,草稿不含三反引号。
2026-10-24 19:39:55 +08:00
unsc9 9ebb14f7ad fix(editor): 有气泡但无 revision 时拒绝写入,别退化成碾平
宿主若既不给 draftRev 又拿不到 span 通道,剩下唯一的写入路径是
setDraft,它会重建整个文档、把每个气泡碾平。宁可不插入,也不毁掉
用户已经堆好的引用。
2026-10-24 19:19:05 +08:00
unsc9 8c431db740 test(e2e): 断言选区引用落在 composer 里是气泡,不是围栏正文
真机 mount lane 加一段:预览里选中一行 → 点「添加到对话」→ 断言
composer 里出现 path:lines 气泡,且草稿文本不含三反引号。
宿主若不认 reference-insert 事件、退化成纯文本,这条会直接失败。

同时记录设计与两套坐标系(clipboard / detect)的折算规则。
2026-10-24 19:17:42 +08:00
unsc9 f71a2727f1 feat(editor): 选区引用改成气泡,正文只在发送时展开
选中文字后点「添加到对话」,草稿里插入的不再是一整段围栏正文,而是
一个紧凑气泡(显示 `相对路径:起止行`);发给模型的仍是完整围栏块。
连续引用几段不再把输入框铺满。

- 复用宿主自己的 slash/input-insert-reference 通道(原生 @ 选择器同款)
- 新增 foldClipboardOffset:把草稿偏移折算到宿主的 detect 投影,否则
  草稿里已有气泡时 span 越界、第二次插入必然失败
- 气泡的 clipboardText 取短形态(label),会话重挂载时退化也只是一行
- 宿主没有气泡通道时回退原来的纯文本路径
- appendToDraft 在已有气泡的草稿上改走 span 事件,避免 setDraft 重建
  文档把每个气泡碾平
2026-10-24 19:09:07 +08:00
Atlas Zeng abfe133d89 Merge pull request #1050 from omdsh-dev/fix/perf-scan
perf: 扫描并修复侧栏卡顿(文件树/侧聊/diff/提交图 + 宿主路由)
2026-10-24 12:32:34 +08:00
Menghuan1918 18dade0f63 fix(perf): address the perf-scan review findings 2026-10-24 12:10:17 +08:00
Menghuan1918 c6fe1b3db9 docs: record the perf scan batch 2026-10-24 02:17:12 +08:00
Menghuan1918 a721911d44 perf(worktree): re-arm the active-root TTL when the event cursor is idle 2026-10-24 02:17:12 +08:00
Menghuan1918 81b2e8077e perf(bundle): answer HEAD from the stat without reading the chunk 2026-10-24 02:17:12 +08:00
Menghuan1918 0a4a94c704 perf(graph): window the commit history rows 2026-10-24 02:17:10 +08:00
Menghuan1918 2237f3787b perf(diff): parse a patch once and cap the default expansion 2026-10-24 02:17:10 +08:00