Commit Graph
361 Commits
Author SHA1 Message Date
unsc9 47a7ffc888 fix(floating): 修正控件带通知与无带子时的布局偏差
viewport-inset 的快照原本是 { top } 对象,重读时每次新建,引用比较永远不等:
带子存在时每次 resize / geometrychange 都会广播,三个浮层各重渲染一次。改为
直接存数字,值不变就不通知。

AnchoredPopover 新增的让位原本无条件执行,普通浏览器里锚点贴到视口最顶时
弹层会从 6px 变 8px,与「无带子时逐字等价」的承诺不符。改为只在带子存在时
才抬高。

顺带删除 mermaid 工具栏里恒被内联样式覆盖的 CSS top(不跑 JS 时该弹层不存在,
不是降级),并补上测试:同值不广播、resize 兜底、visible 运行时翻转、浮窗
高度让位、AnchoredPopover 三个位置用例。

文档:接入指南的 WCO 例外改标「尚未发布」(v0.29.0 从未发布到 npm),计划
文档修正 #430 对照表与测试清单。
2026-11-05 13:16:39 +08:00
unsc9 d0fdd0e77e docs: 记录原生窗口控件带让位的设计、接入指南例外与变更日志 2026-11-05 13:16:39 +08:00
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 91a5d79f19 merge #1072/#1071: fix(editor) 原生页签关闭与桌面退出保留未保存草稿(宿主无确认钩子,改草稿备份 + 重开恢复)
# Conflicts:
#	CHANGELOG.md
#	CHANGELOG_EN.md
2026-11-04 21:06:04 +08:00
Menghuan1918 cafb73b21b merge #1109: fix(sidechat) 压缩 seed 里重映射 delivery 水位线,不再产出不可读的子会话日志
# Conflicts:
#	CHANGELOG.md
#	CHANGELOG_EN.md
2026-11-04 21:05:59 +08:00
Menghuan1918 4224c78a98 fix(editor): 原生页签关闭与桌面退出保留未保存草稿(#1072 / #1071)
宿主原生页签条的关闭路径只有一个同步清理钩子(唯一的阻止方式是 throw,
会把异常抛给 replaceTab / 公共 close() 调用方),桌面 Cmd+Q 则完全在壳内
完成(before-quit → app.exitRequested),页面没有可取消事件;壳内也没有
will-prevent-unload 处理器。插件因此不伪造拦截,改为降低损失:

- 草稿变脏时按 1 s 节流把实时文档写入 localStorage(sessionId::path,
  单条 200k 字符 / 总计 600k / 最多 8 条 FIFO)
- 原生 registerCloseHandler('editor') 与 beforeunload 时立即 flush
- 重开同一文件提示恢复;保存、确认丢弃、确认刷新/换文件即删除备份

新增 src/client/editor-draft-backup.ts;docs/host-contracts.md §C 记录宿主
限制与将来的接法。测试:新增 editor-draft-backup.spec.tsx(8 例)+ guard
spec 2 例;去掉任一修复点后对应用例均转红。
2026-11-04 21:04:16 +08:00
Menghuan1918 4c1d4177d9 fix(install): 装完先查 profile 自带的宿主包是否混版(#1107)
profile 自带的 @deepseek-ai/dsh-* 会覆盖宿主安装的同一批包(DSH 的 profile
解析先取 profile 前缀内的副本),本插件静态 import 的 dsh-subagent 因此绑到
混搭版本;混版缺导出时宿主只报 DesktopHostFatalError / required plugins did
not activate,看不到是哪个包缺了什么。

新增随包发布的 scripts/check-profile-host-tree.mjs:按 DSH 的 profile 解析
规则(只看 profile 前缀内的副本、上级 profiles/node_modules 不参与)判定
dsh-subagent 精确声明的 dsh-attachment peer。install.sh / install.ps1 装完
运行它,混版时打印两份版本号与修复命令并退出,不再提示重启。README 常见
问题、docs/host-contracts.md 与中英 CHANGELOG 同批记录;新增
tests/install-host-tree.spec.ts 真跑发布脚本钉住行为。
2026-11-04 21:03:54 +08:00
Menghuan1918 45b4d42ef6 fix(sidechat): rebase inherited delivery watermarks in the compaction seed
A side thread opened while the parent was mid-turn could persist a child
session the host can never read again: SessionFormatError "delivery
throughSeq must precede its marker".

Root cause: when the parent has compacted, buildSidechatInheritance copies
the log around its last checkpoint with RENUMBERED seqs, but the inherited
session-log-deepseek/delivery-accepted watermark (throughSeq) is an
absolute seq. Left alone it keeps pointing at the parent's position and
can land at or after the marker's own new seq, which the v4 reader treats
as corrupt; the parent's includeDescendants export then fails with it.

The rebase now carries the watermark through the same map it applies to
every other seq citation, and drops the record when the watermark fell
inside the dropped span (there is no child-side equivalent). The verbatim
full-copy path is untouched — seqs are identity there, so nothing changes.

Tests: tests/sidechat-compaction-seed.spec.ts builds a compacted parent
carrying real delivery markers and asserts every surviving marker cites
the same earlier event the parent marked, while markers whose watermark
was trimmed away do not survive (red before the fix: throughSeq 15 for a
marker at seq 8).

Closes #1109
2026-11-04 20:59:08 +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 45b538283d merge #1099: feat(sidechat) 支持粘贴/选中图片(合入前修正:大 body 才计入准入、宿主附件错误分类、文档与常量收敛)
# Conflicts:
#	CHANGELOG.md
2026-11-04 20:47:47 +08:00
Menghuan1918 30093748a2 docs: 同步 14 条 DSH peer,修正 chip 底部入口与行号漂移说明 2026-11-04 20:46:52 +08:00
Menghuan1918 9c64e43e08 docs: move the side chat image section under the API chapter
The section was nested under the removed free-window chapter; it now sits after the archive routes as 6.2, drops the false claim that the image-remove control is the host Button, and points the connection-admission references at section 6.
2026-11-04 20:45:25 +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
Kunping Wang 3ce803c691 fix(changes): 修复 Changes 视角切换按钮样式 2026-11-02 20:57:24 +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
Menghuan1918 d77adf25e3 merge fix/1009-card-toggles: hidden tab types are not settings cards (#1009) 2026-10-29 23:53:10 +08:00
Menghuan1918 15b51ca55e fix(settings): stop inventorying programmatic-only tab types (#1009)
Hidden tab types (the built-in diff page, dsh-remote's dsh-remote:file)
have no + menu row and no native guide entry, yet the side-card inventory
still gave them an enable switch. Turning one off changed nothing in the
sidebar and only made openTab silently refuse that type - which the
reporter saw as "remote:file cannot be turned off / git:diff does
nothing", and dsh-remote saw as "remote files stop opening".

- SideCardSection: the inventory skips hidden types (the count badge
  follows); tabOrder becomes the order-only tabInventory.
- service.isTabEnabled: a hidden type is always enabled, so a
  tabsEnabled[id] = false written by an older build cannot keep refusing
  its programmatic opens.
- docs/external-plugin-guide.md and CHANGELOG describe the contract; the
  two new specs fail on the previous code.
2026-10-29 23:48:23 +08:00
Menghuan1918 dcd5cf66b1 merge fix/1014-panel-host-dvh: use 100dvh for the panel host (#1014) 2026-10-29 23:45:22 +08:00
Menghuan1918 eb7edb0818 fix(panel-host): 宿主高度改用 100dvh 回退 100vh,修掉手机端整页可拖动(#1014)
`height: 100vh` 取的是大视口:手机浏览器地址栏展开时该层比布局视口
(innerHeight)高,挂载自检把 rect.height 与 innerHeight 的差值当成页面级
transform,降级为 position:absolute 后高度计入文档并持续触发自检,整页可
上下拖动且不自愈。dvh 跟随动态视口(即 innerHeight),声明在 vh 之后;
不支持 dvh 的引擎在解析期丢弃该行、保留 vh,即 #616 的修复不变。

tests/panel-host-css.spec.ts 把高度声明整表钉为
['height: 100vh', 'height: 100dvh'],级联顺序即契约。
2026-10-29 23:44:40 +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
taekchef cd1251be2d feat: prepare Sidebar 0.29.0 GenUI provider release 2026-10-28 14:48:08 +08:00
taekchef 60c3fff158 merge: integrate Sidebar provider PR #1033 with current dev 2026-10-28 14:40:13 +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
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 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 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 5bacf5fa0c 修复提交图标签缺失并校验标签分页快照 2026-10-26 15:19:02 +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
Menghuan1918 22eb6ebddf merge #929: fix(tree): 改名/删除的调解覆盖后台会话的页签 + 标题只在派生自文件名时跟随(#915 后续) 2026-10-26 15:00:55 +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 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
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