Commit Graph
235 Commits
Author SHA1 Message Date
Menghuan1918 5575ee29b9 docs: record the contributor batch, rc3 evidence and release dependency slim-down (#1115 #1130 #882 #1191) 2026-11-16 00:49:08 +08:00
Menghuan1918 0441249314 feat(sidechat): make the native page mode configurable (#1115)
Keep the contributor independent-page implementation, but make it opt-in: the default is still one shared page with the session last/newest reattach, and Settings -> Side card -> Side chat can switch to one native page per thread. The descriptor gains a dynamic multiple predicate, native sync re-registers on a flip, and occurrence bindings are read/written only for sidebar://sidechat/<uuid> contentIds so the shared page can never be captured by an old binding.
2026-11-16 00:47:59 +08:00
peng xiang ba6f3a3423 fix(sidechat): preserve independent native tabs and exact thread bindings 2026-11-16 00:39:39 +08:00
Menghuan1918 e6f1af2f82 chore(dsh): 适配 DSH 0.2.2-rc.2 并补齐插件页图文详情(v0.32.1) 2026-11-12 21:20:46 +08:00
Menghuan1918 ba7d069842 fix(preview): render data images and self-contain desktop HTML previews
Markdown syntax now passes data:image/* through the image vocabulary (the host allowlist already accepts it); every other data payload stays inert. The desktop shell's sandboxed HTML preview is self-contained: the trusted top frame fetches the document and its same-origin assets, inlines them, and frames a sandboxed blob instead of a dsh-app route the shell rejects from an opaque subframe. The sandbox never gains allow-same-origin; browser and explicitly-unsandboxed paths are unchanged.
2026-11-11 21:28:39 +08:00
Menghuan1918 77cbf420ce merge #1043: fix(editor) resolve markdown preview images on the page base
# Conflicts:
#	src/client/markdown-images.ts
#	src/client/markdown-labels.tsx
#	src/client/markdown-navigation.ts
#	tests/markdown-images.spec.ts
2026-11-08 00:19:09 +08:00
Menghuan1918 c67a8d1aa8 merge #1139: fix(tasks) read the team roster from subagentCatalog
# Conflicts:
#	CHANGELOG.md
#	CHANGELOG_EN.md
2026-11-08 00:17:14 +08:00
榆乾 b6c2017410 fix(tasks): 团队名册改读 subagentCatalog,适配 agentTeam 去掉 members 后的投影
DSH 0.2.2 的 `agentTeam` 投影不再携带 `members`(Team 包迁移 122dc3af42,wire
schema 只剩 `enabled` / `tasks` / `failure`),团队成员改为 Lead 的直接
subagent,由 `subagentCatalog` 提供。此前 team-projection.ts 仍读
`team.members.map(...)`,`members` 为 undefined 时整个任务管理页抛
"Cannot read properties of undefined (reading 'map')"。

- 名册 = Lead 行 + Lead 的 subagentCatalog 行(名字取 name ?? label ?? id)
- 投影新增 `enabled`:为 false 时不画团队板;旧宿主没有该字段时视为启用
- roster 的 phase 与 per-member error 随投影一起消失,节点状态只剩 running / idle
- 任务归属额外接受空串路径(Lead 自身的 agent path)
- CHANGELOG(中/英)+ docs/plans 适配记录

🤖 Generated with [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
2026-11-06 11:01:50 +08:00
unsc9 a9c2ff0fce 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 353a234cf4 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 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
Peng Li 33f35c79f0 fix(editor): resolve markdown preview images on the page base so the desktop shell renders them
The desktop shell serves the GUI from the dsh-app://app/ origin while the
Host listens on another site (__DSH_TRANSPORT__.streamBaseUrl). Markdown
preview images were rewritten to an absolute /sidebar/file URL on that
TRANSPORT origin, so from the shell page the request was cross-site: the
Connection fence rejected it (403, Sec-Fetch-Site + a SameSite=Strict
session cookie the shell never forwards for plain http subresources) and
MarkdownText fell back to the image's alt text. Disabling the plugin
worked because the built-in document preview resolves images against the
page base.

Resolve local markdown images through the renderer's pathImages vocabulary
on the PAGE base instead of pre-rewriting destinations: in a browser the
plugin media route stays byte-for-byte what it was, and in the desktop
shell the vocabulary maps to the Host's authenticated api/file route
(dsh-app://app/api/file?...), the only local-file shape the renderer
accepts from that page and the same shape the built-in document preview
uses. Images stay plain <img> elements, so the preview keeps the size the
browser/built-in previews have (no chat thumbnail cap or lightbox chrome).

The host file route requires an ABSOLUTE path (a relative one answers
400 "absolute path required"), while an editor tab opened from a chat
address can carry a workspace-relative path (the plugin's own media route
resolved that via its cwd parameter). The desktop branch therefore joins
the session workspace root before building the URL, and falls back to alt
text when no root is known instead of requesting a guaranteed 400.

Raw HTML <img src> leaves keep the direct rewrite, now also page-based.
Image references stay as authored, so the link pass leaves an
image-referenced definition alone (a link-only definition is still pinned
inert).

Regression coverage renders the real MarkdownText in jsdom with the
desktop page origin (markdown images must render as
dsh-app://app/api/file?..., raw-HTML images as dsh-app://app/sidebar/file...,
not alt text) and pins the relative-tab-path → absolute-target rule.
The http-page assertions are unchanged.

Design notes: docs/plans/2026-10-23-desktop-markdown-media-base.md
2026-10-23 17:03:58 +08: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