Commit Graph
224 Commits
Author SHA1 Message Date
Menghuan1918 908db10904 docs: 记录 0.2.2 模型切换去重的那一笔 2026-11-04 22:22:05 +08:00
Menghuan1918 7a4a15292e chore(dsh): 适配 DSH 0.2.2-rc.1(基线/peer/CI/脚本/文档 + AgentModel 与 PTC 类型变化) 2026-11-04 22:13:07 +08:00
Menghuan1918 09b83cc6aa docs: 记录 2026-11-04 分诊与合入批次(10 个 PR/分支、18 条 issue 关闭、1 条判为宿主侧) 2026-11-04 21:18:32 +08:00
Menghuan1918 89b85a82a8 merge #1111: feat(sidebar) 划选引用 chip 可点击回跳源文件并闪行段(合入前修正:二次点击 nonce、落盘失败回退、注册契约与文档)
# Conflicts:
#	CHANGELOG.md
#	CHANGELOG_EN.md
2026-11-04 20:48:47 +08:00
Menghuan1918 30093748a2 docs: 同步 14 条 DSH peer,修正 chip 底部入口与行号漂移说明 2026-11-04 20:46:52 +08:00
xiangzz 805a03f91f feat(sidebar): 划选「添加到对话」落可点击引用 chip(点击回跳源文件并闪行段)
- 移植到 dev 基线(#1052 / #1002 之上):只加「可点击 + 行段落地」,不重做 chip 本体
- 自有 input-trigger source `betterSidebarQuote`:`openReference` 校验会话后回跳,
  `codec.serialize` 在发送时还原成与升级前字节一致的 `路径:起止` + 围栏正文
- 行段末行走模块级一次性旁路 `src/client/line-target.ts`(key = path + line,cap 32),
  不写进宿主导航参数(宿主 `SidebarRightResourceParamsMap.file` 只声明了 `line`)
- 引用记录存 `localStorage`(`dsh-better-sidebar:quote-refs`,FIFO 200):模块同时进
  core bundle 与 lazy editor chunk,两个实例只能靠它互见;插入失败即回滚记录
- 行段闪光用 CodeMirror 行装饰 + 皮肤令牌 `--dsw-alias-interactive-bg-hover-accent`
- 三级降级:自有 chip → #1052 内置 chip → 纯文本,永不比升级前更差
- 新增 peer `@deepseek-ai/dsh-client-ui-input-trigger` `^0.2.1-rc.1`(DSH peer 增至 14 条)
- 文档:指南新增 §7.2,并补 `openFile` options / `FileViewerProps.lineEnd` / peer 说明;
  AGENTS §3、CHANGELOG 双语、README 双语、`docs/plans/2026-11-03-selection-quote-chip.md`
- 测试:`selection-quote` 23、`quote-flash` 13、`line-target` 7,`conversation-draft` +2
2026-11-04 01:47:15 +08:00
CCColastic 9601182720 test(sidechat): verify image input through a real host 2026-11-02 15:19:28 +08:00
CCColastic ba72fc4c9c fix(sidechat): defer image reads until message projection 2026-11-02 14:02:44 +08:00
CCColastic 23a2b61f33 feat(sidechat): accept pasted and selected image prompts 2026-11-02 13:37:43 +08:00
Menghuan1918 bd6cfa55b4 test(e2e): measure the folder-archive flow in the perf audit 2026-10-30 02:14:40 +08:00
Menghuan1918 e9003fc8c0 docs(perf): list the audit gaps (settings UI, live tasks, desktop shells) 2026-10-30 02:02:24 +08:00
Menghuan1918 f1323d6c57 chore(e2e): launch dsh web with --no-open and add the opt-in page/API perf audit 2026-10-30 02:01:47 +08:00
Menghuan1918 edde9de733 docs: record the 2026-10-30 UX PR batch (verdicts, gates, residuals) 2026-10-30 00:31:14 +08:00
OCILY d19a2db423 docs(mermaid): keep the unreleased entries above v0.28.1 and record the review fixes 2026-10-28 20:21:14 +08:00
OCILY aa198d7921 perf(mermaid): keep scrolling and hidden tabs off the render queue
Follow-up to the iframe isolation: after that fix a 31-diagram document
still felt janky while scrolling. The remaining cost was work competing
with the scroll gesture:
- background diagram renders kept running during scroll (each one injects
  an SVG, runs DOM passes and lays out);
- hidden native tabs kept warming diagrams (tab bodies are keepMounted);
- the inline-HTML and heading-anchor MutationObservers ran a full-document
  scan per mutation (measured 8-15 ms per pass, dozens of passes when a
  document swaps its diagrams in);
- initial near-viewport detection read one rect per diagram between DOM
  writes, forcing a layout per diagram;
- off-screen rendered SVGs still participated in layout and paint.

The queue now pauses background work for 350 ms after the last captured
scroll event, and only schedules renders whose preview is visible
(IntersectionObserver gate per preview; hidden tabs keep placeholders and
wake the queue when shown again, and unmounting a preview drops its queued
tasks). The two mutation passes coalesce bursts into one 80 ms pass.
Initial priorities come from one batched rect read before the swap writes.
.mermaidWrap gains content-visibility:auto + contain-intrinsic-size +
contain:layout paint style, so off-screen diagrams leave layout and paint.

Visible diagrams still render on demand, every diagram is still eventually
rendered, and nothing falls back to a code block.
2026-10-28 20:20:49 +08:00
OCILY fe06211775 fix(mermaid): isolate diagram layout in a sandboxed iframe
Mermaid measures every label with SVGElement.getBBox() against a node
appended to document.body, so each measurement flushes the whole host
document's layout. Measured in the live DSH window (15,418 DOM nodes):
59-75 ms per measurement, versus 1 ms in an empty iframe document. One
diagram therefore took 1.5-7.3 s, and a 31-diagram markdown document kept
the renderer main thread blocked for >20 s - long enough for the desktop
shell's surface watchdog to kill the renderer, with tab restoration
turning it into a crash loop. CSS containment on the app root does not
help (59-62 ms); only an independent layout tree does.

Render diagrams inside a hidden sandboxed iframe instead: a self-contained
blob: document (mermaid UMD bundle + a small postMessage protocol, both
inlined by scripts/build-mermaid-frame-asset.mjs) renders each diagram;
the parent only sends/receives and sanitizes the SVG. Diagrams now take
30-104 ms each and 31 diagrams complete in ~5 s in the background, while
the client mermaid chunk shrinks from 7.04 MB to 3.69 MB (minified UMD
replaces the unminified inline bundle).

Also add a shared render queue: visible/near-viewport diagrams first, the
rest filled in on requestIdleCallback with 16 ms main-thread yields between
renders, so every diagram is still rendered (none degrades to a code
block). Fence-line-sized placeholder skeletons reserve height while a
diagram waits. No host-half route changes are needed.
2026-10-28 20:20:49 +08:00
Menghuan1918 e3d32cde42 chore(release): prepare v0.28.2
- bump package.json / dsh.plugin.json / SIDEBAR_SERVICE_VERSION to 0.28.2
- CHANGELOG: v0.28.2 (cold cwd from the stored workspace header) with the
  measured numbers; CHANGELOG_EN mirrors it
- README / README_ZH: install commands and installer args target 0.28.2;
  Recent Updates trimmed to v0.28.2 / v0.28.1 / v0.28.0
- AGENTS + external-plugin-guide: current stable version is v0.28.2
- plan record: 40,157,518-byte session benchmark (1 header read, 0 full
  reads, 3 ms, +0.3 MB RSS; pre-fix 6 calls = 6 full reads, +1.0 GB peak)
2026-10-27 22:58:01 +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 bf5844207b docs(plans): record the e2e reconciliation and the green CI run 2026-10-26 15:46:28 +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 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 8c08758afd merge #956: fix(sidebar): worktree 会话的根选择与地址基准(#947 / #950 / #952) 2026-10-26 15:00:57 +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 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 8c431db740 test(e2e): 断言选区引用落在 composer 里是气泡,不是围栏正文
真机 mount lane 加一段:预览里选中一行 → 点「添加到对话」→ 断言
composer 里出现 path:lines 气泡,且草稿文本不含三反引号。
宿主若不认 reference-insert 事件、退化成纯文本,这条会直接失败。

同时记录设计与两套坐标系(clipboard / detect)的折算规则。
2026-10-24 19:17:42 +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
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
Menghuan1918 787d873a8c fix(tasks): restore graph expansion and configurable branch folding
Reset per-gesture travel before node guards so a preceding background pan cannot suppress the next card click. Index and iteratively lay out graph topology, memoize agent card contents, and project complete settled branches under independent existing-settings preferences.

Keep unknown real workflow catalogs and explicitly opened descendant paths visible. Add regression coverage and real rc.1 browser/baseline validation evidence.
2026-10-23 12:38:23 +08:00
ymac 099128d1b6 merge origin/dev into fix/worktree-root-address-base
四处冲突,都不是「选一边」能了事的:

1) `src/active-worktree.ts` 的头注释:上游这半个月把模块重写了一遍(cwd 解析收敛:
   TTL 15s、在飞去重、三个缓存加 LRU 上界、`working-directory/change` 作为证据边界),
   本分支加的是「工作区内只有同仓库的 linked worktree 才采纳」(#952)。两边都保留:
   一句讲采纳判定,一句讲证据边界。

2/3) `isLinkedWorktree` 一带:上游保留布尔缓存 + 每次探测,本分支把它换成
   `gitIdentityOf`(一次 `rev-parse` 同时给出 git dir 与 common dir,并带自己的缓存),
   由它派生出 `isLinkedWorktree` 与 `isAdoptableTop`。合并后**只留身份缓存**
   (布尔缓存成为同一趟探测的第二份副本,且负结果两边都缓存),`cachePut` 给身份缓存
   补上 LRU 上界,模块头注释的「三个缓存」正好仍是三个。

4) `AGENTS.md`:上游把 §3 整体搬进 `docs/host-contracts.md`(原 §3.4 的 1–12 条按原编号),
   本分支往旧 §3.4 追加了第 13 条(会话地址基准)。取上游的 `AGENTS.md`,把第 13 条
   按新家的体例写进 `docs/host-contracts.md` §B(编号 13 接在第 12 条后),并把四处
   「第 1–12 条」更新为「第 1–13 条」。

顺带:`tests/active-worktree.spec.ts` 的 `rmSync` 导入在上游侧被同一个文件的重排吃掉,
补回。

门禁:typecheck 干净;全量 vitest 2691 passed / 17 skipped / 1 failed(唯一红是既有的
smoke 写 `$HOME` 被本机沙箱 EPERM 拒);`active-worktree` / `worktree-address` /
`native-surface` 70 passed。
2026-10-18 23:19:59 +08:00
ymac 8c3e00ec54 docs(plans): 记录 @ 引用插入展平 chip 的根因、修复、真机断言与「不修清单」
上游不接收 issue,所以把这次查到的宿主行为(手打 mention 只装饰目录前缀、贪婪跨空白把两个
mention 并成一个 token、无空格连打两个 @…/ 会让草稿字符重排)连同根因(setDraft 的契约会移除
inline chip;结构化插入的 span 用错投影导致每次插入都回退到那条破坏性路径)一并存档,避免下次
再从插件侧找原因。
2026-10-18 20:18:37 +08:00
Menghuan1918 66c91091bc chore(release): adapt to DSH 0.2.1-rc.1 for 0.28.0 2026-10-17 14:03:22 +08:00
Menghuan1918 2b8a4da569 chore(release): prepare alpha.0 with latest dev fixes 2026-10-17 12:02:59 +08:00
Menghuan1918 4ebd3e9bdd chore: adapt sidebar to DSH 0.2.1-alpha.5 2026-10-17 02:12:44 +08:00
Menghuan1918 0ba7edf444 fix(git): keep selected change rows inside their groups
Restore selection declarations removed with logRow during graph integration. Dangling selectors had inherited absolute positioning and borders from indent guides. Add parsed CSS and mounted browser regression coverage for staged, unstaged and conflict rows.
2026-10-16 21:45:57 +08:00
Menghuan1918 71c8243a2b docs: Git 页面合并车的 CHANGELOG 段、融合设计文档与接入文档/AGENTS 同步
- CHANGELOG 顶部新增 Unreleased 段(11 个 PR 的逐条说明与贡献者署名);
- 新增 docs/plans/2026-10-16-git-page-vscode-scm-merge.md(决策 D2/D5、被剔除的夹带、
  有意偏差、守住的不变量、未做清单、过程中修掉的三处 CI 红);
- guide:页签名、Source Control 视角、changes.ops 的 wait 长轮询口径、guide 条目名;
- AGENTS §5/§6:内置 tab 名与测试地图补入本批新增/改写的 spec。
2026-10-16 17:31:41 +08:00
Menghuan1918 88ded478de merge pr-969 (#969 feat(git-graph): 只读提交图) into dev(@vlln)
融合(D5):#969 的图谱引擎作为 Git 镜头内的「提交图」区上线,不再新增第三个镜头。
- 保留:src/git-graph.ts(有界路由 + graph-stale/graph-limit)、graph-layout.ts、
  graph.module.css、CommitDetails、DiffPane 的 PaneTabStrip 与 details/content/diff 分签、
  hover 卡片、引用徽章、分支筛选、无限滚动、e2e 与设计文档;
- 落位:GitGraphLens → GitGraphSection(挂在 GitLens 的 Graph 区,目标读镜头自己的
  仓库/worktree 选择,不再自持选择器);行右键接回 #944 的提交菜单(查看/复制/revert/cherry-pick);
- 去掉:第三镜头与 changesGraphLens 键、#944 的 GitGraph.tsx(及随之无消费者的
  log 行样式与 historyLoadError/changesNoHistory 词典键);
- 镜头常驻保留(hidden 切换):Graph 的滚动/选中、Changes 的展开与草稿切走不丢,
  同时 store 槽位与轮询按「可见 + 在屏」分别门控(切回不闪 loading);
- 两套重写过的测试按新契约对齐(底部面板分签、图谱区与 Git 镜头的关系、图行/历史断言)。
2026-10-16 17:30:44 +08:00
Menghuan1918 bd65b41e9d merge pr-885 (#885 fix: 减少 changes.ops 空窗重复请求) into dev(@wang-kaopu)
冲突解决:保留 #885 的路由抽取(src/changes-ops.ts + 'changes.ops': changesOps),
把 dev 的现役内容搬进新模块:PTC 四种事件类型、-1 游标下限、会话/持久化双读与 4000 窗口;
index.ts 的 import 块取 dev(只补 ServerResponse),订阅回调按仓内惯例restate 最小结构切片。
测试:路由 spec 加一条 PTC 事件穿透断言,用例名与注释统一英文。
2026-10-16 16:44:20 +08:00
vlln ab7db3a313 docs(git-graph): 设计文档与 README 章节
`docs/plans/git-graph.md` 记录取舍:为什么第一版只读、为什么分页用不透明游标
而不是服务端游标缓存、为什么**没有**颜色图例(颜色属于泳道而不是分支,泳道可以
比创建它的分支活得更久,图例会暗示一种不存在的一一对应)、连线与徽章的配色
规则、底部面板固定的三个标签、以及 hover / 点击两档信息密度的分工。

README 中英双语各加一节 Git Graph:顶部选择入口、不 checkout / 不 fetch、
单行提交行的构成(徽章含义、✓ 表示当前分支)、统一底部面板的三个标签,以及
资源上限与分页过期的行为。
2026-10-15 20:44:33 -07:00
Menghuan1918 3f7ce178b4 docs: 稳态开销治理设计文档 + CHANGELOG Unreleased + AGENTS §5 硬规则
设计文档收录:产物级 A/B(0.24.1 无这些机制 / 0.25.0 引入 / 0.26.0 未动)、四份
只读审计的结论、microbench 与宿主解析器的实测数字、用户确认的四条决策、实施清单、
落地偏差(可见性来源逐个交代、TTL 与 pathspec 的语义代价、ops-stream 为何选 LRU
而非删除、GitLens 为何用同值保持而非挪早退)、真机 before/after 表、明确未做清单,
以及「本机 dsh 是 Desktop shim,硬写 DSH_HOME,不可用于隔离测量」这条踩坑记录。

AGENTS §5 新增硬规则「稳态开销:周期任务必须先答『它什么时候停』」:可见性门控
(含重新可见必须立刻补刷,且不得停掉事件驱动刷新)、单例归属(绝不按页签/按挂载
body 复制)、有界缓存(淘汰不碰在用项与在飞请求)、宿主路由要按最坏输入估成本。
2026-10-15 23:05:43 +08:00
ymac f826e63658 docs: 地址基准与 worktree 根选择的规则与设计(#947 / #950 / #952)
- AGENTS §3.4 新增第 13 条:会话地址的基准是会话 header cwd,构造端与消费端都
  经 addressBaseOf 取基准、在消费边界解析成绝对路径;工作区内部的 linked worktree
  只有同一仓库(--git-common-dir 相等)才算「会话搬走了」。
- 接入指南 §10 新增同名条目(消费插件自己也解析文件地址时照同一条规则),并补上
  openSidebarFile 的新签名 `{ line?, cwd? }`。
- 新增 docs/plans/2026-10-14-worktree-root-and-address-base.md:三个症状、根因
  (宿主两端自洽 / 插件换基准 / 判定只看拓扑)、口径 A/B 决策表与实测真值表、
  逐文件实施、复现与正式用例、残留(裸相对路径聊天链接属上游 worktree 无感)。
2026-10-14 23:18:15 +08:00
Menghuan1918 751720f4f0 perf(git): 状态轮询基线降到 30 s 并按实测退档;编辑器 gutter 不再持有轮询
一次抓取是 `git status --untracked-files=all` 加两条全仓库 `--numstat`(4 个
进程)。在未忽略的大目录上(嵌套 node_modules、pnpm store——根锚定
`/node_modules` 盖不住子目录那种仓库)实测 59,631 条 / 9.24 MB / 0.131 s,
而 `GIT_STATUS_LIMIT = 2000` 是在整份输出产出、拼进字符串、切成五万多个对象
之后才截断的。三处一起收:

- **编辑器 gutter 不再持有轮询**:它此前把功能开关当作页签可见性传进共享
  store,而那个参数正是启动定时器的开关;原生页签 `keepMounted` 又让编辑器
  切走不卸载,于是打开过任何一个 `code` / `jsonl` 文件之后,整页生命周期都在
  每 2.5 s 跑一次那个扫描。现在订阅改为 `{ visible: active, poll: false }`,
  只在换文件或保存时各 `refresh()` 一次,页签不可见时连订阅都不建立。
- **基线 30 s + 按实测退档**:往返超 750 ms / 2 s / 5 s 依次退到 60 s /
  180 s / 停止自动轮询;tier 是最近一次耗时的纯函数,快响应自动回落,事件
  驱动刷新(暂存、提交、丢弃、保存、手动刷新)永远即时,也是恢复通道。
- **空闲轮询不再通知**:`notify()` 原先无条件自增 `slot.version`,而它就是
  `useSyncExternalStore` 的 snapshot,于是每个消费者每 tick 整体重渲染一次
  (文件树那一列逐行重算 git 状态也在其中),即便数据一字未变。
- **linked-checkout 清单改单命令计数**:变动页的 worktree 选择器每 30 s 为
  每个 checkout 跑一次完整 `status()` 只为读条目数,现为一条轻量
  `status --untracked-files=normal`。一处刻意的语义变化:未跟踪目录计 1
  (此前展开计入每个文件,且数字被 2000 上限悄悄截断)。

消费方 API 零变化;`FileViewerProps` / `ctx.betterSidebar` 均未动。文件树与
文件变动页的条目与配色语义不变,只是刷新节奏变慢。

测试:新增 `tests/git-status-poll.spec.tsx`(7 例,含「非轮询消费者不得启动
定时器」「空闲同结果不通知(snapshot 恒等)」「慢往返退档与快响应回落」);
`tests/editor-git-gutter.spec.tsx` +3;`tests/git-worktree.spec.ts` +1;
`tests/git-view-worktree.spec.tsx` 的计数重发布用例跟着新节奏推进假时钟。
判别性已逐条实测:回退空闲守卫、`poll` 归属、gutter 的 `poll: false`,
对应用例当场红。

设计、实测数据与普查后续项见
docs/plans/2026-10-13-git-poll-ladder-and-idle-notify.md。
2026-10-13 13:12:00 +08:00
Menghuan1918 4fe8b8a054 perf(filetree): 折叠链预加载与渲染共用 32 链上限;fs.trees 整批共享一个探测预算
核查用户列出的性能断言后,两处「真实存在」的放大被收敛(其余项按用户选择不动,
逐条结论与不做的理由见 docs/plans/2026-10-13-file-tree-perf-fold-preload-and-probe-budget.md)。

- 客户端:compactLoadTargets 改为从渲染根(cwd + expanded)沿 compactChain 下行,
  上限天然继承 MAX_COMPACT_DEPTH。此前它扫描所有已加载层:渲染在 32 停手,预加载
  却继续请求第 33、34… 节,每节一次串行 POST 加一次全树 render。顺带订正
  MAX_COMPACT_DEPTH 上方「健康缓存永不触及」的不准确注释(合法深链会触及;
  循环守卫是 compactChain 的 visited)。
- 宿主:新增 PROBE_BUDGET / ProbeGate / createProbeGate,listDirectory 增加可选
  gate 参数(只在真实 fs 探测外层取槽,缓存命中不花),fs.trees 每请求建一个 gate
  传给它的所有层。此前 64 路径 × 每层 32 路可同开约 2048 个 opendir;单层与
  fs.tree 单路径行为逐字不变。

测试:新增 tests/fs-tree-probe-gate.spec.ts(gate 在飞上界 / 排队任务抛错后释放且
FIFO / limit<1 夹紧;listDirectory 每个目录探测恰花一槽、缓存命中不花;三层共享
一个 gate 计 9 次);file-tree-compact(-fold) 新增「到上限即停」用例(把实现回退
即变红,判别力已实测);smoke 增加「一次 fs.trees 只建一个 gate」的路由级断言。
不动虚拟化、watch 提示与全局句柄、DirRow chain identity。
2026-10-13 00:36:19 +08:00
Menghuan1918 1be21965f3 merge origin/dev into feat/bottom-terminal-multi-tab(#926 多终端 Tab:合上 dev 并修掉「新建终端」丢实例)
dev 侧(#924/#925 之后)把底栏终端的身份收敛成**一个值**:`view(sessionId, key,
contentId)` 的 key 与 contentId 同源,`bottomTerminalKey` 已被删除,`TerminalView`
与 `closeBottomTerminal` 都只看 `bottomTerminalContentId(run)`。冲突按「保留 dev 的
结构 + 把 instance 穿进去」解开:不再恢复那个重复的 helper,实例前缀拼在 run 后缀之前。

**并修掉一处会让多终端串台的缺陷**:`nextTerminalMeta()` 原来只回 `{ terminalRun: run+1 }`,
而 `patchTab` 是**整份替换 meta** —— 于是点过「新建终端」的 tab 会丢掉 `terminalInstance`、
掉回旧命名空间,两个都换过进程的 tab 撞在同一个 `…terminal-bottom#1` 上;宿主按
`(sessionId, key)` 记忆 model,两个 tab 会拿到**同一个 shell**。现在实例随 run 一起保留
(没有实例的旧 tab 仍然不长出实例,身份逐字节不变)。

测试:`tests/terminal-tab.spec.tsx` +3 判别性用例(实例跨 bump 保留 / 两个实例各自 #1
不撞 / 两个实例渲染出两个宿主终端)与关闭钩子的带实例断言;把 `nextTerminalMeta` 退回
旧写法即红(实测 2 failed)。设计文档标注「一个终端」的限制已放开,CHANGELOG 补条目。
2026-10-12 16:40:18 +08:00
Atlas Zeng 963bef89f0 Merge pull request #912 from UNscientific-9/fix/native-tab-path-reconcile
fix(tabs): 改名/删除的页签调解覆盖右侧栏原生页签,并让改名不再重载文档
2026-10-12 01:40:02 +08:00
Atlas Zeng 5ad37728bc merge #925 into dev(侧边对话:实时推送 + 排队可见 + per-thread 模型选择 + 底栏重构)
真机复现取证后的四项修复 + 底栏与主会话对齐。三闸门全绿(ci / ci-windows / plugin-mount)。
2026-10-12 01:09:54 +08:00