Commit Graph
781 Commits
Author SHA1 Message Date
unsc9 10ccebb052 test: let detached archive packs land before cleanup 2026-10-29 10:22:14 +08:00
unsc9 ae71cd05e6 test(editor): cover the three no-prompt switch branches 2026-10-29 09:10:44 +08:00
unsc9 9f92bff245 test: widen the Windows temp-tree cleanup retry budget
The ci-windows lane failed in archive.spec.ts's afterEach with ENOTEMPTY after the test had passed. The same cleanup flaked on 2026-10-15; the existing 10x50 ms retry budget is too short on a loaded runner. Raise it to 30x100 ms; POSIX still succeeds on the first attempt.
2026-10-28 22:32:03 +08:00
unsc9 00553e2484 fix: confirm before in-place file switch drops an unsaved draft
The merged editor mode rewrites the current tab's path, which remounts the viewer and drops a draft that lives only in that instance. Ask the same unsaved-edit guard the tab close uses; re-opening the current path and native-claimed files do not switch this tab and stay prompt-free.
2026-10-28 21:21:58 +08:00
taekchef 60c3fff158 merge: integrate Sidebar provider PR #1033 with current dev 2026-10-28 14:40:13 +08:00
taekchef fc717fbbff merge origin/main into genui-sidechat-surface: keep main's row-level rewrite pass and streaming parse inside the GenUI row component 2026-10-27 11:39:58 +08:00
Menghuan1918 f7a11ddbfe fix(host): root a detached session at its stored header, not a full log read
cwdOf() resolves the cwd for every file/Git route, and a cold (detached)
session paid one host observation per call: sessionQuery.observeSession({
projectionMode: 'all' }) decodes the whole zstd artifact and hydrates every
projection to answer with one workingDirectory string. The 0.28.1
single-flight only covered /sidebar/api, while the real startup fan-out
never goes through it: the fs-watch socket sends one frame PER WATCHED
DIRECTORY (server resolves cwd before it even reads the op), /sidebar/file
and /sidebar/html resolve per resource, upload/write per call. A 39 MB
session was therefore decoded dozens of times in parallel — the 44-read
OOM on 0.28.0 and the 36 reads reported against 0.28.1 are the same path,
not a broken dedupe.

A detached session now resolves through sessionPersistence.stat(), which
reads the first zstd frame only (header-only, never the log), memoized per
session id (headers are immutable) and shared in-flight across concurrent
asks. activeWorktreeRootOf() answers a detached session with that address
and no longer folds the stored log. Once the host attaches the session the
committed working_directory and linked-worktree following resume as before.

Trade-off (documented): until attach, the sidebar roots at the original
project rather than the agent's last directory/worktree.

tests/smoke.spec.ts rewrites the cwd group (header ahead of a stale hint,
one header read per session, 12 concurrent asks share one, stat absent or
failing falls back to the hint, live committed directory wins, relative
header cwd still refused) and tests/active-worktree.spec.ts pins that a
detached session performs no persistence read and no git probe.
2026-10-27 11:36:09 +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 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 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 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 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
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 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 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 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 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
Menghuan1918 18dade0f63 fix(perf): address the perf-scan review findings 2026-10-24 12:10:17 +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
Menghuan1918 b1efd9226b perf(sidechat): cache the per-row prose rewrite 2026-10-24 02:17:07 +08:00
Menghuan1918 4cb7937a37 perf(files): keep parked trees idle and batch the watcher re-arm 2026-10-24 02:17:07 +08:00
Menghuan1918 27a920f85b perf(tasks): coalesce wheel zooms to one commit per frame 2026-10-24 02:17:05 +08:00
Atlas Zeng 740d73a09a Merge pull request #1041 from omdsh-dev/fix/tasks-folding-performance 2026-10-23 21:44:37 +08:00
Menghuan1918 dc385130a0 fix(tasks): coalesce pointer drags to one update per frame
Background pans, the floating-window title drag and the anchored-popover drag committed on every pointermove, so a high-report-rate mouse re-rendered the tasks canvas at event cadence. Compose the latest position in a ref and commit it through the existing frame batcher; release and cancel flush synchronously. Click suppression still updates per event.

Regression: same-frame 100-move burst commits drop 98 -> 1; full suite 2720 passed.
2026-10-23 21:28:22 +08:00
NolanHo 6f14792baa fix(sidechat): address rendering review findings
Replace a failed present card with the generic failed tool row; keep one event-authoritative card whichever of the call and its delivered event lands first.

Use the host's real border token for the delivery card; include the visible description in the file button's accessible name and resolve its title path.

Handle CommonMark angle-delimited image destinations and preserve titles; add transcript, prose-rewrite, and DOM regression tests.

Update the change spec with review-driven acceptance commands, status, and evidence.
2026-10-23 02:48:13 -07:00
NolanHo 909f536eab feat(sidechat): render local images and present deliveries
Cache markdown label objects by value so MarkdownText's memo survives parent re-renders; pass streaming for unsettled assistant rows.

Rewrite local image destinations in Side Chat prose against the session cwd through the existing /sidebar/file media route.

Map present tool calls and deliverables/presented events to a compact delivery card with thumbnails and the plugin's file-open path.

Add the change spec, exploration notes, and regression tests.
2026-10-22 22:25:07 -07:00