dsh-linked-workspace 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.en.md +31 -0
- package/README.md +31 -0
- package/docs/API.md +7 -3
- package/docs/VERIFY.md +25 -0
- package/lib/client.js +625 -34
- package/lib/index.js +326 -18
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0 — 2026-11-12
|
|
4
|
+
|
|
5
|
+
Third review round: in-editor editing, local/remote comparison and drag-and-drop, plus refresh behaviour.
|
|
6
|
+
|
|
7
|
+
- **Find and replace (feature)**: `Ctrl/Cmd + F` opens an in-editor bar with a case-sensitive toggle, previous/next, a match counter, replace and replace all. Matching stops at 5000 hits and the counter shows `5000+` when more exist; replace-all still edits the whole document (6000 replacements verified).
|
|
8
|
+
- **Terminal in a directory (feature)**: the tree context menu gains “Open terminal here” for folders. `terminal.open` accepts an optional `path`, validated to stay inside the linked workspace, and starts the shell in that directory (verified with a real `ssh -t … "cd <dir> && exec bash -l"` process).
|
|
9
|
+
- **Filter in the path pickers (feature)**: the local and remote directory pickers filter already-loaded entries while typing, with an empty-state hint.
|
|
10
|
+
- **Local/remote comparison (feature)**: `fs.compare` compares a remote directory with its local counterpart and returns only-local / only-remote / changed entries (size differs, or mtime differs by more than 2 s), capped at 4000 files, depth 12 and 200 rows per group with a `truncated` flag. The dialog lists the three groups; clicking a row opens it.
|
|
11
|
+
- **Multi-select and batch actions (feature)**: Ctrl/Cmd-click toggles a row, Shift-click extends the selection; the context menu offers “Transfer selected (N)” and “Delete selected (N)” with a confirmation dialog, and per-item errors are aggregated (a file deleted outside the app reports “path does not exist” while the others are removed).
|
|
12
|
+
- **Drag and drop (feature)**: drag rows between the local and remote trees (a remote file is copied through `fs.pullToLocal`, a local file through `fs.upload`), and drop OS files onto either tree (`fs.upload` / `local.import`; up to 50 files, 64 MB each). If the browser hides file paths, or a remote folder is dropped onto the local tree, a notice explains the limitation instead of failing silently.
|
|
13
|
+
- **Refresh throttling**: the 4-second tick now refreshes each directory at most every 15 seconds and pauses while the page is hidden (measured intervals 18–19 s), so a large tree no longer re-lists on every tick.
|
|
14
|
+
- **Unsaved-changes guard**: a dirty editor registers `beforeunload`, so reloading or closing the window asks for confirmation.
|
|
15
|
+
- **Refresh keeps loaded rows**: a silent refresh merges the first page with already-loaded rows instead of truncating back to 500 (or 5000); a 5500-entry directory stayed at 5522 rendered rows across refresh cycles.
|
|
16
|
+
- **Search truncation**: results over the 200-row cap now show “showing the first 200 matches” instead of dropping the flag.
|
|
17
|
+
- **Load-more and counter fixes**: “Load more (0 left)” disappears once everything is loaded; the find counter reports `5000+` instead of pretending the document has exactly 5000 matches.
|
|
18
|
+
- Review note: two previously reported issues (no context menu in the right-sidebar tree, hidden-file toggle not refreshing expanded folders) were re-tested and could not be reproduced; neither was changed.
|
|
19
|
+
|
|
20
|
+
## 0.8.3 — 2026-11-11
|
|
21
|
+
|
|
22
|
+
Second review round: follow-ups to the 0.8.2 paging and preview work.
|
|
23
|
+
|
|
24
|
+
- **Preview overlay (medium)**: the sanitizer now strips inline `style` attributes as well. A document containing `<div style="position:fixed;inset:0;z-index:99999;background:#fff">` used to cover the whole DSH window and could impersonate a login page (click-jacking / phishing without any script).
|
|
25
|
+
- **Paging survives refresh (medium)**: the local tree refreshes every 4 seconds; it now re-requests only the number of entries already loaded instead of resetting to the first page, so “Load more” results no longer disappear after up to 4 s.
|
|
26
|
+
- **Paging offset with hidden files (medium)**: “Load more” uses the raw server offset, so with hidden files toggled off entries are neither duplicated (200 duplicates before) nor skipped; the remaining count follows the same offset.
|
|
27
|
+
- **Directory listing cache (medium)**: `fs.list` caches a listing for 5 seconds, so paging a huge directory reads it once instead of re-running a full `listDir` (20,000 entries: ~10.4 s per call). Writes, mkdir, rename, move, delete, copy and transfers invalidate the cache, and `limit` is clamped server-side to 1..5000.
|
|
28
|
+
- **Partial copy cleanup (low)**: if a directory copy fails midway (for example on a >64 MB file), the partial target is removed and the error is `FS_INCOMPLETE`; `FS_TOO_LARGE` now only means an actual size cap.
|
|
29
|
+
- **Connection reuse (low)**: `HostPool` keys in-flight connects by host *and* authority, so an address change cannot attach an old connection to a new request; a connection replaced while connecting is disposed instead of leaked, and `setHosts` clears stale pending entries.
|
|
30
|
+
- **Right-sidebar requests (low)**: the linked-workspace tree source de-duplicates in-flight loads instead of sending the same request twice.
|
|
31
|
+
- **Large pickers and PDF export (low)**: the local/remote directory pickers render at most 500 entries plus a “type the path directly” note; markdown-to-PDF export stops after 999 name suffixes with an explicit error instead of looping forever.
|
|
32
|
+
- **Tests**: fixed two self-inconsistent assertions in `test/host-api.mjs` (a folder left behind made a later create return 409, and an already-existing folder was expected to answer 400); the suite now passes all 28 steps.
|
|
33
|
+
|
|
3
34
|
## 0.8.2 — 2026-11-11
|
|
4
35
|
|
|
5
36
|
Three-day review round: security, data-integrity and large-directory fixes.
|
package/README.en.md
CHANGED
|
@@ -119,6 +119,37 @@ Old “Remote directories” tabs are restored after refresh through hidden lega
|
|
|
119
119
|
|
|
120
120
|
See [CHANGELOG.md](CHANGELOG.md) for the full version history.
|
|
121
121
|
|
|
122
|
+
### 0.9.0
|
|
123
|
+
|
|
124
|
+
In-editor find/replace, local↔remote comparison, multi-select and drag-and-drop, plus refresh fixes (third review round):
|
|
125
|
+
|
|
126
|
+
- **Find and replace**: `Ctrl/Cmd + F` opens a find bar with a case-sensitive toggle, previous/next, a match counter, replace and replace all. Matching stops at 5000 hits and the counter shows `5000+`; replace-all still edits the whole document (6000 replacements verified).
|
|
127
|
+
- **Open a terminal in a directory**: the folder context menu offers “Open terminal here”; `terminal.open` accepts a validated `path` and starts the shell there (verified as a real `ssh -t … "cd <dir> && exec bash -l"` process).
|
|
128
|
+
- **Picker filtering**: the local and remote directory pickers filter already-loaded entries as you type, with an empty-state hint.
|
|
129
|
+
- **Local/remote comparison**: `fs.compare` reports only-local / only-remote / changed entries (size differs or mtime differs by more than 2 s), capped at 4000 files, depth 12 and 200 rows per group with a truncation flag; clicking a row opens it.
|
|
130
|
+
- **Multi-select and batch actions**: Ctrl/Cmd-click toggles, Shift-click extends; the context menu offers “Transfer selected (N)” and “Delete selected (N)” with confirmation, and per-item errors are aggregated.
|
|
131
|
+
- **Drag and drop**: drag rows between the two trees (remote files via `fs.pullToLocal`, local files via `fs.upload`) and drop OS files onto either tree (`fs.upload` / `local.import`; up to 50 files, 64 MB each). Clear notices cover browsers that hide file paths and remote folders dropped onto the local tree.
|
|
132
|
+
- **Refresh throttling**: each directory refreshes at most every 15 seconds and not at all while the page is hidden (measured 18–19 s), instead of re-listing on every 4-second tick.
|
|
133
|
+
- **Unsaved-changes guard**: a dirty editor registers `beforeunload`, so reloading or closing the window asks for confirmation.
|
|
134
|
+
- **Refresh keeps loaded rows**: a silent refresh merges the first page with the rows already loaded instead of truncating back to 500 (or 5000); a 5500-entry directory stayed at 5522 rendered rows.
|
|
135
|
+
- **Search truncation**: more than 200 matches now shows “showing the first 200 matches” instead of dropping the flag.
|
|
136
|
+
- **Load-more and counter fixes**: “Load more (0 left)” disappears when everything is loaded; the find counter reports `5000+` when the limit is hit.
|
|
137
|
+
- Review note: two earlier findings (no context menu in the sidebar tree, hidden-file toggle not refreshing) could not be reproduced and were not changed.
|
|
138
|
+
|
|
139
|
+
### 0.8.3
|
|
140
|
+
|
|
141
|
+
Follow-up fixes to the 0.8.2 paging and preview work (second review round):
|
|
142
|
+
|
|
143
|
+
- Document previews now also drop inline `style` attributes, so a `position:fixed` overlay can no longer cover the whole app and impersonate a login page (click-jacking/phishing surface).
|
|
144
|
+
- Tree refreshes (the local tree every 4 s) re-request only the entries already loaded, so “Load more” results are no longer reset to the first page.
|
|
145
|
+
- With hidden files toggled, “Load more” uses the true server offset: entries are neither duplicated nor skipped, and the “N left” label is computed from that offset.
|
|
146
|
+
- `fs.list` gained a 5-second listing cache: paging reads the directory once, and any write, mkdir, rename, move, delete, copy or transfer invalidates it.
|
|
147
|
+
- A directory copy that fails midway removes the partial copy and reports `FS_INCOMPLETE`; `FS_TOO_LARGE` is now reserved for real size limits.
|
|
148
|
+
- Concurrent first connects are keyed by host *and* address, so an address change cannot hand the old connection to the new request, and replaced connections are released.
|
|
149
|
+
- The right-sidebar tree source de-duplicates in-flight loads instead of issuing the same request twice.
|
|
150
|
+
- Directory pickers render at most 500 entries and suggest typing the path; PDF export stops after 999 name suffixes with an explicit error instead of looping forever.
|
|
151
|
+
- Tests: two self-inconsistent assertions in `test/host-api.mjs` were fixed (a leftover folder made a later create return 409, and an existing name was expected to return 400); all 28 steps now pass.
|
|
152
|
+
|
|
122
153
|
### 0.8.2
|
|
123
154
|
|
|
124
155
|
Security, data-integrity and large-directory fixes from the three-day review round:
|
package/README.md
CHANGED
|
@@ -114,6 +114,37 @@ dsh plugin --profile "$DSH_PROFILE" add "file:$PWD/dsh-linked-workspace"
|
|
|
114
114
|
|
|
115
115
|
已打开的旧右侧栏「远程目录」标签页会在刷新后自动恢复(插件保留了两个隐藏的旧 tab 类型别名),标签标题也会自动改成「联动工作区目录」,新开的标签使用新的 `dsh-linked-workspace` 类型。
|
|
116
116
|
|
|
117
|
+
### 0.9.0 变化
|
|
118
|
+
|
|
119
|
+
编辑器内查找替换、本地⇄远端对比、多选与拖拽,以及刷新行为修复(第三轮评审):
|
|
120
|
+
|
|
121
|
+
- **编辑器查找/替换**:`Ctrl/Cmd + F` 打开查找条,支持区分大小写、上一个/下一个、命中计数、替换与全部替换;命中超过 5000 处时计数显示 `5000+`,全部替换仍作用于全文(实测 6000 处全部替换)。
|
|
122
|
+
- **在目录处打开终端**:目录右键菜单新增「在此打开终端」;`terminal.open` 支持 `path` 参数(校验必须在该联动工作区内),直接在该目录启动 shell(实测为 `ssh -t … "cd <目录> && exec bash -l"`)。
|
|
123
|
+
- **路径选择器过滤**:本地/远端目录选择器支持输入过滤已加载条目,无匹配时给出提示。
|
|
124
|
+
- **本地与远端对比**:新增 `fs.compare`,返回「仅本地 / 仅远端 / 大小或时间不同(mtime 差 >2 秒)」三组,单次最多 4000 个文件、深度 12、每组最多 200 行并带 `truncated` 标记;对话框按组列出,点行可直接打开。
|
|
125
|
+
- **树多选与批量操作**:Ctrl/Cmd 点击切换选中、Shift 点击追加;右键菜单出现「传输所选的 N 项」「删除所选的 N 项」并弹确认框,逐项失败会聚合提示(外部已删除的文件会报「路径不存在」,其余照常删除)。
|
|
126
|
+
- **拖拽**:可在本地/远端两棵树之间拖动文件(远端文件走 `fs.pullToLocal`,本地文件走 `fs.upload`),也可把系统文件拖进任一树(`fs.upload` / `local.import`,最多 50 个、单个 64 MB)。浏览器不暴露文件路径、或把远端目录拖到本地树时会给出明确提示,不再静默失败。
|
|
127
|
+
- **刷新节流**:4 秒定时器改为每个目录最多 15 秒刷新一次,页面隐藏时暂停(实测间隔 18–19 秒),大目录不再每个 tick 都重列。
|
|
128
|
+
- **未保存拦截**:有未保存改动时注册 `beforeunload`,刷新/关闭窗口会弹确认。
|
|
129
|
+
- **刷新保留已加载行**:静默刷新把第一页与已加载行合并,不再截回 500(或 5000);5500 项目录在多个刷新周期后仍保持 5522 行。
|
|
130
|
+
- **搜索截断提示**:超过 200 条时显示「结果过多,仅显示前 200 条」。
|
|
131
|
+
- **加载更多与计数修正**:全部加载后「加载更多(剩余 0 项)」不再残留;查找计数满 5000 时显示 `5000+`,不再假装全文只有 5000 处。
|
|
132
|
+
- 复核说明:上一轮报告的两项(右侧栏树无右键菜单、切换隐藏文件后不刷新)复测未能复现,本轮未改动。
|
|
133
|
+
|
|
134
|
+
### 0.8.3 变化
|
|
135
|
+
|
|
136
|
+
针对 0.8.2 分页与预览的后续修复(第二轮评审):
|
|
137
|
+
|
|
138
|
+
- 文档预览同时删除内联 `style`,`position:fixed` 全屏覆盖层不再能把整页伪装成登录页(点击劫持/钓鱼面)。
|
|
139
|
+
- 目录树刷新(本地树每 4 秒)只重取已加载的条目数,不再把「加载更多」的结果打回第一页。
|
|
140
|
+
- 含隐藏文件时「加载更多」用服务端真实偏移,条目不再重复或遗漏;「剩余 N 项」按真实偏移计算。
|
|
141
|
+
- `fs.list` 增加 5 秒列表缓存:翻页只读一次目录;写、建、改名、移动、删除、复制、传输后立即失效。
|
|
142
|
+
- 目录复制中途失败会清理已复制的半成品并返回 `FS_INCOMPLETE`(原 `FS_TOO_LARGE` 只用于真实超限)。
|
|
143
|
+
- 并发首次连接按「主机 + 地址」复用,主地址变化时不再把旧连接交给新地址请求,被替换的连接会释放。
|
|
144
|
+
- 右侧栏树的数据源增加请求去重,重复加载不再重复发请求。
|
|
145
|
+
- 目录选择器最多渲染 500 项并提示可直接输入路径;导出 PDF 的同名后缀最多尝试 999 次,超限报错而不是无限循环。
|
|
146
|
+
- 测试:修复 `test/host-api.mjs` 自身两处断言缺陷(重复创建文件夹残留、把已存在当 400),全套 28 步通过。
|
|
147
|
+
|
|
117
148
|
### 0.8.2 变化
|
|
118
149
|
|
|
119
150
|
安全、数据完整性与大目录体验修复(三日评审轮):
|
package/docs/API.md
CHANGED
|
@@ -58,7 +58,7 @@ relative to the scope root, or absolute inside it.
|
|
|
58
58
|
| `workspaces.remove` | `{ id }` | `{}` |
|
|
59
59
|
| `workspaces.rename` | `{ id, name }` | `{ workspace }` |
|
|
60
60
|
| `workspaces.test` | `{ id }` | `{ ok, latencyMs?, resolvedPath?, error? }` |
|
|
61
|
-
| `fs.list` | `{ workspaceId?/linkedId?, path, limit?, offset? }` | `{ path, entries: RemoteEntry[], total, offset, limit, hasMore }` (default 500, max 5000) |
|
|
61
|
+
| `fs.list` | `{ workspaceId?/linkedId?, path, limit?, offset? }` | `{ path, entries: RemoteEntry[], total, offset, limit, hasMore }` (default 500, max 5000). Listings are cached for 5 s for `offset > 0`; writes, mkdir, rename, move, delete, copy and transfers invalidate the cache. |
|
|
62
62
|
| `fs.read` | `{ workspaceId?/linkedId?, path, maxBytes? }` | `FileRead` |
|
|
63
63
|
| `media.read` | `{ workspaceId?/linkedId?, path }` | `{ path, size, mtime, mime, base64 }` (PNG/JPG/GIF/WebP/BMP/ICO/AVIF/SVG, max 24 MB) |
|
|
64
64
|
| `fs.write` | `{ workspaceId?/linkedId?, path, content, expectedMtime?, createOnly? }` | `{ path, size, mtime }` (`createOnly: true`: existing target → 409) |
|
|
@@ -81,14 +81,17 @@ relative to the scope root, or absolute inside it.
|
|
|
81
81
|
| `linked.syncCancel` | `{ id }` | `{ cancelled: boolean }` |
|
|
82
82
|
| `local.list` | `{ path, limit?, offset? }` | `{ path, entries: [{ name, path, type, size, mtime }], total, offset, limit, hasMore }` |
|
|
83
83
|
| `local.openExternal` | `{ path }` | `{ opened, path }` |
|
|
84
|
-
| `terminal.open` | `{ workspaceId?/linkedId?, side: 'remote'\|'local' }` | `{ opened, side, path, host? }` |
|
|
84
|
+
| `terminal.open` | `{ workspaceId?/linkedId?, side: 'remote'\|'local', path? }` | `{ opened, side, path, host? }` (`path` must stay inside the linked workspace) |
|
|
85
85
|
| `fs.openExternal` | `{ workspaceId?/linkedId?, path }` | `{ opened, localPath, size }` |
|
|
86
86
|
| `localWorkspace.create` | `{ path, name? }` | `{ workspaceId, title, path }` |
|
|
87
87
|
| `session.info` | `{ sessionId }` | `{ sessionId, cwd, running }` |
|
|
88
88
|
| `skills.list` | `{ linkedId }` | `{ localPath, skills: [{ name, description, whenToUse, path, source }] }` |
|
|
89
89
|
| `skills.read` | `{ linkedId, name }` | `{ name, description, content, path }` |
|
|
90
90
|
| `git.status` | `{ workspaceId?/linkedId?, side: 'remote'|'local' }` | `{ ok, repo, root, branch, changes, error? }` |
|
|
91
|
-
| `fs.search` | `{ workspaceId?/linkedId?, side, query, maxResults? }` | `{ ok, query, entries, truncated }` |
|
|
91
|
+
| `fs.search` | `{ workspaceId?/linkedId?, side, query, maxResults? }` | `{ ok, query, entries, truncated }` (matches file names, not contents) |
|
|
92
|
+
| `fs.compare` | `{ workspaceId?/linkedId?, path? }` | `{ path, relative, localPath, localMissing, counts: { onlyLocal, onlyRemote, changed, same }, onlyLocal, onlyRemote, changed, truncated }` (linked workspaces only; excludes `.git`, `node_modules`, `.local`, `.remote`; max 4000 files, depth 12, 200 rows per group) |
|
|
93
|
+
| `fs.pullToLocal` | `{ workspaceId?/linkedId?, path, targetDir? }` | `{ path, relative, size, mtime }` (single file, ≤64 MB; `targetDir` must stay inside the local root) |
|
|
94
|
+
| `fs.upload` | `{ workspaceId?/linkedId?, path, paths }` | `{ side: 'remote', target, files, bytes, skipped }` (≤50 local files, 64 MB each) |
|
|
92
95
|
| `fs.transfer` | `{ workspaceId?/linkedId?, path }` | `{ files, bytes, skipped, truncated, dest }` |
|
|
93
96
|
| `fs.download` | `{ workspaceId?/linkedId?, path }` | `{ path, files, bytes, skipped, truncated }` |
|
|
94
97
|
| `fs.edit` | `{ workspaceId?/linkedId?, path, app? }` | `{ localPath, size }` (opens Notepad/default app) |
|
|
@@ -98,6 +101,7 @@ relative to the scope root, or absolute inside it.
|
|
|
98
101
|
| `local.media` | `{ path }` | `{ path, size, mtime, mime, base64 }` (max 24 MB) |
|
|
99
102
|
| `local.write` | `{ path, content, expectedMtime? }` | `{ path, size, mtime }` |
|
|
100
103
|
| `local.stat` | `{ path }` | `{ path, type, size, mtime, mode }` |
|
|
104
|
+
| `local.import` | `{ dir, paths }` | `{ dir, copied, skipped }` (copies OS files into `dir`, ≤50 files, 64 MB each) |
|
|
101
105
|
| `local.rename` | `{ from, to }` | `{ path }` |
|
|
102
106
|
| `local.move` | `{ path, targetDir?, root? }` | `{ path, type }` (same local tree; collision → 409) |
|
|
103
107
|
| `local.delete` | `{ path, root? }` | `{}` (recursive) |
|
package/docs/VERIFY.md
CHANGED
|
@@ -145,3 +145,28 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
145
145
|
6. **复制上限**:在远端复制一个 >64 MB 的文本/二进制文件:应提示「超过 64 MB,无法复制」,目标目录不得出现被截断的副本。
|
|
146
146
|
7. **非空目录删除(工具)**:让 agent 用 `linked_workspace` 的 `delete` 删除一个含文件的远端目录:应递归删除成功,不再报 SFTP `Failure`。
|
|
147
147
|
8. **Excel 截断提示**:打开一个 >200 行或 >40 列的 xlsx:表格上方应出现「仅显示前 200 行 × 40 列」;工作表超过 20 个时出现「仅显示前 20 个工作表」。
|
|
148
|
+
|
|
149
|
+
## 分页续修与预览覆盖(0.8.3)
|
|
150
|
+
|
|
151
|
+
1. **预览覆盖层**:放一个 Markdown 文件,内容为 `<div style="position:fixed;inset:0;z-index:99999;background:#fff;padding:24px">FAKE-LOGIN-PAGE</div>` 加一行普通文字;预览后不应出现全屏白底覆盖层,`div` 上不应残留 `style` 属性,页面其余部分照常可点。
|
|
152
|
+
2. **加载更多不被刷新清空**:在本地树展开一个 >500 项的目录,点「加载更多」后**静置 10 秒**(跨过两次 4 秒刷新):行数与剩余计数应保持不变,不回退到 500 行。
|
|
153
|
+
3. **隐藏文件下的分页**:目录中同时放 300 个 `.hidden*.txt` 与 600 个 `visible*.txt`;先关闭「显示隐藏的文件」再展开该目录,点「加载更多」:可见条目不应重复、不应遗漏,最终数量为 600,剩余计数归零。
|
|
154
|
+
4. **目录选择器上限**:进入一个含 600+ 子目录的父目录:列表面板最多显示 500 项,并提示「目录项过多,仅显示前 500 项;可直接在输入框中输入路径」;在输入框直接键入子路径仍可选择。
|
|
155
|
+
5. **翻页性能**:对 20 000 项的远端目录连续点两次「加载更多」:第二次起应明显快于首次(5 秒内命中列表缓存),且界面不卡顿。
|
|
156
|
+
6. **复制失败清理(开发核验)**:复制一个内含 >64 MB 文件的目录:应报错且目标目录不留半成品(可用 `git status` 之外的目录列表确认)。
|
|
157
|
+
7. **导出 PDF 上限(开发核验)**:同目录放 999 个同名 `<name>.pdf` 后再次导出同名的 Markdown:应提示「同名 PDF 过多,请先清理目录中的旧导出」,不进入无限循环。
|
|
158
|
+
8. **host-api 套件**:在有 SSH 主机与 DSH 运行时 Node 的机器上跑 `node test/host-api.mjs`(本机系统 Node 24.13 删除中日韩字符目录会崩溃,用 DSH 自带 Electron Node 执行):应为 28 步全部通过。
|
|
159
|
+
|
|
160
|
+
## 编辑、对比与拖拽(0.9.0)
|
|
161
|
+
|
|
162
|
+
1. **查找/替换**:打开一个含 6000 处 `beta` 的文本文件,`Ctrl/Cmd + F` 输入 `beta`:计数应显示 `第 1 / 5000+ 个`;把替换框填成 `gamma` 点「全部替换」,正文应替换全部 6000 处(不只是 5000 处),保存后文件内容一致。
|
|
163
|
+
2. **在此打开终端**:右键远端子目录 →「在此打开终端」:应弹提示「已打开终端」,并出现一个 `ssh -t … "cd <该目录> && exec bash -l"` 的终端窗口(开发核验:`Get-Process ssh | Select-Object CommandLine`)。
|
|
164
|
+
3. **本地与远端对比**:让远端目录只多一个文件、本地只多一个文件、同名的两个文件大小不同;右键远端目录 →「与本地对比…」:三组计数应为 1/1/1,点某一行可直接打开对应文件。
|
|
165
|
+
4. **多选与批量删除**:Ctrl+点击选中 3 个文件后,先在外部删掉其中 1 个,再「删除所选的 3 项」并确认:其余 2 个应删除成功,提示汇总出现「路径不存在」。
|
|
166
|
+
5. **拖拽(浏览器分支)**:从系统文件管理器把文件拖到树行:Web 端应提示「当前浏览器无法读取被拖入文件的路径,请在 DSH 桌面窗口中拖拽」,不产生半成品文件。
|
|
167
|
+
6. **拖拽(桌面分支)**:在 DSH 桌面窗口把文件拖到本地/远端目录行:应提示「已导入 1 个文件」,文件出现在目标目录且大小一致。
|
|
168
|
+
7. **刷新节流**:展开一个 >500 项的目录,用开发者工具记录 `local.list` 请求:相邻刷新间隔应 ≥15 秒(实测 18–19 秒),切到后台标签页后不再刷新。
|
|
169
|
+
8. **未保存拦截**:修改文件但不保存,刷新页面:浏览器应弹出离开确认;取消后编辑内容仍在。
|
|
170
|
+
9. **分页按钮**:把 >500 项的目录加载到底:`.rw-load-more` 按钮应消失,不再显示「剩余 0 项」。
|
|
171
|
+
10. **搜索截断**:在目录中放 250 个文件名含 `needle` 的文件后搜索:结果顶部应提示「结果过多,仅显示前 200 条;请输入更精确的关键词」。
|
|
172
|
+
11. **注意**:搜索按**文件名**匹配(不是内容),界面占位符「在文件中搜索…」为既有文案问题,已列入下一轮缺陷候选。
|