Menghuan1918
a0cfd30b48
chore(release): v0.25.0 —— 支持线前移到 DSH 0.2.0-rc.2(npm latest)
...
- 版本 0.24.1 → 0.25.0;CHANGELOG 的 Unreleased 段落成 v0.25.0。
- **支持线**:peer 下限 `^0.2.0-rc.1` → `^0.2.0-rc.2`,CI 与挂载 lane 的钉版同步 →
`@deepseek-ai/dsh@0.2.0-rc.2`(`latest` 现在正是这一版),31 个 `@deepseek-ai/*`
devDependencies 与 lockfile 同批抬到 rc.2,`dsh.plugin.json` 的 engines 同步。
- **0.2.0-rc.1 及更早(含 0.1.7 线)请固定 v0.24.1**:caret 范围跨不过预发布元组,
`^0.2.0-rc.2` 对 rc.1 判定为 false,会被宿主启动预检整行静默禁用。
- 文档同步:AGENTS §2/§3.0、README / README_EN 的徽章与支持线、接入指南的活跃提法
(历史发布记录与 docs/plans 里的 rc.1 保留原样,那是记录不是声明)。
- 本版内容与贡献者致谢见 CHANGELOG 的 v0.25.0 段。
门禁:rc.2 上 typecheck / lint 干净,全量 189 文件 2213 通过(唯一红是
`fs-watch.spec.ts` 真起 fs.watch 的并行负载 flake,单跑 6/6 绿,与本版无关)。
2026-10-10 01:16:38 +08:00
Menghuan1918
45285014d9
merge fix/826-file-link-line-jump into dev(#826 第二半:行号不再被解析完就扔掉。两种写法合流到同一个字段——#L131 由宿主解析成 navigation.params.line、path:131 由插件在 path-line.ts 切出,都落到 SidebarTab.line,再经 FileViewerProps.line 交给 viewer;TextEditor 到达时定位一次并高亮,越界钳到最后一行,区间只取起始行。line 是瞬态(sanitizePersistedTab 白名单不含它,刷新不把读者拽回旧行);markdown/html 收到行号先强制切到编辑态再定位,避开预览自己的挂载滚动恢复。公开面是纯增量:FileViewerProps.line?: number)
...
# Conflicts:
# docs/external-plugin-guide.md
2026-10-08 22:20:45 +08:00
NolanHo
0d9fee85b8
fix(fs-search): direct-open for pasted paths + fragment path matching ( #879 )
...
A query carrying a path separator can never match an entry NAME — names
never contain separators — so pasting any path into the search box was
structurally guaranteed to return {matches:[],truncated:true} while the
walk burned its full 100k-visit budget (measured: 1.9s on a Rust repo
whose two worktree forests alone held 97k entries; real directories were
never reached).
searchFiles now routes by query shape, all three modalities sharing one
result contract:
- A query naming one path (absolute, ~/…, ./x, ../x) resolves through
resolveTarget — the SAME primitive fs.read uses, so ~ expands (#713 ),
dot-anchored spellings join onto the session cwd, and win32
WSL/dsh-remote namespaces reinterpret — then stats the target. The hit
is the RESOLVED path (resolve() strips shell-completion trailing
separators, which the client's exact-string row comparisons could never
match); a missing target answers empty immediately. Directory targets
ride the #801 dirs contract. The exclude pref does not apply: a pasted
path is explicit intent, same as the fs.read the click performs.
- A separator-carrying relative fragment (records/exp1) matches by
root-relative PATH in the walk; the engines are name matchers (fd has
no --full-path here, rg's globs are single-segment) so argv
construction is untouched.
- Plain name queries are unchanged, and no NAME query is stolen: on
POSIX a backslash is a name character (the ~\ gesture counts only on
win32; util.ts~ / ~$doc.docx / .env stay name queries).
SKIP_DIR_NAMES gains the budget-eating forests seen in the wild:
.worktrees/.worktree (git worktree layouts), target, venv/.venv and
__pycache__ — shared by the walk and both engine argvs as before.
Client: a directory hit OUTSIDE the cwd (newly reachable via the paste
branch) only clears the query — the tree is cwd-rooted, and the old
ancestorDirs call synthesized junk expanded entries for foreign paths.
Verified: vitest fs-search/smoke/search-persist suites green; full run
2171 passed with one failure proven pre-existing on the clean tree
(git.spec checkout case, host git lacks --end-of-options; #841 );
typecheck/lint clean.
2026-10-06 08:25:30 -07:00
Menghuan1918
34ce191981
docs: 修正 #855 的用例数、脏态出口口径与轮询叠加口径
...
- **[硬数字]** CHANGELOG 的 `tests/editor-auto-refresh.spec.tsx` 用例数
11 → 14(原本就少 1,加上本批新增 2 例);同批核对:既有 #167 的 4 条、
2.5s 节奏、「N 个编辑器 tab 每 tick 1 个请求」均属实。
- **[用户可见承诺]** 删掉「dirty / 编辑态由既有的『编辑 → 预览』边沿补刷」
这句不成立的话:该边沿**自身带 dirty 守卫**(`EditorHost.tsx` 的边沿判定
要求 `dirty !== true`,`tests/editor-refresh.spec.tsx` 的 B 例两半都钉住了:
干净时 fsRead 1→2,dirty 时仍是 1)。按事实改写为:未 dirty 时点页头
「预览」会重载并拿到新内容;dirty 时该边沿被抑制,真正的两条出口是**页头
刷新按钮**(`window.confirm` 后重载)与**「保存 → `fs-conflict` 横幅的
reload」**(保存带 `mtimeMs` 基线,不会静默覆盖模型字节)。结论句:dirty
期间保持旧内容直到用户显式动作,**不存在看不到新内容的死路**。指南 §5.2、
指南行为差异表、CHANGELOG、设计文档 §4.2 四处同步。
- **[叠加口径]** 同一会话同时开着文件变动页(会话透镜)与编辑器时,该会话
每 tick 是 **2 个** `changes.ops` 请求——「每 tick 1 个」只算编辑器这一份。
一次性探针实测:会话透镜单独 1/tick、编辑器单独 1/tick、两者同开 2/tick
(记进 CHANGELOG、指南行为差异表与设计文档 §4.1)。
- 设计文档 §5/§6 的用例数与门禁数字同步为本次实测(184 文件 2152 通过 /
13 跳过 / 0 失败)。
2026-10-06 00:55:52 +08:00
Menghuan1918
1748c7b0d4
feat(editor): LLM 改完文件后自动刷新正在看的预览(#855)
...
模型在会话里 write/edit 一个正开着的文件后,侧栏里仍是旧内容,只能手点刷新或
关掉重开——加载 effect 的依赖里没有任何一项会因写盘而变化,keepMounted 又让
切走再切回不重挂。
信号源用插件自有的 `changes.ops` 增量流(宿主按 seq > afterSeq 下发 tool/call +
tool/result,客户端折成文件操作),不新增第二个轮询机制:没有 fs.watch,也没有
任何周期性的 fsRead 指纹轮询。
- 新增 src/client/ops-stream.ts:每会话一条流 + 成员选举一个 leader,只有 leader
跑 usePolling(self-scheduling,2.5s,与文件变动页会话透镜同一路由同一节奏)。
一个会话开 N 个编辑器 tab 每 tick 仍只有 1 个 changes.ops 请求;成员全部离开即
停轮询但保留游标与已发布状态,页签回来时补折离开期间错过的增量。
- 只发布结算成功的 write/edit(running === false && !isError);第一帧是基线,
打开前已结算的写入一律不触发。
- 命中判定 fileOpKey(cwd, path):resolveSidebarPath 归一相对路径 + `.`/`..` 词法
折叠 + 分隔符统一 + Windows 盘符/UNC 大小写折叠。
- EditorHost:命中且非 dirty、非编辑态时 setReloadSeq(+1)——复用页头刷新按钮那条
完全相同的加载路径,手动入口原样保留。脏态优先:dirty 时绝不覆盖用户输入。
测试 tests/editor-auto-refresh.spec.tsx(12 例,jsdom + 假计时器),逐条做了
「还原源码即红」的变异验证;#167 的既有 4 条未改动。
docs:接入指南 §5.2 与行为差异表、CHANGELOG、设计文档。
2026-10-06 00:34:42 +08:00
Menghuan1918
e4a4c3fa4c
merge origin/dev into feat/774-terminal-tab(#774 收尾前置)
...
dev 前进 12 个提交(titleBar 让位机制整体移除、#132 新建文件与排序三档、
#817 后台激活改标记未读、#412 Windows「在应用中打开」候选链等)。两处冲突,
都是「双方各自新增的内容」,无实质取舍:
- CHANGELOG.md:Unreleased 保留双方条目。#774 一组在最上(本分支的新条目),
其后是 dev 的「移除 titleBar 让位机制」「#132 新建文件 / 排序」一组,再往下
是既有的 #109 / #203 一组(与文件里原有的空行分组一致)。
- tests/e2e/mount.e2e.ts:只在下一条用例的标题行冲突——保留本分支新增的底部
终端用例(#774),标题取 dev 侧的新名(`a shell-stamped render URL mounts
normally; …`;dev 已把 WCO / preset 两条场景删掉)。
- 21 份词典、AGENTS.md、docs/external-plugin-guide.md、README 自动合并:dev 删的
12 个 titleBar 词典 key 保持删除,本分支新增的 3 个 terminal 词条保持新增。
2026-10-06 00:07:23 +08:00
Menghuan1918
2f66c921df
docs: 同步 #774 的接入契约、设计文档与内置清单
...
「接入 API 即文档」:src/client/service.ts 与 src/client/builtins/ 变了,
唯一权威接入文档必须跟着变。
- docs/external-plugin-guide.md:`bottomOnly` 全字段说明(含与 `hidden`
的区别、`openTab` 落点改道、为什么不注册原生承载面);承载面表把
「终端(已交还宿主)」拆成三条——宿主一条 + 插件底部一条(彼此独立)、
`bottomOnly`、底部终端的恢复语义;`target: 'side'` 行补上唯一的例外;
guide 条目行补「`bottomOnly` 同样不占行」;§4.4 内置清单加
`terminal-bottom` 行(5 → 6)。
- docs/plans/2026-10-05-bottom-terminal-tab.md:设计文档。五条已定决策、
从装好的钉版包里读出来的宿主契约(含 view() 的 createWhenMissing 分支、
SnapshotStore、帧协议、issue 枚举)、三条恢复语义的由来、降级矩阵、
证据清单,以及**未验证项**(真 Windows / 真浏览器观感 / 本轮是否跑过
真实挂载 lane)。
- README.md / README_EN.md / CHANGELOG.md / AGENTS.md:内置 5 tab → 6 tab
的计数同步(README 的终端行与排障行补上底部终端与它的失败模式)、
Unreleased 词条、AGENTS 的 chunk 名清单与关键测试守护条目。
2026-10-05 23:42:49 +08:00
Menghuan1918
85c7d12785
chore(shell): 删除 titleBar 让位机制及全部相关配置(#430)
...
插件自 v0.19.0 起不再自绘顶部 chrome:`223b254` 把那三条读 strip 的规则
(`top: calc(var(--dsh-title-bar-strip, 40px) + 3px)` / 右面板
`padding-top: var(--dsh-title-bar-strip, 40px)` / 折叠态 `+14px`)连同自绘
chrome 一起删掉了。此后「位置兼容模式」四方案仍在写
`--dsh-title-bar-strip` + `body[data-dsh-title-bar-compat]`,但**没有任何
消费者**:`src/**/*.css` 零命中,宿主也不读这条契约(DSH 核心整树 grep
`windowControlsOverlay|dsh-desktop-titlebar-inset|titlebarInset|
title-bar-strip|title-bar-compat` 与 `desktopWindow` 全部零命中)。结果是
用户改设置只写变量、什么都不动,而设置项描述(「标题栏条带高度:侧边栏
按钮与内容下移的像素数」)与现实不符。整套删除,不留兼容层。
删除范围(先做了完整消费者普查,见新增的设计文档):
- 计算与写入:`src/client/titlebar-strip.ts`、`src/client/wco.ts`、
`src/client/shell-presets.ts` 三个文件整体删除;`Sidebar.tsx` 里的 strip
计算 + 写 `--dsh-title-bar-strip` / `body[data-dsh-title-bar-compat]` 的
effect 与 `titleBarCompat` 局部量一并清理。
- 壳信号:`desktop-env.ts` 的 `parseDesktopEnv` / `DesktopEnv` /
`probeDesktopWindow` 与 `context-types.ts` 的 `SidebarDesktopWindowService`
(含 Insets / DragRegion)删除。#864 新增的 `desktopWindow` 优先读取随之
消失。**`desktop-env.ts` 文件保留**:同文件的 `hostTransportBase()` 另有
3 个消费者(`host-route-url.ts` / `TextEditor.tsx` / `changes/DiffPane.tsx`),
是反向代理前缀与 `dsh-app://` 自定义 scheme 的解析基准,与本机制无关。
- 配置:`titleBarScheme` / `titleBarPresetId` / `titleBarCompat` /
`titleBarStripPx` 及 `TITLE_BAR_STRIP_{MIN,MAX,DEFAULT}` / `TITLE_BAR_SCHEMES`
/ `TitleBarScheme` / `clampTitleBarStrip`(`prefs-shared.ts` 的字段与默认值、
`config.ts` 的 schema 字段、`client/prefs.ts` 的读迁移逻辑)。
- 设置界面:常规行的方案下拉 + 「自定义方案」齿轮弹窗 + `titleBarSchemeValue`
/ `onSchemeSelect` / `detectedEnv` / `stripSettingsOpen` 全部删除;
**自定义 CSS 逃生口保留**,搬到独立的「自定义 CSS」分组,并去掉 scheme
门控(非空即生效)。`SideCardSection.module.css` 的死样式 `.rowGear` 同步删。
- 词典:21 份(`locales.ts` 的 zh + en 与 19 个 `locales-*.ts`)同步删除 12 个
只服务这些设置的 key(`settingsTitleBar*` / `settingsScheme*` /
`presetDshDesktopDesc`);`settingsCustomCssPlaceholder` 的示例改为
`[data-dsh-bottom-panel]` + `--dsw-font-mono`,不再引用已删变量。
- 文档:指南 §12.1 重写(删四方案 / strip 取值链 / 壳信号 / 迁移,保留用户
空间 CSS 与两条拖拽区退出)、§7 的 `toggles` 键清单、AGENTS §5 皮肤契约与
「契约反向引用」;新增 `docs/plans/2026-10-05-remove-titlebar-compat-strip.md`
记录普查结论与去留理由。`docs/plans/` 的历史文档未改。
迁移安全(旧偏好数据被安全忽略):四个已删键在 OPEN 的宿主 schema 里是未知键,
解析不报错、不写回(`plugin-shape.spec.ts`);客户端 `parsePrefs` 只按声明字段
构造结果,旧键不进入 UI(`prefs.spec.ts`);一次性 `settings.yaml` 回迁按
`Config.dict` 的声明字段过滤,已删键被丢弃而非转发(`smoke.spec.ts`)。
三条新断言都做过变异证伪:让 `parsePrefs` 透传原记录 / 让 schema 重新声明
`titleBarCompat` / 去掉回迁的声明字段过滤,对应用例分别红在
「不要带上已删键」「解析结果不得含该字段」「回迁不得保留该键」。
测试:删除 `tests/titlebar-strip.spec.ts` / `wco.spec.ts` /
`shell-presets.spec.ts` / `desktop-window-strip.spec.tsx` /
`desktop-env.spec.ts`(五个文件断言的行为已整体移除,不留断言已删行为的测试);
`prefs.spec.ts` / `plugin-shape.spec.ts` / `smoke.spec.ts` /
`side-card-section{,-rows}.spec.tsx` 的夹具与断言改写;`mount.e2e.ts` 删掉 WCO
与壳预设两个场景,URL 戳记场景保留挂载与拖拽区断言、只删 strip 断言,
自定义 CSS 场景改为只写 `customCss`。
门禁:`pnpm typecheck`(0 错误)/ `pnpm lint`(0 问题)/
`pnpm exec vitest run --maxWorkers=3` —— 179 文件 / 2075 passed + 13 skipped
(删除前基线 184 文件 / 2117 passed + 13 skipped;差额 = 5 个被删 spec 的
41 条 + `prefs.spec.ts` 净减 1 条)。词典 parity(`locales.spec.ts`)与皮肤
契约(`theme.spec.ts`)均绿。
2026-10-05 23:38:04 +08:00
Menghuan1918
f894786e1f
fix(sidebar): 补齐 #817 的两条设置项文案(zh 写成了英文、en 未改)+ 同步接入指南
...
复核节点在 de1e76e 上实测出三处必修项,本提交逐条收口(行为零改动):
- R1(用户可见回归):`locales.ts` 的 **zh** 词典里 `settingsSubagentDesc` /
`settingsJobsDesc` 被写成了**英文**句——紧邻的 `settingsSubagentTitle` 仍是
中文,`active: 'zh'` 下这两行设置项直接显示英文。现改回简体中文,内容与已改
好的 zh-TW / zh-HK / zh-MO 三份对应(页面仍创建 + 未读红点 + 不抢焦点 +
关闭后不再自动创建)。
- R2(同根、写反的另一半):**en** 词典的这两条**根本没改**,仍是旧行为原文
("Activate the Tasks page when…"——而现在的行为恰恰是不接管)。现把 de1e76e
写进 zh 的那两句英文挪到它们本该在的 en 上。
- R3(违反 AGENTS §5「接入 API 即文档」):`docs/external-plugin-guide.md` 补上
本次新增的两个公共 API——`OpenTabSeed.reveal?: boolean`(§7 的 seed 接口块)
与 `BetterSidebarService.clearUnread(type, sessionId)`(§7 服务方法清单),
并在 §0 的承载面要点里加一行索引;措辞与既有条目一致,均标 **v0.25.0+**。
- N1:`tests/sidebar-auto-activation.spec.tsx` 删掉一条误导性死代码
(`reduceFor(... unread: [])` 对断言是空操作:它只写 bySession + 落盘,既不更新
snapshot 也不 notify;证伪见提交后报告——保留该行、去掉 `activateTab` 一行,
用例照样红)。
- N3:unread 的持久化往返此前零测试(`sanitizeState` 的 `Array.isArray(record.unread)`
分支无人守护)。`tests/state.spec.ts` 新增判别性用例:写入未读 → 落盘 → **新
store** `setSession` 读回。还原该分支后用例红在 `state.unread === undefined`。
文案核对:改后 `active:'zh'` 返回简体中文、`active:'en'` 返回新英文句;20 份词典
的这两条现在与 de1e76e 之前的版本**逐份不同**、且没有任何一份还留着旧句。
门禁:`pnpm typecheck` / `pnpm lint` / `pnpm exec vitest run --maxWorkers=3`
(179 文件 / 2058 passed + 13 skipped)全绿。
2026-10-05 23:13:23 +08:00
Menghuan1918
2c8d11a8fc
feat(editor): 编辑器未提交变更提示(行号着色 + 左侧色条 + hover blame)(#212)
...
code 视图(可编辑 CodeMirror)显示未提交变更的行级提示,一个布尔设置
editorGitGutter(默认开)总开关:
- 行号槽着色 + 行号左侧 2px 细色条(新增/修改/删除),取色复用文件树
既有 tone 口径(--dsw-alias-state-*);
- hover 某行时按需取该行 blame,纯文本 tooltip(作者 · 时间 + 摘要),
按 sessionId+path+line 记忆化,不预取整文件、滚动不重复请求;
- 行映射复用既有 useGitStatus 共享 store 与既有统一 diff 引擎
(parseUnifiedDiff/unifiedSegments),不新增第二个 git status 轮询器;
未跟踪文件按状态 store 整篇标新增;
- 新增宿主路由 git.diff-head(git diff HEAD,部分暂存时给出已暂存+未暂存
的整份未提交变更,未出生 HEAD 回退 --cached)与 git.blame
(git blame --porcelain -L,四条失败路径一律返回空,不抛);
- 只给 viewerId === 'code' 挂 decoration/gutter/tooltip,markdown/html 与
关闭设置后不安装任何扩展;开关经 Compartment 原地重配。
不做行尾常驻作者 widget、不做徽章、不做动画、不做渐变、不做四个独立开关。
2026-10-05 22:25:51 +08:00
ymac
5f90f1d466
Merge remote-tracking branch 'origin/dev' into fix/826-file-link-line-jump
...
# Conflicts:
# CHANGELOG.md
# src/client/FileTree.tsx
# src/client/desktop-env.ts
2026-10-05 22:20:24 +08:00
ymac
415d517fb0
fix(editor): make a file reference land on its line ( #826 second half)
...
`fileParamsOf` already split the `path:line` spec off the address (#828 )
but kept only `spec.path` — so both spellings opened the file and left the
reader on line 1: `path:131` dropped the parsed line, and the host's own
`#L131` fragment was already delivered as `navigation.params.line` and
dropped just the same.
Carry the line the rest of the way: address → `SidebarTab.line` →
`FileViewerProps.line` → one reveal in the text editor. Both spellings
land on the same row.
Three decisions:
- `line` is transient: `sanitizePersistedTab` copies a whitelist and this
field is deliberately left out of it, so a reload does not yank the
reader back to a line a link named days ago. Same treatment as
`revealed`.
- markdown/html flip out of preview when a line is present: preview has no
source lines to put a cursor on, and its own mount-time scroll restore
would fight the jump (both write the same `scrollTop`). The reference
asked for source, so the flip does not record the key and the re-run
after the mode change does the jump — which also dissolves the conflict
instead of arbitrating it.
- A range keeps only its first line and the column is dropped: the editor
has exactly one cursor.
The record must also be able to DROP the line, not only set it — an
in-place switch from `a.ts:131` to a bare `a.ts` would otherwise leave 131
behind and the editor would bounce the reader back on every notification.
Comparing against the current value instead of "was one passed" also keeps
the synthetic record's identity when neither side has one, which matters
because the host keeps visited bodies mounted.
2026-10-05 22:17:44 +08:00
Menghuan1918
a67779acdc
fix(desktop): 顶部保留区优先读壳的 desktopWindow 契约(#864)
...
现象:dsh-desktop 的 compatibility / extended 模式下,壳已经把整个页面下移 36px(页面在独立
WebContentsView / 壳自有 root 里从 y=36 开始),却仍按契约在 URL 上盖
`dsh-desktop-titlebar-inset=36`;插件把这枚戳当成「页面还要再让位 36px」,于是面板顶部多一条空白。
修法:
① `desktop-env.ts`:mode 接受第三种取值 `extended`(与 compatibility 同几何的独立 36px
frame),并新增 `probeDesktopWindow(ctx)` —— 结构化探测客户端服务 `ctx.desktopWindow`
(镜像类型 `SidebarDesktopWindowService` 落在 `context-types.ts`,照 sidebar-file.ts 的
probe 约定)。**不写进 `dsh.client.inject`**:普通浏览器没有该服务,注入它会让整个插件
pending;探测按调用读(服务由壳自己的 client fiber 提供,可能后到),`get` 抛错按缺失处理。
② `computeTitleBarStrip`:取值链在 ⓪ `web` 强制 0 之后、① WCO 之前插入壳契约 —— 服务存在时
以 `safeAreaInsets.top` 为权威(compatibility / extended 报 0 → 不再预留;advanced 报它画进
内容里的 caption 行,darwin 与 win32 同为 32,以壳上报值为准)。URL 戳因此在有服务时被忽略;服务不存在时旧链路
(WCO → URL → preset/custom)逐字不变。
③ `shell-presets.ts`:复核 `env.mode !== 'advanced'` —— extended 不套用 advanced 的 preset
顶部值(guard 原样成立,补注释与用例把它钉住)。
文档:指南 §12 的壳信号与 strip 取值链、`docs/plans/2026-08-20-desktop-scheme-settings-design.md`
的实施偏差记录同步。
判别性(`git stash push -- src` 临时还原源码、保留测试后重跑):
- titlebar-strip.spec.ts:(a)/(d) 由 0 变 **36**、(b) 由 32 变 0 → 3 例红((c)「无服务 + 戳 36
→ 36」在旧代码上照旧绿,正是本次刻意不动的那段);
- desktop-window-strip.spec.tsx(挂真 Sidebar、断言页面实际状态):期望
`{compat:false, px:''}` 实得 `{compat:true, px:'36px'}` —— issue 的可见症状本身;advanced 实得
无 strip → 3 例红;
- desktop-env.spec.ts:extended 解析成 null、`probeDesktopWindow is not a function` → 4 例红
(typecheck 同时报 12 条:链只收 5 参 / `'extended'` 不在联合里);
- 还原后 34/34 绿,src diff 与还原前逐字节一致(`git diff -- src | diff - /tmp/430-src.patch`)。
全量:174 files / 1977 passed | 13 skipped(新增 14 例),typecheck 0,eslint 0。
本改动**不**解决 #430(那是「preset / custom 档位不改变位置」的取值链优先级问题),两者不要互相关闭。
2026-10-05 21:59:14 +08:00
Menghuan1918
0bec49ca0a
Merge port/pr-584:/sidebar/* 传输按页面前缀解析(反代子路径不再甩掉前缀)
...
冲突取舍(两处都是「能力清单并集」,两边都留,不取一边):
- src/client/service.ts:SIDEBAR_FEATURES 同时保留 #264 的 'settingPatterns' 与
#584 的 'hostRouteUrl'(能力清单只增不删)。
- docs/external-plugin-guide.md:features 契约行同步列全两项。
移植分支已按证据卡口径把 base 权威收到一处:desktop-env.ts 的 hostTransportBase()
= __DSH_TRANSPORT__?.streamBaseUrl ?? document.baseURI(宿主同款解析式,保留 #768 的
桌面壳修复),HTTP/WS 共用 hostRouteUrl / hostWebSocketUrl 而不另起一套 base 来源;
HTTP 调用点 api / chunk-loader / markdown-images / archive / file / html,
WS 调用点 use-host-feeds / use-dir-watch 均已切到新 helper。
2026-10-05 02:38:02 +08:00
Menghuan1918 and idoall
ce2ccabcad
Merge port/pr-584:/sidebar/* 传输按页面前缀解析(反代子路径不再甩掉前缀)
...
冲突取舍(两处都是「能力清单并集」,两边都留,不取一边):
- src/client/service.ts:SIDEBAR_FEATURES 同时保留 #264 的 'settingPatterns' 与
#584 的 'hostRouteUrl'(能力清单只增不删)。
- docs/external-plugin-guide.md:features 契约行同步列全两项。
移植分支已按证据卡口径把 base 权威收到一处:desktop-env.ts 的 hostTransportBase()
= __DSH_TRANSPORT__?.streamBaseUrl ?? document.baseURI(宿主同款解析式,保留 #768 的
桌面壳修复),HTTP/WS 共用 hostRouteUrl / hostWebSocketUrl 而不另起一套 base 来源;
HTTP 调用点 api / chunk-loader / markdown-images / archive / file / html,
WS 调用点 use-host-feeds / use-dir-watch 均已切到新 helper。
Co-authored-by: idoall <6040958+idoall@users.noreply.github.com >
2026-10-05 02:38:02 +08:00
Menghuan1918
996b471a21
Merge port/pr-303:fs.search 引擎优先(fd/rg 探测 + JS 回退)
...
冲突取舍(#264 排除模式 × #303 引擎优先,两边功能全部保留):
- src/fs-search.ts:保留 #303 的 searchFiles(引擎优先 dispatch)/ searchFilesPlain
拆分与 SKIP_DIR_NAMES 单源化,同时保留 #264 的 opts.exclude。新增
engineExcludeProbe:编译好的 exclude 探针作为**引擎输出的后置过滤**——引擎是更快的
walk,不是另一套过滤面,所以匹配行消失,且被排除目录下的整棵子树一起消失(walk 从
不下钻,永远不会报出它们)。过滤在预算切片之前跑(被排除行不吃调用方的行额),
dirs 仍严格是 matches 的子集。
- tests/fs-search.spec.ts:两个分支的 import 都保留;新增一条用例钉住引擎路径的排除
后置过滤(行 + 子树 + dirs),走注入钩子,不依赖真 fd/rg。
- docs/external-plugin-guide.md:两处增量并入同一条参考实现条目(顺序按 dev 现状)——
#264 的 compact / explorerExclude / 目录缓存模式集身份键 在前,#303 的
search-engines.ts、引擎优先与 DSH_SEARCH_DEBUG 插桩 在后,测试清单两边都列。
2026-10-05 02:37:39 +08:00
Menghuan1918 and Cold Cloud
d377bf458c
Merge port/pr-303:fs.search 引擎优先(fd/rg 探测 + JS 回退)
...
冲突取舍(#264 排除模式 × #303 引擎优先,两边功能全部保留):
- src/fs-search.ts:保留 #303 的 searchFiles(引擎优先 dispatch)/ searchFilesPlain
拆分与 SKIP_DIR_NAMES 单源化,同时保留 #264 的 opts.exclude。新增
engineExcludeProbe:编译好的 exclude 探针作为**引擎输出的后置过滤**——引擎是更快的
walk,不是另一套过滤面,所以匹配行消失,且被排除目录下的整棵子树一起消失(walk 从
不下钻,永远不会报出它们)。过滤在预算切片之前跑(被排除行不吃调用方的行额),
dirs 仍严格是 matches 的子集。
- tests/fs-search.spec.ts:两个分支的 import 都保留;新增一条用例钉住引擎路径的排除
后置过滤(行 + 子树 + dirs),走注入钩子,不依赖真 fd/rg。
- docs/external-plugin-guide.md:两处增量并入同一条参考实现条目(顺序按 dev 现状)——
#264 的 compact / explorerExclude / 目录缓存模式集身份键 在前,#303 的
search-engines.ts、引擎优先与 DSH_SEARCH_DEBUG 插桩 在后,测试清单两边都列。
Co-authored-by: Cold Cloud <64406210+yanzhaohui1999@users.noreply.github.com >
2026-10-05 02:37:39 +08:00
Menghuan1918
a2be398cfb
fix(sidebar): /sidebar/* 传输按页面前缀解析,反代子路径下不再甩掉前缀(#584 移植)
...
贡献者 PR #584(fix: preserve reverse-proxy base paths,head 1ca99d8)的改动面在
dev 上仍然需要——JSON API / upload / file / html / bundle 与两条 WebSocket 都还是
源站绝对路径(带前导斜杠 → 反代子路径下 404 / 1006),目标 issue #753 仍 OPEN,
docs/plans/2026-10-04-issue-triage.md 也把 #584 记为优先合入项。但它不能机械解冲突,
故按 dev 现有结构重写。
复用(PR 的可复用部分):
- 新增 src/client/host-route-url.ts:hostRouteUrl() / hostWebSocketUrl() 先去前导
斜杠,再按注入基底解析;基底去 search/hash 并强制目录尾斜杠——launch token 查询串
与「缺尾斜杠的前缀」都不会吃掉路径最后一段。
改写(dev 侧已经变掉的东西):
- 基底来源并进 dev 的 2718725:desktop-env.ts 的 sidebarWebSocketBase() 泛化为
hostTransportBase()(__DSH_TRANSPORT__.streamBaseUrl 优先,回落 document.baseURI),
HTTP 与 WS 从此共用一个基底权威,而不是另起一套。丢弃 PR 的 hostDocumentBase()
「取 document.baseURI 与 location.href 中更长者」启发式:它会顶掉刚落地的桌面壳修复
(dsh-app://app/ 下 location.href 会重新拼出不可达的 ws://app/…),而基线
0.2.0-rc.1 的宿主产物里没有 <base href>(PR 自己的 e2e 也只采集、从不断言它)。
最终解析式与宿主 dsh-api-gateway 逐字同形(去前导斜杠 + 壳注入基底优先)。
- 丢弃 src/client/TerminalView.tsx 的改动:该文件在 dev 已删除(终端已交还宿主),
其覆盖的 WS 语义改由 dev 现存的两条调用点承担,并补齐 PR 文件清单里漏掉的
src/client/use-dir-watch.ts(fs-watch socket)。
调用点(一律相对路径 + 前缀解析):api.ts 的 JSON API / upload / file / html /
archive、chunk-loader.ts 的 CHUNK_URL、markdown-images.ts 与 MarkdownHtml /
TextEditor / DiffPane 的媒体改写(原 window.location.origin 在桌面壳下是
dsh-app://app,媒体同样不可达)、use-host-feeds.ts 与 use-dir-watch.ts 的两条
WebSocket。archiveDownloadUrl 是 PR 漏掉的同类调用点(FileTree 用它 fetch zip 字节),
一并纳入;open-in-app.ts 打的是宿主路由 /open-in-app/*,与 PR 明确不碰的宿主 /api
同类,不纳入。
消费插件契约(指南「接入 API 即文档」):
- BetterSidebarService 新增 hostRouteUrl(path)(features 'hostRouteUrl'),
docs/external-plugin-guide.md §6 / §7 / §15 的 fetch('/sidebar/api/…') 示例改为
经它解析,并写明「绝不写前导斜杠」。
验证:pnpm typecheck / pnpm exec vitest run(161 files / 1812 passed / 13 skipped)/
eslint 全绿。tests/base-path.spec.ts 钉前缀保留与基底优先级,并在真实调用点上断言
(api fetch 的 URL、chunk 注入的 script src、jsdom 下 fs-watch 的 socket URL);
PR 自带的 base-path e2e 在 page.evaluate 里复制实现后自证,回归守不住,故不引入该 lane。
Refs #584
2026-10-05 02:22:03 +08:00
Menghuan1918 and idoall
78274c7b78
fix(sidebar): /sidebar/* 传输按页面前缀解析,反代子路径下不再甩掉前缀(#584 移植)
...
贡献者 PR #584(fix: preserve reverse-proxy base paths,head 1ca99d8)的改动面在
dev 上仍然需要——JSON API / upload / file / html / bundle 与两条 WebSocket 都还是
源站绝对路径(带前导斜杠 → 反代子路径下 404 / 1006),目标 issue #753 仍 OPEN,
docs/plans/2026-10-04-issue-triage.md 也把 #584 记为优先合入项。但它不能机械解冲突,
故按 dev 现有结构重写。
复用(PR 的可复用部分):
- 新增 src/client/host-route-url.ts:hostRouteUrl() / hostWebSocketUrl() 先去前导
斜杠,再按注入基底解析;基底去 search/hash 并强制目录尾斜杠——launch token 查询串
与「缺尾斜杠的前缀」都不会吃掉路径最后一段。
改写(dev 侧已经变掉的东西):
- 基底来源并进 dev 的 2718725:desktop-env.ts 的 sidebarWebSocketBase() 泛化为
hostTransportBase()(__DSH_TRANSPORT__.streamBaseUrl 优先,回落 document.baseURI),
HTTP 与 WS 从此共用一个基底权威,而不是另起一套。丢弃 PR 的 hostDocumentBase()
「取 document.baseURI 与 location.href 中更长者」启发式:它会顶掉刚落地的桌面壳修复
(dsh-app://app/ 下 location.href 会重新拼出不可达的 ws://app/…),而基线
0.2.0-rc.1 的宿主产物里没有 <base href>(PR 自己的 e2e 也只采集、从不断言它)。
最终解析式与宿主 dsh-api-gateway 逐字同形(去前导斜杠 + 壳注入基底优先)。
- 丢弃 src/client/TerminalView.tsx 的改动:该文件在 dev 已删除(终端已交还宿主),
其覆盖的 WS 语义改由 dev 现存的两条调用点承担,并补齐 PR 文件清单里漏掉的
src/client/use-dir-watch.ts(fs-watch socket)。
调用点(一律相对路径 + 前缀解析):api.ts 的 JSON API / upload / file / html /
archive、chunk-loader.ts 的 CHUNK_URL、markdown-images.ts 与 MarkdownHtml /
TextEditor / DiffPane 的媒体改写(原 window.location.origin 在桌面壳下是
dsh-app://app,媒体同样不可达)、use-host-feeds.ts 与 use-dir-watch.ts 的两条
WebSocket。archiveDownloadUrl 是 PR 漏掉的同类调用点(FileTree 用它 fetch zip 字节),
一并纳入;open-in-app.ts 打的是宿主路由 /open-in-app/*,与 PR 明确不碰的宿主 /api
同类,不纳入。
消费插件契约(指南「接入 API 即文档」):
- BetterSidebarService 新增 hostRouteUrl(path)(features 'hostRouteUrl'),
docs/external-plugin-guide.md §6 / §7 / §15 的 fetch('/sidebar/api/…') 示例改为
经它解析,并写明「绝不写前导斜杠」。
验证:pnpm typecheck / pnpm exec vitest run(161 files / 1812 passed / 13 skipped)/
eslint 全绿。tests/base-path.spec.ts 钉前缀保留与基底优先级,并在真实调用点上断言
(api fetch 的 URL、chunk 注入的 script src、jsdom 下 fs-watch 的 socket URL);
PR 自带的 base-path e2e 在 page.evaluate 里复制实现后自证,回归守不住,故不引入该 lane。
Refs #584
Co-authored-by: idoall <6040958+idoall@users.noreply.github.com >
2026-10-05 02:22:03 +08:00
Menghuan1918
f871002448
feat(explorer): 文件树面包屑折叠 + VS Code 风格可配置排除模式(移植 #264)
...
按当前 dev 重写贡献者 PR #264 的两项核心意图:
1. 面包屑折叠(VSCode "compact folders"):host 给「内容恰为一个有效
子项」的目录行标记 `compact`,client 把单目录链折叠成一行 `a/b/c`
并整链展开/折叠。
2. `explorerExclude`(VS Code `files.exclude` 风格的 glob 子集):匹配
条目从文件树与文件名搜索中彻底移除;树与搜索共用同一份 host 侧编译
好的 matcher,两个界面永不失配。
为什么按 dev 现有结构重写而不是机械解冲突——证据卡逐条点名的 dev 侧变化:
- **客户端树已换成 DirRow 记忆化组件 + loadLevels/api.fsTrees 批量路由**。
PR 改的是旧的 `expanded.includes(...)` 内联目录行与单路径 `api.fsTree`,
该上下文在 dev 已不存在。折叠因此接在 renderLevel/visibleRows 的链上,
并新增「每级缓存修订一次」的链缓存:DirRow 按 prop 身份 memo,每次渲染
新建数组会让选择/悬停把每个目录行都重渲。
- **`api.fsTree(scope, path, signal?)` 的第三位已经是 AbortSignal**,PR 的
`api.fsTree(scope, dir, exclude)` 会把数组当 signal。exclude 统一排在
signal 之前(`fsTree`/`fsTrees`/`fsSearch` 三处一致)。
- **dev 的 `listDirectory` 有 1.5s TTL 缓存,PR 是直接读盘**。照搬会让不同
排除集共用一份缓存(改完排除列表仍读到旧行),而 pref 变更没有可搭的
失效钩子。故把模式集的身份并入 cacheKey(新增 `ExcludeMatcher.key`,含
锚点 root 与大小写折叠语义):同列表命中缓存,改列表即换键。
- **文件树的真实入口是批量路由 `fs.trees`**(挂载/展开一次 POST),PR 只
改了 `fs.tree`/`fs.search` 两处——不接批量路由等于 exclude 不生效。
- PR body 声称移除 `explorerShowHidden`,但净 diff 对它零命中、dev 与 PR
合并基也都没有该键,属失效声明,不做产品取舍。
复用的部分(与 dev 无耦合):`src/exclude-patterns.ts` 与
`src/client/file-tree-compact.ts` 两个纯逻辑模块逐字取用(前者仅新增缓存
身份 `ExcludeMatcher.key`)。设置 UI 沿用 PR 的声明式 `patterns` 行类型
(chips + 删除钮 + 常驻添加输入框,原子提交整表),5 个新词条按仓库规则
同步全部 21 份词典;`src/client/service.ts` 的能力清单新增 `settingPatterns`
并同步 docs/external-plugin-guide.md。
门禁:pnpm typecheck 0;pnpm exec vitest run --maxWorkers=3 全绿
(165 files / 1847 passed / 13 skipped);npx eslint 45 个改动文件 0;
新增与改动的 spec 单跑 154 passed;pnpm build 0。
Refs #264
2026-10-05 02:13:53 +08:00
Menghuan1918 and shyuan-hub
5254c031b1
feat(explorer): 文件树面包屑折叠 + VS Code 风格可配置排除模式(移植 #264)
...
按当前 dev 重写贡献者 PR #264 的两项核心意图:
1. 面包屑折叠(VSCode "compact folders"):host 给「内容恰为一个有效
子项」的目录行标记 `compact`,client 把单目录链折叠成一行 `a/b/c`
并整链展开/折叠。
2. `explorerExclude`(VS Code `files.exclude` 风格的 glob 子集):匹配
条目从文件树与文件名搜索中彻底移除;树与搜索共用同一份 host 侧编译
好的 matcher,两个界面永不失配。
为什么按 dev 现有结构重写而不是机械解冲突——证据卡逐条点名的 dev 侧变化:
- **客户端树已换成 DirRow 记忆化组件 + loadLevels/api.fsTrees 批量路由**。
PR 改的是旧的 `expanded.includes(...)` 内联目录行与单路径 `api.fsTree`,
该上下文在 dev 已不存在。折叠因此接在 renderLevel/visibleRows 的链上,
并新增「每级缓存修订一次」的链缓存:DirRow 按 prop 身份 memo,每次渲染
新建数组会让选择/悬停把每个目录行都重渲。
- **`api.fsTree(scope, path, signal?)` 的第三位已经是 AbortSignal**,PR 的
`api.fsTree(scope, dir, exclude)` 会把数组当 signal。exclude 统一排在
signal 之前(`fsTree`/`fsTrees`/`fsSearch` 三处一致)。
- **dev 的 `listDirectory` 有 1.5s TTL 缓存,PR 是直接读盘**。照搬会让不同
排除集共用一份缓存(改完排除列表仍读到旧行),而 pref 变更没有可搭的
失效钩子。故把模式集的身份并入 cacheKey(新增 `ExcludeMatcher.key`,含
锚点 root 与大小写折叠语义):同列表命中缓存,改列表即换键。
- **文件树的真实入口是批量路由 `fs.trees`**(挂载/展开一次 POST),PR 只
改了 `fs.tree`/`fs.search` 两处——不接批量路由等于 exclude 不生效。
- PR body 声称移除 `explorerShowHidden`,但净 diff 对它零命中、dev 与 PR
合并基也都没有该键,属失效声明,不做产品取舍。
复用的部分(与 dev 无耦合):`src/exclude-patterns.ts` 与
`src/client/file-tree-compact.ts` 两个纯逻辑模块逐字取用(前者仅新增缓存
身份 `ExcludeMatcher.key`)。设置 UI 沿用 PR 的声明式 `patterns` 行类型
(chips + 删除钮 + 常驻添加输入框,原子提交整表),5 个新词条按仓库规则
同步全部 21 份词典;`src/client/service.ts` 的能力清单新增 `settingPatterns`
并同步 docs/external-plugin-guide.md。
门禁:pnpm typecheck 0;pnpm exec vitest run --maxWorkers=3 全绿
(165 files / 1847 passed / 13 skipped);npx eslint 45 个改动文件 0;
新增与改动的 spec 单跑 154 passed;pnpm build 0。
Refs #264
Co-authored-by: shyuan-hub <311810858+shyuan-hub@users.noreply.github.com >
2026-10-05 02:13:53 +08:00
Menghuan1918
c06c633759
feat(search): fs.search 文件名搜索优先用 fd/rg,缺失/失败回退 JS 遍历
...
issue #203:十万级目录下纯 JS 递归遍历是秒级,10 万条访问预算一顶结果
还被静默截断。现在启动后惰性探测一次本机 fd / rg(每个候选 `--version`
500ms 内验证通过才算数,进程内缓存),探到就用引擎输出,探不到或运行失败
整段回退原来的遍历(导出为 `searchFilesPlain`);坏二进制在进程内禁用,
超时只降级本次(树大 ≠ 二进制坏)。
为什么按 dev 现状重写而不是机械解冲突(PR #303 的落点全部复核过):
- **#801 的必填 `dirs` 是语义级冲突,必须扩引擎契约**。dev 的
`FsSearchResult` 多了 `dirs`(`TreePanel` 用它把命中行当目录导航,否则
`fs.read` 报 “is a directory”),而 PR 的引擎侧只产出
`{paths, truncated}`,`searchFilesPlain` 的空查询也还在返回两字段形状;
照搬会让 #801 修的 bug 在引擎路径上静默回退。收口:fd 用第二次
`--type d` 调用取目录子集(fd 自己不做标注),rg 由文件路径倒推匹配的
目录段(`deriveRgMatches`),dispatch 再把 `dirs` 收敛成 `matches` 的
子集。残留差异只有**空目录在 rg 下不可见**(没有文件路径能带上它)。
- **rg 的路径级 glob 补成三个**:PR 的 `**/*<q>*/**` 缺一个直接子文件
(`util/helper.ts` 是最常见形态),只加 `**` 会让这类目录命中在
rg-only 机器上凭空消失;`**/*<q>/*` + `**/*<q>/**` 两条并用(对真实
rg 15 实测:单用任一条都丢结果)。
- **`bundledRgCandidates` 的路径推导按真机布局改写**:npm/pnpm 把
`@vscode/ripgrep-<platform>-<arch>` 提升到 `@deepseek-ai` 的**同级**,
不存在 `<root>/@deepseek-ai/dsh/node_modules/@vscode/...`;候选根改成
「从 CLI 入口(argv[1])向上逐级 `node_modules`」+ 各包管理器全局前缀,
桌面壳那种「自带依赖树 + 外部 node」的布局才探得到捆绑 rg(实测命中)。
- **丢掉 abort 形参**:`src/index.ts` 的生产路径不传 signal(PR 里也只有
测试在用),单为测试保留一条贯穿三层的通道不划算;引擎子进程由 15s
内部超时兜底。
- **文档锚点按 dev 重锚**:README 的 v0.12.3 条目已随发布历史迁到
CHANGELOG(新增 Unreleased 条目),AGENTS §2 的引擎门禁入口挂到现有
ci-windows 段落,指南 §14 参考实现行补 `src/search-engines.ts`。
- 未新增任何依赖:`@vscode/ripgrep` 只作为**路径**探测,不做模块导入。
Windows 侧由既有 ci-windows lane 承载:`choco install fd ripgrep` 把真
二进制放进 PATH,套件后 `pnpm check:engines`(`scripts/win-engine-check.mjs
--assert`,import `src/search-engines.ts` 取插件自己的 argv)断言
`--path-separator /` 的输出不含 `\`/CR、非 ASCII 文件名命中;引擎缺失则
跳过(fd 在 ubuntu lane 与多数开发机上都没有)。
测试:`tests/search-engines.spec.ts`(探测缓存 / 运行失败禁用 / 超时不禁
用 / argv 对称性与噪声目录排除 / `deriveRgMatches` / 捆绑 rg 候选推导 /
真引擎在场时的端到端——缺席即返回),`tests/fs-search.spec.ts` 拆成
「直接钉遍历」+「注入假引擎的 dispatch 组」(引擎优先、`dirs` 透传与
子集收敛、预算透传、运行失败回退并禁用)。真机核对:本仓库上 rg 路径与
JS 遍历对 `locales` / `util` / `client` / `src` / `e2e` 五个查询的
matches 与 dirs **逐项一致**。
Refs #303
2026-10-05 02:10:45 +08:00
Menghuan1918 and Cold Cloud
194099e7f3
feat(search): fs.search 文件名搜索优先用 fd/rg,缺失/失败回退 JS 遍历
...
issue #203:十万级目录下纯 JS 递归遍历是秒级,10 万条访问预算一顶结果
还被静默截断。现在启动后惰性探测一次本机 fd / rg(每个候选 `--version`
500ms 内验证通过才算数,进程内缓存),探到就用引擎输出,探不到或运行失败
整段回退原来的遍历(导出为 `searchFilesPlain`);坏二进制在进程内禁用,
超时只降级本次(树大 ≠ 二进制坏)。
为什么按 dev 现状重写而不是机械解冲突(PR #303 的落点全部复核过):
- **#801 的必填 `dirs` 是语义级冲突,必须扩引擎契约**。dev 的
`FsSearchResult` 多了 `dirs`(`TreePanel` 用它把命中行当目录导航,否则
`fs.read` 报 “is a directory”),而 PR 的引擎侧只产出
`{paths, truncated}`,`searchFilesPlain` 的空查询也还在返回两字段形状;
照搬会让 #801 修的 bug 在引擎路径上静默回退。收口:fd 用第二次
`--type d` 调用取目录子集(fd 自己不做标注),rg 由文件路径倒推匹配的
目录段(`deriveRgMatches`),dispatch 再把 `dirs` 收敛成 `matches` 的
子集。残留差异只有**空目录在 rg 下不可见**(没有文件路径能带上它)。
- **rg 的路径级 glob 补成三个**:PR 的 `**/*<q>*/**` 缺一个直接子文件
(`util/helper.ts` 是最常见形态),只加 `**` 会让这类目录命中在
rg-only 机器上凭空消失;`**/*<q>/*` + `**/*<q>/**` 两条并用(对真实
rg 15 实测:单用任一条都丢结果)。
- **`bundledRgCandidates` 的路径推导按真机布局改写**:npm/pnpm 把
`@vscode/ripgrep-<platform>-<arch>` 提升到 `@deepseek-ai` 的**同级**,
不存在 `<root>/@deepseek-ai/dsh/node_modules/@vscode/...`;候选根改成
「从 CLI 入口(argv[1])向上逐级 `node_modules`」+ 各包管理器全局前缀,
桌面壳那种「自带依赖树 + 外部 node」的布局才探得到捆绑 rg(实测命中)。
- **丢掉 abort 形参**:`src/index.ts` 的生产路径不传 signal(PR 里也只有
测试在用),单为测试保留一条贯穿三层的通道不划算;引擎子进程由 15s
内部超时兜底。
- **文档锚点按 dev 重锚**:README 的 v0.12.3 条目已随发布历史迁到
CHANGELOG(新增 Unreleased 条目),AGENTS §2 的引擎门禁入口挂到现有
ci-windows 段落,指南 §14 参考实现行补 `src/search-engines.ts`。
- 未新增任何依赖:`@vscode/ripgrep` 只作为**路径**探测,不做模块导入。
Windows 侧由既有 ci-windows lane 承载:`choco install fd ripgrep` 把真
二进制放进 PATH,套件后 `pnpm check:engines`(`scripts/win-engine-check.mjs
--assert`,import `src/search-engines.ts` 取插件自己的 argv)断言
`--path-separator /` 的输出不含 `\`/CR、非 ASCII 文件名命中;引擎缺失则
跳过(fd 在 ubuntu lane 与多数开发机上都没有)。
测试:`tests/search-engines.spec.ts`(探测缓存 / 运行失败禁用 / 超时不禁
用 / argv 对称性与噪声目录排除 / `deriveRgMatches` / 捆绑 rg 候选推导 /
真引擎在场时的端到端——缺席即返回),`tests/fs-search.spec.ts` 拆成
「直接钉遍历」+「注入假引擎的 dispatch 组」(引擎优先、`dirs` 透传与
子集收敛、预算透传、运行失败回退并禁用)。真机核对:本仓库上 rg 路径与
JS 遍历对 `locales` / `util` / `client` / `src` / `e2e` 五个查询的
matches 与 dirs **逐项一致**。
Refs #303
Co-authored-by: Cold Cloud <64406210+yanzhaohui1999@users.noreply.github.com >
2026-10-05 02:10:45 +08:00
Atlas Zeng
244d7d9fd3
Merge pull request #600 from nyantused-cpun/feat/editor-draft-protection
...
feat(editor): 未保存草稿保护、保存冲突检测与内置查找替换
2026-10-05 02:01:42 +08:00
Menghuan1918
783ac9feb6
merge #600 into dev(草稿保护/冲突门/替换;删掉与 #587 重复的查找接线与词典键,换掉已删图标名)
...
贡献者 PR #600(feat/editor-draft-protection,head a14c1e8)以 --no-ff 落到 dev
基线(9b97e6f)。贡献者的提交原样保留,冲突解决体现为本次合并结果。
保留(PR 独有):
- 草稿保护:src/client/editor-dirty.ts(脏稿登记表 + confirmDiscardDraft)、EditorHost
的登记/卸载清理、Sidebar 的 closeTab 门与 beforeunload、closePathTabs 的确认参数。
- 保存冲突门:fs.read 回报 mtimeMs、fs.write 的 expectedMtimeMs(409 fs-conflict,在写
临时文件之前判定)、TextEditor 的 mtimeRef + 冲突横幅 + onReload、wire 的
fs-conflict 码,以及 fs-write-route / text-editor-conflict 两个新 spec。
- 查找/替换入口:TextEditor 工具栏放大镜按钮(打开 #587 的面板;可编辑视图的面板自带
替换行),文案用 #587 的 searchFind。
删除(与 #587 / 2e22b90 重复的部分):
- TextEditor 里重复的那份查找接线:本地 searchPhrases()、EditorState.phrases.of(...)、
search({ top: true })、编辑器 keymap 里的 ...searchKeymap,以及 search / searchKeymap
两个 import——#587 的 src/client/cm-search.ts 已提供同一套(面板、keymap、phrases 隔间、
令牌主题)。
- 20 份词典里被 #587 取代的 10 个键:find / replace / findNext / findPrevious / findAll /
findMatchCase / findRegexp / findByWord / replaceOne / replaceAll(命名以先落的 #587 为准:
searchFind / searchReplace / searchNext / searchPrevious / searchAll / searchMatchCase /
searchWholeWord / searchRegexp / searchReplaceAll)。
- src/index.ts 里已被 2e22b90 覆盖的临时文件改名(.dsh-write-<uuid>):保留 dev 的
.dsh-sidebar-tmp-<uuid>,tests/fs-write-route.spec.ts 的残留断言改指 dev 命名。
- tests/text-editor-search.spec.tsx 中与 editor-find.spec.tsx 重复的三个用例(en/zh 文案、
Mod-f),只留「工具栏按钮开面板并切到编辑态」这一个独有用例。
- README / README_EN / 指南里未实现的 Ctrl/Cmd + H 声明(PR 从未绑定 Mod-h,且浏览器保留
该组合键),改为如实描述「Ctrl/Cmd + F 的面板含替换行」,并补上 #587 已支持的
Ctrl/Cmd + G / Shift + Ctrl/Cmd + G / Ctrl/Cmd + D。
其它解冲突取舍(dev 上下文已漂移,不复活 PR 基线代码):
- 图标:IconSearchOutline16 在宿主图标整族改名后已不存在,换为 IconSearchOutlineRegular
size={16}(显式尺寸;旧 16 后缀已删,不传会按新默认尺寸)。
- 采纳 dev 侧:fs.read 的 ensureWorkspacePath 两参调用、truncation 横幅不带 mode 条件、
fs.write 的编码探测与 invalidateDirectoryCache、Sidebar 的 closeTab 里 PR 基线的终端
pty 释放块(dev 已移走)与 summaryCwd/pushedBottomHeight/collapsed 块(dev 已删)。
- 测试 harness 跟随 dev:ctx.sidebarRight.mounted、bottomSplits、先打开底部工作台、
apply() 需要的 ctx.on、api 模块改为部分 mock(保留 sessionPhase / sessionCwd)。
- 取舍记录写入 docs/plans/2026-09-09-editor-draft-protection-design.md。
Refs #600
2026-10-05 01:58:18 +08:00
Menghuan1918
9c8d5c62ed
merge #574 into dev(工作区提及重放到 reference-in-chat 新载体,复用 mentionFor)
...
冲突是载体搬迁,不是语义作废:
- `@` 回调的载体在 dev 已是 src/client/reference-in-chat.ts(#479 eed2fee 抽出的
两侧共享入口)。PR 新增的 `insertWorkspaceReference` 与 `directoryMention`
落在 conversation-draft.ts(它要用同模块的 appendToDraft /
insertFileReference / mentionFor),由该入口转发;Sidebar.tsx 只保留转发,
native/tab-adapter.tsx 与之同步,两个调用点不再传 cwd(工作区 root 由
`ctx.get('workspaces')` 的会话成员匹配得到,不再回退会话 cwd)。
- PR 的 `directoryMention` 改为委托 dev 的共用构造器 `mentionFor(path, 'folder')`
(#479 把「尾斜杠进引号」的规则收进它),不再自建一套引号规则;
`insertWorkspaceReference` 的文件分支同样换成 `mentionFor(path, 'file')`。
- tests/paths.spec.ts:`resolveSidebarPath` 的导入走已搬迁的 src/client/paths.ts
(produced-files.ts 已不存在),并存的 preview URL 用例与 workspaceRelativePath
用例两块都保留。
- tests/reference-in-chat.spec.ts(#479 验收 spec):fake ctx 补上它现在要读的
workspaces 面、调用点去掉 cwd,三处草稿断言跟随本 PR 的目录尾随分隔空格;
引号与宿主 token 可读性的断言逐字未动。
Refs #574
2026-10-05 01:55:36 +08:00
Atlas Zeng
d694b868b9
Merge pull request #828 from yanzhaohui1999/fix/826-file-link-line-suffix
...
fix(editor): 正文里 `[path](path:131)` 的链接去掉行号后缀再打开(#826 第一半)
2026-10-05 01:38:18 +08:00
Menghuan1918
eed2fee0e6
fix(client): 含空格的目录 @ 引用补引号,让宿主能识别成 folder(#479)
...
宿主的两处 token 读取都只认「引号闭合」的目录写法:
`FOLDER_REF_RE`(dsh-client-ui-conversation)的引号分支是 `@"[^"\n]*\/`,
消息气泡的 `@"[^"\n]+"` 也只在闭合时才把 token 判成 folder;而插件目录分支
原先直接拼 `@${rel}/`,含空格目录 `@my dir/` 在补全扫描里完全不命中、在气泡里
退化成只覆盖 `my` 的 file 芯片——文件分支经 fileMention 加引号,目录分支没有,
同一套引号规则被写了两遍,只有一份对。
把「构造 mention 字面量」抽成 conversation-draft.ts 的共用纯函数
`mentionFor(path, kind)`(fileMention 并入,两个调用点:insertFileReference 与
referenceInChat 的目录分支),沿用原有的控制字符/引号拒绝守卫;目录的尾斜杠拼在
引号内侧(`@"my dir/"`)。宿主自己的选择器在补全途中发的是开引号形式
(`@"my dir/`),那是未完成的补全态、气泡里同样判成 file;本插件的动作插入的是
一条完成的引用,所以闭合引号。
行为不变:无空格目录仍是 `@docs/`、cwd 仍是 `@./`、无空格文件仍是 `@notes.md`,
文件分支的引号与 chip 路径逐字未动。宿主 FOLDER_REF_RE 仍能读到 `@"my dir/`
(闭合引号落在 token 之外),文件夹补全不受影响。
验证:pnpm typecheck(exit 0);pnpm exec vitest run --maxWorkers=3(151 files /
1678 passed / 13 skipped);npx eslint 四个改动文件(exit 0)。
tests/reference-in-chat.spec.ts 把目录分支回退到旧写法后 2/7 红(草稿变成
`@my dir/`、守卫路径重新写入不可表示路径)。guide §4.2 的 onReferenceFile 说明
同步引号形式。
Refs #479
2026-10-05 01:31:29 +08:00
Menghuan1918
582f814d5e
merge #828 into dev(fileParamsOf 剥掉 path:line 行号后缀,解上下文冲突)
...
贡献者 PR #828(fix/826-file-link-line-suffix,2c5b762)修 issue #826:
宿主 markdown 语法只认 `#L131`,`path:131` 会被 parseFileLink 整串当文件名,
editor tab 于是去读一个叫 `CMakeLists.txt:131` 的文件并报「文件不存在」。
改法是在插件唯一把文件地址转成合成记录的那一步(native/index.ts 的
fileParamsOf)切掉尾部行号规格,tab 标题同源修正;新增纯函数
src/client/path-line.ts 与 tests/path-line.spec.ts。
解冲突:只有 tests/native-surface.spec.ts 的第 9 行 import 块冲突。
dev 侧多了 `import { createNativeSurface } from '../src/client/native/surface.ts'`
(PR #696 移植),PR 侧把同一行改成 `import { fileParamsOf, registerNativeSurface }`。
两边都要,合为两行;docs/external-plugin-guide.md 由 git 三方合并自动解掉
(PR 新增的「地址里的行号(#826)」行与 dev 新增的「文件打开的认领判定」行并存)。
未改贡献者任何实现意图,未 rebase / squash 其提交。
Refs #828
2026-10-05 01:30:34 +08:00
Atlas Zeng
00801f5289
Merge pull request #818 from btsd321/feat/tabbar-right-actions
...
feat(tabbar): 新增 TabDescriptor.rightActions,活跃 tab 可注入 tab 栏右侧操作区
2026-10-05 00:54:50 +08:00
ymac
2c5b7621dd
fix(editor): 正文里 [path](path:131) 的链接去掉行号后缀再打开 ( #826 )
...
DSH 的 markdown 链接语法只认 GitHub 的 `#L131` 片段:目的地没有 `#` 时
`parseFileLink` 把整串当文件名返回。于是模型按编译器诊断的通用写法输出的
`[a/b.c](a/b.c:131)` 变成一次对 `b.c:131` 的文件打开,编辑器读不到、右侧栏
红字报「文件不存在」。
宿主源码不可改,纠正放在插件唯一把文件地址变成合成记录的那一步
(native/index.ts 的 fileParamsOf):尾部行号规格(`:行` / `:起-止` /
`:行:列`)在这里切掉,tab 标题按切完的文件名给(宿主用同一个字符串推导标题,
否则芯片上会写 `b.c:131`)。切完之后读、写、"打开方式"、去重、viewer 匹配
拿到的都是真实路径,所以没有需要重试或记住的状态。
切分规则与宿主的 `#L` 语法对齐:1 起、无前导零、锚在串尾(`data:2024.csv`
和盘符 `C:` 因此原样通过),并拒绝空前缀、只剩一个字符的前缀(`C:131`)和
倒序区间(`a.c:20-12`)。
取舍:从聊天链接打开一个真名以 `:数字` 结尾的文件会丢掉后缀。文件树 / 搜索 /
插件自有流程的路径不经过这一步(只有 `openResource` 的地址会),而 `:` 在
Windows 上本就不是合法文件名字符。
测试:新增 tests/path-line.spec.ts(9 例,含全部「必须原样通过」的反例);
tests/native-surface.spec.ts 补 fileParamsOf 四例 + editor 类型对带行号地址的
标题。typecheck / lint 全绿;全量 1503 passed,tests/locales.spec.ts 的 ja
词典缺 key 在干净 origin/main 上同样失败(既有问题,不在本 PR 范围)。
2026-10-01 22:05:56 +08:00
HuanLinOTO
84d89067d4
Merge PR #696 (ported): fix(editor): 打开文件先问原生 tab 注册表,被认领的类型不再被硬编码 editor 顶掉(移植到 sidebar-file.ts 新载体,Fixes #695 #643)
...
# Conflicts:
# src/client/EditorHost.tsx
2026-10-01 17:22:00 +08:00
HuanLinOTO
56567b3c4d
fix(editor): 打开文件先问原生 tab 注册表,被认领的类型不再被硬编码 editor 顶掉(#696 移植到 sidebar-file.ts 新载体,Fixes #695 #643)
2026-10-01 17:21:10 +08:00
HuanLinOTO
86ec5ccc75
Merge PR #736 : fix(native): focus through the controller on surface.activate; carry meta on close
...
# Conflicts:
# docs/external-plugin-guide.md
# src/client/native/surface.ts
# src/client/service.ts
2026-10-01 17:12:53 +08:00
HuanLinOTO
b47fb12457
Merge PR #652 : fix(state): contain a throwing store listener instead of blanking the sidebar
2026-10-01 17:08:18 +08:00
HuanLinOTO
8c17648962
fix(tabbar): rightActions 按 review 修复 + 回归测试
...
逐条解决 Copilot review 的 6 条 findings:
1. 空结果不挂载 wrapper:TabBar 先解析 rightActions 节点,
null/undefined/false 直接不渲染容器(空容器是 flex item,
会改变所有既有 tab 栏的布局)。
2. resolver 传入 tab/paneId:签名扩为
(ctx, scope, state, tab, paneId)——single:false 且有分栏时同一类型
可同时开多个实例、每个 pane 各渲染自己的 tab 栏,工具栏操作必须
能定位到正确实例;paneId 与 state.activePane 比较可知聚焦 pane。
API 未发布(本 PR 新增),签名可直接演进。
3. CSS 不再等分:.tabBarRightActions 由 flex:1 改为 0 1 auto
(内容定宽、可收缩裁切),.tabList 独占剩余空间——等分会让
极小的工具栏砍掉 tab 滚动区一半宽度。
4. split 递归转发:NodeView 的递归调用补上 getTabRightActions
(此前 bottomSplits 一旦是 split,所有子 pane 的 resolver
全部丢失,工具栏静默不渲染)。
5. 指南 §7 canonical features 清单补 'rightActions'。
6. 新增 tests/tab-bar-right-actions.spec.tsx(5 用例):节点渲染
位置与参数、跟随活跃 tab、null/无 resolver 不挂载、嵌套 split
树逐 pane 转发(已做变异验证:删掉递归转发该用例即红)。
2026-10-01 16:03:14 +08:00
xlli67
bb0c4649c8
docs: 注释去掉终端插件举例,保持通用接口描述
2026-09-30 13:13:42 +08:00
xlli67
679889d8a9
feat(tabbar): 新增 TabDescriptor.rightActions,活跃 tab 可注入 tab 栏右侧操作区
...
TabBar 新增 getTabRightActions prop,活跃 tab 的 descriptor 声明 rightActions
时,返回的 ReactNode 渲染在 tab 栏右端(+ 按钮右侧、面板关闭按钮左侧,
右对齐)。让 tab 把自己的工具栏(如终端 tab 的新建 / 拆分 / 重启)直接放进
tab 栏,而不是在内容区顶部再单独渲染一行头部。
TabDescriptor.rightActions 与 badge 同签名 (ctx, scope, state) => ReactNode,
抛错被吞掉(不渲染操作),每次活跃 tab 渲染调用——保持廉价。
文档同步:docs/external-plugin-guide.md §4.1 TabDescriptor 字段。
2026-09-30 13:00:28 +08:00
Menghuan1918
0ac62b3a49
Merge origin/main (v0.22.1 与三个热修 PR) into feat/files-changes-uiux
...
冲突面 11 个文件,逐项裁决如下:
1. src/client/native/index.ts —— **取 main 版**。main 的 v0.22.1 在同一处做了更强的修复
(清理循环同样跳过 FILES_KIND,另加 `disposeSafely` 与「注册失败必须回滚已占用 id /
已建槽位」),是我们那行守卫的超集。
⚠️ 但 main 分支从来没有过我们 task-19 的 `records.attachStore(store)` 调用,整文件
采用会**静默丢掉**它(records 拿不到 store → `toggleExpanded` 直接 return → 点目录
树毫无反应),且 jsdom 单测看不见(它们自己绑 records)。已按原注释恢复该调用,并在
注释里记下这次合并教训。真实宿主 lane 证明:恢复前 `zz-expand-refresh` 红(请求为
空、`big` 不展开),恢复后 9/9 全绿。
2. package.json / dsh.plugin.json / src/client/service.ts —— 版本相关冲突取我们的
0.24.1(支持线 ^0.2.0-rc.1 不变)。
3. CHANGELOG / README(中英各一)—— 双方版本节全部保留:我们的 v0.24.1 / v0.24.0 +
**新增缺失的 v0.23.0 节**(开发线,内容随 v0.24.1 发布)+ main 的 v0.22.1。
同时修正两处事实错误:① 「0.1.7 线请固定 v0.23.0」→ **v0.22.1**(0.23.0 从未发布);
② 安装对照表里 0.1.7 行的安装命令同改。README 并补上 v0.23.0 摘要(含 ⚠️ 删除工作区
路径检测这一安全相关的行为变更)。
4. docs/external-plugin-guide.md —— 版本行取我们的(0.2.0 线)。
验证(合并后的树):pnpm typecheck / lint / test = **137 文件 / 1491 通过 / 9 跳过**
(含 main 新增的 native-registration.spec.ts);pnpm build ✓;
DSH_CMD='npx -y --package @deepseek-ai/dsh@0.2.0-rc.1 dsh' pnpm test:mount = **9/9**
(mount 5 + perf 2 + main 的 native-reload 1 + 我们的 zz-expand-refresh 1)。
2026-09-28 23:13:36 +08:00
Menghuan1918
b91675ae61
feat(dsh): 适配 DSH 0.2.0-rc.1(单线支持)+ v0.24.0
...
支持线从 ^0.1.7-rc.1 整体前移到 ^0.2.0-rc.1;0.1.7 线(含 npm latest 的
0.1.7-rc.2)停留在 v0.23.0。适配前实测确认这是纯增量,故本版无运行时兼容分支。
必改项(否则装不上/不加载)
- 14 条 DSH peer → ^0.2.0-rc.1。实测 caret 跨 minor 不成立:`^0.1.7-rc.1`
展开为 >=0.1.7-rc.1 <0.2.0-0,对 0.2.0-rc.1 判定 false(includePrerelease
也救不了)。判别性验证:把 peer 回退成 ^0.1.7-rc.1 后,在 0.2.0-rc.1 宿主上
`dsh plugin add` 直接拒绝并回滚包树——
"installation rejected: Plugin dsh-better-sidebar@0.24 .0 is incompatible with
dsh 0.2.0-rc.1: peerDependencies {…^0.1.7-rc.1…}";恢复 ^0.2.0-rc.1 后安装通过
- 28 个 @deepseek-ai/* devDependencies 精确钉 0.2.0-rc.1(cordis 4.0.4 /
cordis-plugin-group 1.0.4 / cordis-plugin-include 1.0.9 不变)
- 新增 @deepseek-ai/dsh-util-code-language@0.2.0-rc.1:0.2.0 的 ui-primitives
产物裸 import 它(0.1.7 的产物同样 import,只是旧树里恰好被传递提供),
不补则所有加载 ui-primitives 的 20 个 spec 在收集期失败
实测证据(写进 docs/plans/2026-09-28-dsh-0.2.0-rc.1-adaptation.md)
- 本插件消费的 19 个宿主包零值导出删除(对比 export {} / exports.x=)
- 类型面仅 3 处且全为增量:ui-primitives(DisclosureRow/TextShimmer/Tooltip
新增可选 prop、overlay 顶部内距)、dsh-session(新增 ToolCallRecovery)、
dsh-api-remotes(新增 product-analytics remote)
- 会话格式仍 v4、SUBAGENT_DESCRIPTOR_VERSION 仍 3、dsh/lib/bin.js 与
dsh-client-modules 运行时逐字节相同、web profile 客户端 inject 列表相同、
ui-primitives 裸 import 集合不变、agent-team 四包类型逐字相同
- 宿主 web profile:新增 desktop-only product-analytics/telemetry(web 上
disabled);time-context/schedule/ui-schedule(本就 disabled)移入可选
dsh-experimental-schedule-bundle;插件不依赖宿主 schedule
其余同步
- CI 与挂载 lane 钉 @deepseek-ai/dsh@0.2.0-rc.1(scripts/e2e-common.sh 的
DSH_NPX_SPEC/DSH_EXPECT_VERSION、ci.yml),注释记下「0.2.0 首个候选版只挂
next」与「caret 跨 minor 必失效」两条教训
- tests/market-manifest.spec.ts 的 peer 形状断言钉当前基线 tuple
- dsh.plugin.json engines.dsh → >=0.2.0-rc.1;SIDEBAR_SERVICE_VERSION → 0.24.0
- README/README_EN、CHANGELOG/CHANGELOG_EN、AGENTS.md(§2 钉版句 + §3 改为
「DSH 版本适配要点」并新增 §3.0 当前基线,0.1.7 内容降为历史分节)、
docs/external-plugin-guide.md 全部同步
验证:pnpm peers check 仅剩上游 better-locale 的 5 条 unmet(非本插件 peer);
typecheck / lint / test(136 文件 1484 通过 9 跳过)/ build 全绿;
DSH_CMD='npx -y --package @deepseek-ai/dsh@0.2.0-rc.1 dsh' pnpm test:mount = 7/7;
pnpm test:mount:aggregate 通过(聚合双挂载退让)
2026-09-28 21:21:45 +08:00
Menghuan1918
5c95002641
perf(sidebar): fs.tree 22.8ms→3.8ms + 删除工作区路径检测(放开权限)+ 树展开状态按会话
...
用户实测反馈:
1) `/sidebar/api/fs.tree` 性能极差 —— 先测后改(10k 条目目录、热缓存、中位数):
- 冷调用 cap=1000:22.76ms → **3.77ms**;TTL 内重复:≈23ms → **0.000ms**
- 改法:opendir for-await → readdir(withFileTypes) 一次取回;只为 cap 条建行
(slice + 定长数组);路径用字符串拼接而非 path.join;排序弃 localeCompare
(14.6ms/10k → 0.35ms)改小写比较 + 原名码点兜底;新增 1.5s 目录级缓存
(键 绝对路径\0cap,上限 512),由 fs.write/rename/remove/mkdir/upload 与
fs-watch 的变更通知显式失效
- 契约逐字不变;新增 tests/fs-tree.spec.ts 6 例 + fs-watch 失效用例(判别性验证)
2) 删除工作区路径检测(默认不检测、放开权限):
- path-security 变纯词法解析(realpath/包含性判定删除)、fs-operations 去 fence
分支、所有 fs 路由不再读 fence、403 分支消失、config 删 workspaceFence 字段
(schemastery 容忍未知键,旧 profile 不会加载失败)、settings 开关删除
- ⚠️ 安全影响:插件 fs 路由(tree/read/write/rename/remove/mkdir/媒体/HTML/
upload/archive)现在可读写宿主用户可访问的任意路径,只受 OS 权限约束;
指南 §8.1 已加醒目声明
- 死代码清理:FenceErrorNotice 组件 + EditorHost 分支 + 4 个词条(settingsFence*、
fenceErrorReason、fenceDisableAction)+ isOutsideWorkspace* 助手 + TreePanel 的
store prop + 相关 CSS 块
3) 批量列举路由 `fs.trees`(单层失败只在该层带 error)+ 客户端批量加载:
挂载/刷新时的 N+1 请求变为 1 个(8 个展开目录:9 → 1,探针断言)
refreshTick 不再先清缓存(旧行保留到新答案;失败保留旧行 + warn 提示)
4) 修复「关闭文件后返回文件树,展开状态被重置」:
原生承载面的展开集合原来存在每个 tab 的记录里(drop 即丢),改为**每会话状态**
的投影(ensure 从会话态读、toggleExpanded 写回会话态、registerNativeSurface 用
attachStore 订阅);同一会话多 tab 共享、不同会话隔离;revealed 保持 per-tab
验证:typecheck / lint / test(136 文件 / 1484 通过 / 9 跳过)/ build 全绿;
DSH_CMD='npx -y --package @deepseek-ai/dsh@0.1.7-rc.1 dsh' pnpm test:mount 7/7 通过;
版本镜像同步(dsh.plugin.json + SIDEBAR_SERVICE_VERSION)
2026-09-28 20:37:56 +08:00
Menghuan1918
ee1fe05067
feat(sidebar): 菜单层级/性能 + 选中条吸底 + 打包进度 + 修复「在侧边打开」
...
用户实测反馈 5 条:
1) 文件列表性能 / 右键菜单不再刷屏(先测量后改,探针 tests/file-tree-menu-perf.spec.tsx)
- 宿主应用列表按路径缓存:N 次打开菜单只请求 1 次(原每次 1 次 + Loading 帧)
- 行上的 git 数据改为原始值(tone/letter):共享 store 每次轮询重建对象不再触达行
(探针:开窗 folderIcons 4 → 0;root 行也 memo 化)
- 菜单开关不触发目录重列(fsTree=0);实测「菜单打开期间暂停轮询」会让变更行瞬时
掉色并多两次重渲染,故按测量结果放弃该做法(数字与理由写进探针注释)
2) 「已选择 N 项」条移到底部:滚动容器最后一个内容子节点 + sticky bottom(不遮最后
一行),窄栏 flex-wrap 换行不出横向滚动条
3) 菜单层级重构:一级只留默认动作(宿主默认应用 / 打开方式 ▸ / 在文件管理器中显示 /
新 Tab / 在侧边打开 / 下载 / 压缩并下载 / 复制路径 / 重命名 / 删除;目录行另有
新建文件夹、上传到此处),应用列表整体收进「打开方式」子菜单;宿主探测到本机关联
应用时默认不显示插件自研 open-with 项目,新增设置开关 openWithPluginTargets
(editor descriptor 的 pluginToggles)可强制并存;宿主不可用时插件项目照旧
4) 压缩并下载显示进度:宿主改为可观测任务(archive.build / archive.status /
/sidebar/archive?id=,4 并发 + 5 分钟 TTL + sessionId 绑定,buildZip 逐条目
onProgress),客户端轮询 250ms 显示「正在打包 done/total · N%」,ready 后 blob 下载,
失败进 zipFailed
5) 修复「在侧边打开没有效果」:根因是它只写插件底部工作台(原生右侧栏的 tab 不在
bottomSplits 里),现按承载面分流 —— 原生 tab 走 service.openTab(target:'side') →
宿主 openResource(preferNewPane, revealIfOpened:false) 真正分栏;底部工作台行为不变
(接入 API 变更已同步 docs/external-plugin-guide.md)
验证:typecheck / lint / test(135 文件 1461 通过)/ build 全绿;
DSH_CMD='npx -y --package @deepseek-ai/dsh@0.1.7-rc.1 dsh' pnpm test:mount 7/7 通过;
新增/更新测试:menu-perf(3)、archive(10)、open-in-app(18)、open-with(10)、multiselect(9)、
zip(37)、service(64)、editor-host(11)、builtins(23)、locales(20)
2026-09-28 20:11:46 +08:00
gyixuan
bc1c6be747
test(native): pin activate-focus and close-meta; document the native lifecycle
...
- five cases over the real createNativeSurface: activate rides
ISidebarRight.focus for a known record (and stays a no-op for unknown
ids), close hands the record meta back and rides the on-screen face
for the mounted session (per-session face otherwise)
- one service-level case: closeTab hands the native close meta through
to descriptor.onClose
- guide: activateTab's native path (focus via ISidebarRight.focus,
dsh >= 0.1.5) and the close-meta carry, including the standing gap
that a user-initiated x-close never reaches onClose
2026-09-28 14:38:12 +08:00
Menghuan1918
2e94b56c36
chore(release): v0.22.1——修复 files 接管 id 孤儿化与 macOS 拖拽失效
...
- package.json / dsh.plugin.json / SIDEBAR_SERVICE_VERSION → 0.22.1(三者锁步由
tests/service.spec.ts 与 tests/manifest-consistency.spec.ts 断言)
- README / README_EN:新增 v0.22.1 条目、同步三处徽章与 latest/支持线表格、
切回 npm 通道的示例版本号;「最近更新」保持两条(v0.22.1 + v0.22.0),
更早版本指针区间随之下移为 v0.21.1 → v0.12.3
- docs/external-plugin-guide.md:当前版本行 → v0.22.1
- CHANGELOG / CHANGELOG_EN:补 v0.22.1 条目(两个缺陷的根因链、真机证据、
修复要点与守卫清单)
支持线**不变**:仅 DSH 0.1.7-rc.1+(peer 下限 ^0.1.7-rc.1,CI 钉 0.1.7-rc.1);
0.21.1 / 0.22.0 用户直接升级;0.1.6-alpha.2 及更早仍固定 v0.19.1。
内容提要:① 修复客户端条目替换后 `dsh-better-sidebar:files` id 被孤儿化
(#777 + #785:清理循环跳过 FILES_KIND + 注册失败回滚已占用的 id 与槽位,
并新增部署级回归门 tests/e2e/native-reload.e2e.ts);② 修复 macOS 桌面版
窗口拖拽/双击缩放失效(#773 + #786:视口层用 initial !important 退出
app-region 计算,补齐放大视图,探针改用真实级联计算值)。
验证:make check 全绿(typecheck / lint / build / test 122 files 1293 passed
9 skipped / check:consumer-types);此外本地 pnpm test:mount 与
pnpm test:mount:aggregate 绿,npm 0.22.0 与修复版在 scratch profile 上的
红→绿对照见 PR #785 / #786。
2026-09-28 11:23:48 +08:00
Menghuan1918
e7d2300cf8
fix(review): 按独立 review(Chromium 实测)修正 #786 的措辞、守卫与覆盖
...
reviewer 在本机跑 Chromium 逐条实测(同一批宿主规则 + 插件产物),结论:修复方向与形状正确
(`.mermaidModal` 预修复计算 `no-drag`、修复后 `none`;级联探针确实能把未修复产物判红),
但有几处措辞与守卫不到位。逐条处理:
1. **「app-region 会被继承」的说法在该引擎里不成立**:`[data-dsh-panel-host]` 不是 body
子元素(DOM 是 `body > [data-dsh-better-sidebar] > [data-dsh-panel-host]`),lane 用的
Chromium 不传播该属性(实测:`drag` 父元素里子元素读 `none`)。改写成「宿主是 body
子元素;在 Electron 里该值会传到它内部的面板层(#772 的 CDP 实测),lane 的引擎不传播,
所以面板层自己也声明同一条规则」——CSS 注释、指南 §12.1、探针注释三处同步。
2. **`regions.layer` 那条断言是真空断言**(修复前后都读 `none`):保留为回归钉子,但在
注释里明确标注它不具判别力、面板层的规则由 `panel-host-css.spec.ts` 钉住。
3. **给修复本身补行为级守护**:放大视图已经在同一 lane 里被真实打开过,于是在那里直接对
`[data-mermaid-modal]`(以及它的按钮)读计算值——断言用**页面里宿主自己的** darwin
规则(不再是探针复制的副本)。实测判别力:npm 0.22.0 上 `Received: "no-drag"`、修复版
`none`。
4. **「交互层不要加 initial」与放大视图的矛盾**:放大视图是**遮罩层例外**——模态语义下
只有其中控件必须保持 `no-drag`;残余代价(背景落在顶部拖拽带上时点背景会变拖窗)已写进
指南,避免后来者按字面判据「修」掉其中一边。
5. **`.selectionPopup` 的负向守卫可被选择器列表绕过**(reviewer 实测:`.selectionPopup,.x
{ initial !important }` 能通过):改成按**声明块**扫描——凡带 `-webkit-app-region:
initial` 的块,其选择器文本都不得出现 `selectionPopup`。
6. **补上 `none` 关键字的坑**:字面量 `none` 计算成 `no-drag`(是扣减值),只有 `initial`
/`unset`/`revert` 才是中性值——CSS 注释、指南与单元用例注释都已写明。
7. **未覆盖层给出结论**:`FileTree` 的 `.uploadDropChatHint` 是 body 直挂的装饰层,但只在
OS 文件拖拽悬停期间存在且 `pointer-events:none`,收益极小而**有意不处理**(写进指南,
不再让「覆盖清单」看起来是绝对集合)。
8. 顺带:`§12.2` 的同步集里 `tests/theme.spec.ts` 只守颜色(本轮无颜色改动),形状守护落在
已解析该样式表的 `tests/panel-host-css.spec.ts` 上——指南那句已按此表述。
验证:typecheck / lint 通过;panel-host-css 4 例通过;本地挂载 lane 7 passed(含新的放大
视图计算值断言);对 npm 0.22.0 的判别力实测:宿主探针红(`host` = `no-drag`)、放大视图
断言红(`modal` = `no-drag`),修复版全绿。
2026-09-28 11:17:03 +08:00
Menghuan1918
b07c7116c8
fix(desktop): 补齐 mermaid 放大视图的拖拽区退出 + 把 #772 的守卫换成真实级联探针
...
#773 修掉了面板宿主层继承宿主 `body > :not(#root) { no-drag }` 导致的 macOS 拖拽
失效,但只覆盖了 `.mermaidModal` 之外的层——而放大视图是插件**第二个铺满视口的
body 直挂层**(`position:fixed; inset:0`,portal 到 body),打开期间会同样清空整窗
拖拽与 macOS 双击标题栏缩放。
- src/client/sidebar.module.css:`.mermaidModal` 加 `-webkit-app-region: initial
!important`(与面板宿主同一条契约),并在面板宿主那段注释里写明「哪些交互层
绝对不能加 initial」(`.selectionPopup` 是 `<button>`、FloatingWindow /
AnchoredPopover 自带指针拖拽,宿主 `:is(button, …)` 已给它们 no-drag;反过来
声明 `initial !important` 会让按下变成拖窗,重演 #103/#111)。
- tests/panel-host-css.spec.ts:新用例把形状钉在 Linux 的 `pnpm test` 里(宿主层
与面板层必须是 `initial !important`、`> *` 必须是 `no-drag`、`.mermaidModal`
同样退出、`.selectionPopup` 不得出现 `initial`)——没有 macOS runner,丢掉
`!important` 只能靠这里才不会静默复发。
- tests/e2e/mount.e2e.ts:把 #773 的**文本正则**断言换成**真实级联探针**——逐字
注入宿主两条 darwin 规则、翻转 `data-platform=darwin`,读取计算值并断言
`[data-window-drag]` 仍 `drag`、宿主层与面板层为 `none`、`[data-dsh-panel-host]
> *` 为 `no-drag`,随后还原。探针把 `[data-window-drag]` 放在 `#root` 内:直挂
body 的元素会被宿主那条 id 级规则本身命中(这正是问题机制)。
- docs/external-plugin-guide.md §12.1:按仓库规则同步这条皮肤契约(含交互弹层
的反例判据与守卫位置)。
实测(scratch profile + 真实 dsh web + Chromium):
- npm dsh-better-sidebar@0.22 .0:探针红,`host` 计算值 `no-drag`(正是线上症状)
- 本分支打包版:探针绿(`strip=drag` / `host=none` / `layer=none` / `child=no-drag`)
- 本地挂载 lane:7 passed(mount + perf,含新探针)
验证:typecheck / lint 通过;panel-host-css + theme 用例通过;新产物
`app-region:initial!important` 2 处(面板宿主 + mermaid 模态)、`app-region:no-drag` 2 处。
2026-09-28 11:04:52 +08:00
Menghuan1918
36fbc5ac7e
feat(sidebar): 文件页与文件变动页 UIUX 重构 + 全局组件抽取
...
文件页(FileTree/TreePanel)
- Ctrl/Cmd 多选 + Shift 按可见行序连选(Esc/点空白/右键收敛),批量条支持复制路径、批量删除(共享 ConfirmDialog + 顺序 fsRemove)
- Git 变更着色:行名按状态上色 + M/A/D/U 徽标,目录按 dirHasChanges 着色,非仓库静默降级(数据来自共享 git 状态存储)
- 新建文件夹:fs.mkdir 路由 + mkdirWorkspaceEntry + 内联输入行(Enter/Esc/blur/IME 守卫)
- 性能:FileRow/DirRow memo(含反向验证)、搜索 hidden 停车不再卸载树、level 拉取世代守卫 + AbortController、fs.tree truncated 提示、use-dir-watch 入参 memo
- 拖拽上传视觉 token 化(硬编码色清零);可见性下传后隐藏页签停止轮询
- 右键「打开方式」改为复用 DSH 自带 open-in-app(宿主探测的关联应用 + 文件管理器显示)
文件变动页(changes/diff)
- 36px 头(宿主 SegmentedControl)+ 单一 ChangeRow + SectionHeader 分组 + 吸底提交条单状态行 + 历史独立空态
- 修掉:双份空态、暂存失败 unhandled rejection、手动刷新被丢、仓库切换刷新两次、worktree 清单缺 repoRoot、工作树被自动切走、预览持旧快照、恢复高度未 clamp、session ops 无谓轮询
- DiffPane/DiffTab 共用 use-git-diff;修掉 DiffPane 的 untracked 预览从不渲染
全局组件与宿主接入
- 新增 src/client/ui(IconButton/Chip/SectionHeader/Notice/ConfirmDialog/StatusBadge + 共享 git 状态存储)
- 新增 src/client/open-in-app.ts(宿主 open-in-app 客户端适配),删除自研 open-with 全链路与 open.external 路由
- 客户端 inject 补 remote / remote.session:缺声明时 ctx.get('remote').session 会抛出并把整个面板打成错误条(真实挂载 lane 抓到)
- 词典:+25 键 / -20 openWith* / -noChanges,20 份同步
验证:typecheck / lint / test(126 文件 1322 通过)/ build 全绿;
DSH_CMD='npx -y --package @deepseek-ai/dsh@0.1.7-rc.1 dsh' pnpm test:mount 7/7 通过(含 tab sweep 与 perf lane)
2026-09-28 00:27:31 +08:00
Menghuan1918
606339f81e
chore(release): v0.22.0——任务管理页重做(工作流图)+ DSH 0.1.7 团队/后台任务数据面
...
版本号 bump 到 0.22.0(含 dsh.plugin.json 与 SIDEBAR_SERVICE_VERSION 两处镜像,
tests/manifest-consistency.spec.ts 与 tests/service.spec.ts 就是守这两处的),
README / README_EN 的版本徽章、支持线表格、npm 通道说明与「最近更新」段落同步,
CHANGELOG / CHANGELOG_EN 补 v0.22.0 条目正文。
支持线**不变**:仅 DSH 0.1.7-rc.1+(peer 下限 ^0.1.7-rc.1),0.21.1 用户可直接升级。
主内容是任务管理页从「子代理拓扑」重做为工作流图(图/树双视图、双段式节点卡、
主 Agent 同款合并活动行、扫光、两组折叠聚合、两个常驻浮动窗),以及随后按真机反馈
打磨的四轮修正;团队与后台任务两个数据面按 0.1.7 删掉的 Remote 方法/自建路由改写。
验证:typecheck / lint 通过;pnpm test 1288 passed / 9 skipped;build + pack 产出
dsh-better-sidebar-0.22.0.tgz。
2026-09-27 22:33:57 +08:00
Menghuan1918
d38fefe55d
feat(tasks): 任务输出常驻浮动窗 + 节点卡去竖线 + 手机设置
...
三件事一起落地(用户 brief),各自独立可验证:
1) 后台任务输出改为常驻浮动窗
- 新增 src/client/FloatingWindow.tsx + .module.css:可复用组件,标题栏(拖拽手柄 +
复制/关闭)、内容区(自滚动,长输出不再跑出视口)、可选底部行、三个拉伸柄
(右/下/右下)。生命周期与 AnchoredPopover 相反:外部点击、失焦、锚点离屏都不关,
只有关闭按钮与 Escape 结束;尺寸只在挂载时量一次(流式输出帧不会挪动读者摆好的窗);
拖拽保持整窗在视口内(放不下才退化到保留 48px 可达);视口变化时夹回。
- 手势复用既有范式:移动走 window 级 pointermove(同 AnchoredPopover),拉伸走
setPointerCapture + createFrameBatcher(同 EditorHost 的面板拉伸)。
- JobOutputPopoverContent → JobOutputWindow;顺带修掉「跟随最新」从不滚动的 bug
(原先滚的是 TerminalBlock 外面那个永不滚动的 div),并清掉随旧弹窗死掉的
.popPre / .jobPopPre 规则。节点/工作流详情与任务窗保持原样。
2) 节点卡统一
- 删除两条左侧竖条(层级条 .cardTop::before、当前会话条 .nodeCurrent::before);
层级改由上段极淡底色承担(7/5/3.5/2.5% → 9/7/5/3.5% 补偿对比度);
当前会话改为 2px accent 描边(「边框加粗高亮」)。
- 圆角 4px → 8px(与浮动窗同一家族);成员/工作流/聚合按用户选择保留类型区分。
- 2px 而非 1.5px:真机 recon 发现 Chromium 在 DPR 1 下把亚像素边框向下取整,
1.5px 的「加粗」完全看不出(实测 borderTopWidth: "1px")。几何不受影响
(border-box + min-height,卡片外框 247×134 与预算逐像素一致)。
3) 手机设置
- 两个新偏好 mobileNoAutoOpen / mobileDefaultTree(默认都开),落到 prefs-shared、
PrefsSchema(volatile 自动)、parsePrefs 校验与设置页新增的「手机」分组。
- 窄屏(沿用 768px 断点)时:新子代理与新后台任务都不再自动激活任务页;
任务页默认树状图(页内切换仍是临时覆盖)。宽屏或开关关掉后行为完全不变。
- 5 条词条 ×20 份词典;外部插件指南的 PrefsSchema 键清单同步。
验证:typecheck / lint ✅ ;pnpm test 1254 passed / 9 skipped(新增 14 例);
挂载 lane 7/7(真实 DSH 0.1.7-rc.2);3080 真机自测通过(长输出窗口内部滚动
5459px/449px、拖拽 424→304、拉伸 1008×540→918×480、外部点击不关、Escape 关、
卡片 8px/2px/无竖条、窄屏不自动弹出且默认树状图)。
(cherry picked from commit 7d9b428c6c34d28ad2d60c2086496eb533902273)
2026-09-27 22:18:57 +08:00
Menghuan1918
a71d158f9a
revert(tasks-ui): drop the shadcn/Tailwind layer and return to the plugin's own UI system
...
shadcn's defaults are built for a standalone app: 14px body, 36px controls,
solid primary fills and elevation read as a foreign surface next to this
plugin's own tabs (files, changes, side chat, settings), which are 12/11/10px
type, 28px controls, hairline borders and flat panels. Retuning the layer did
not converge, so the layer goes.
- Removed: src/client/ui/** (21 vendored components), components.json,
scripts/ui-css.mjs, the Tailwind/PostCSS compile step in tsdown, and the deps
tailwindcss / @tailwindcss/postcss / postcss / radix-ui /
class-variance-authority / tailwind-merge. (diff and simple-icons stay: they
patch undeclared bare imports of the host primitives, unrelated to shadcn.)
- The seven page surfaces are back on the plugin's own base: *.module.css with
--dsw-* tokens plus the host primitives (Button/Menu/Modal/Pill/Tag/Switch/
Input/Tooltip/StateDot/MarkdownText). Behaviour, data-* hooks, aria labels,
i18n keys and the AnchoredPopover geometry/drag/dismiss contract are
unchanged; the non-styling fixes landed during the shadcn era (model id
dedupe, task-window CAS, drawer arming, popover dragging, the chunk packaging
glob) were re-applied and are covered by the existing specs.
- The tasks page returns to the core bundle: `tasks` left CHUNK_NAMES /
CHUNKS / ChunkName, src/client/chunks/tasks.tsx is gone and tabs.tsx imports
SubagentView directly.
- The reverted stylesheet was retuned to the plugin's measured vocabulary
(12/11/10px, 28px controls, border-l2 with border-l1 hairlines, hover fills,
no static shadows, --dsw-shadow-lv2/3 on floating layers only) and verified
against a 70-assertion real-browser contract; the harness's own two
measurement defects were fixed with a falsification test proving the
assertions still catch injected regressions (56/70, 14 FAIL).
- Tests: ui-foundation / ui-bundle / ui-shadows (the shadcn guards) deleted,
theme.spec scoped back to the plugin's own stylesheets, bundle-route and
manifest-consistency chunk lists back to four. Docs: AGENTS.md and the plugin
guide drop the Tailwind/shadcn guidance; the design doc marks those sections
superseded and records why the layer was removed.
Verified: typecheck/lint clean; 133 files / 1410 tests; core bundle 987.3 KiB
with no radix-ui/--tw-/tailwind strings and no client-tasks.js; mount e2e 7/7;
20 real-browser screenshots at 360/720 for graph, tree, board, task window,
drawer (including armed), both popovers and the 77-node fixture.
2026-09-27 22:18:19 +08:00