dsh-linked-workspace 0.26.0 → 0.27.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 CHANGED
@@ -1,7 +1,67 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.27.0 — 2026-11-26
4
+
5
+ - Markdown previews are rendered **inside the Host process** instead of by spawning
6
+ `node scripts/md-to-html.mjs`. When the DSH process had no `node` on its PATH the child run failed
7
+ and the preview silently fell back to a plain renderer, so every formula showed up as raw
8
+ `$$ … $$` text (one such desktop install hit exactly that). The renderer now lives in
9
+ `lib/markdown.js`, `scripts/md-to-html.mjs` is a thin CLI wrapper over it for standalone use and
10
+ tests, and no preview path shells out any more.
11
+ - Equation numbers sit **beside** the formula instead of on top of it. KaTeX pins `\tag{…}` with
12
+ `position: absolute; right: 0`, which parks the number on the formula itself as soon as the block
13
+ is narrower than the column — and the preview needed a narrow block so wide formulas could scroll.
14
+ Tagged formulas now keep KaTeX's block layout and lay the number out in flow (`margin-left: 1.6em`,
15
+ `position: static`, matched with `:has()` so only tagged formulas are affected), while
16
+ `min-width: max-content` keeps horizontal scrolling for anything wider than the pane.
17
+ - Markdown previews no longer collapse their formulas. The preview sanitiser used to strip the
18
+ inline `<style>` block that carries the KaTeX stylesheet — and even without that, the HTML parser
19
+ moves a leading `<style>` into `<head>`, so the fragment never survived parsing. The stylesheet is
20
+ now extracted and rendered next to the preview by React, and the sanitiser allows the small set of
21
+ length-only inline styles KaTeX uses for vertical layout (`height`, `top`, `vertical-align`,
22
+ `margin-*`, `border-*`, always `position: relative`). A dense document with 30 display formulas
23
+ renders with zero overlapping rows.
24
+ - A file opened from the **active remote workspace placeholder directory** (a markdown link in
25
+ the chat resolves against the session cwd, which is empty by design) is now handed over to the
26
+ plugin's own remote tab: the borrowed page is closed and the file opens on the remote host, where
27
+ it can be edited and saved back. The hand-over polls `nativePathTabs()` once a second because
28
+ native right-column tabs live outside the sidebar store, so `subscribeState` alone never fires.
29
+ - The workspace tree no longer hangs on **Loading…**: the panel cache stops persisting the
30
+ "currently loading" flag (a tab torn down mid-request used to come back stuck there forever),
31
+ restored records are cleaned on the way in and refetched, and a listing that produces nothing
32
+ for 20 seconds turns into **“Taking too long — click to retry”** so a dropped request is recoverable.
33
+ - The **Where the last artifact opens** setting (previously “Where artifacts open”) now shows which
34
+ choice is active: “Prefer remote tree / Prefer local copy” got the missing selected style.
35
+ - **Keyboard shortcuts** and **Allowed hosts** in the settings are collapsed by default, like
36
+ “Allowed workspaces (second layer)”, showing “Show (5)” / “Show (N ticked)” until asked for.
37
+ - Linked and remote workspaces whose SSH host is no longer in the DSH config are **skipped from the workspace list** instead of blocking `linked.list` for 20+ seconds trying to reach them.
38
+ - Markdown preview rendering now uses **micromark + KaTeX** to match DSH's native pipeline, so math formulas (`$...$` and `$$...$$`) render correctly in both the preview and the sidebar file viewer.
39
+ - The preview is self-contained: it ships KaTeX's stylesheet **inside the rendered HTML** and the host serves the KaTeX font files under `/dsh-linked-workspace/assets/`, so formulas no longer collapse when the machine is offline or the page has no CDN access. Removing the CDN link also means no third-party request per preview.
40
+ - The workspace directory panel has a **Locate last artifact** button: it asks the host
41
+ which file the chat presented most recently and opens it in the tree: the right-hand workspace pane opens (or comes forward)
42
+ and reveals that exact file, instead of guessing a local path.
43
+ - New setting **Where the last artifact opens** (设置 → 联动工作区 → 最近产物打开位置):
44
+ `remote` (default) walks the remote tree first, `local` prefers the local copy
45
+ of a linked workspace. Remote workspaces ignore the preference and only ever
46
+ open the remote side — nothing is written to the local disk.
47
+ - A file outside every workspace is reported with its real path in the notice and
48
+ copied to the clipboard, instead of silently opening the wrong tree.
49
+ - The button has its own crosshair glyph, so it no longer looks like **Transfer history**.
50
+ - Host API: `settings.revealSide`, `linked.lastArtifact`, in-process `docs.mdPreview`, `API_REVISION` 14.
51
+
3
52
  English · [简体中文](CHANGELOG.zh.md)
4
53
 
54
+ ## 0.26.1 — 2026-11-24
55
+
56
+ - The remote candidates in the `@` menu now look and behave like DSH's own "Files & folders"
57
+ group: **an icon plus the bare name** (the extra detail line is gone), a folder carries the
58
+ "enter directory · Tab" hint, and pressing Tab (or clicking it) keeps the menu open, turns the
59
+ token into `@folder/` and lists that folder — you walk the tree level by level instead of
60
+ seeing one flattened list.
61
+ - Being able to descend also means the menu no longer needs to guess: every keystroke filters the
62
+ current directory, so the group answers in a few hundred milliseconds even when the remote
63
+ folder holds thousands of entries.
64
+
5
65
  ## 0.26.0 — 2026-11-24
6
66
 
7
67
  - The `@` picker now knows which workspace a session belongs to: DSH hands the trigger
package/README.en.md CHANGED
@@ -25,7 +25,7 @@ Turn an existing SSH connection into a **linked workspace** or a **remote worksp
25
25
  - **DSH**: 0.2.1-rc.4 or newer (`engines` allows `>=0.2.0-rc.2 <0.3.0-0`).
26
26
  - **SSH**: the host lives in `~/.ssh/config`, or in DSH's SSH Manager (`dsh-ssh-tunnel`, optional). A plain `~/.ssh/config` is enough: the plugin ships its own SSH client and pins the host key on first use into `$DSH_HOME/linked-workspace/known_hosts.json` (a changed key is refused, with instructions to delete that entry). **`dsh-ssh-tunnel` is optional**: a host in `~/.ssh/config` without an `IdentityFile` can be given a password once in the “Add workspace” dialog, and it stays on this machine (see “SSH credentials” under Configuration).
27
27
  - **dsh-better-sidebar** (optional): `>=0.24.0`. It renders the sidebar directory pages and the file editor; without it everything else (settings page, directory pickers, agent tools) still works.
28
- - **Document editing** (optional): Python 3 with `python-docx`, `openpyxl`, `python-pptx` and `PyMuPDF`; set `DSH_OFFICE_PYTHON` to choose the interpreter. Markdown needs no Python.
28
+ - **Document editing** (optional): Python 3 with `python-docx`, `openpyxl`, `python-pptx` and `PyMuPDF`; set `DSH_OFFICE_PYTHON` to choose the interpreter. Markdown previews are rendered inside the plugin process — no Python, and no `node` on your PATH.
29
29
  - **Development**: Node.js ≥ 20.
30
30
 
31
31
  ## Quick start
@@ -63,6 +63,15 @@ The plugin takes over the DSH sidebar/hero directory-selection hole; the dialog
63
63
  >
64
64
  > That also explains why a workspace reads “Not connected” right after DSH starts: it means “this process has not dialled that host yet”, not “it cannot”. To find out immediately, press **Reconnect** on the card in settings — it drops the old socket, dials once, and either reports “Reconnected” with the round-trip time or shows the host's own error message.
65
65
 
66
+ ### Jump to a chat artifact in the right tree
67
+
68
+ The clock button at the left end of the directory toolbar — **Locate last artifact** — asks
69
+ the host which file the chat presented last, then opens (or raises) the right-hand pane and
70
+ reveals that file as a tab.
71
+
72
+ Settings → Linked workspaces → *Where the last artifact opens* picks the default side; a remote workspace has no local copy, so it only ever opens the remote file.
73
+
74
+
66
75
  ### Sidebar: “Linked Workspace Directory”
67
76
 
68
77
  The heading shows the free space of the remote volume that holds the workspace;
@@ -145,10 +154,10 @@ Every attempt — including refused ones — appends a line to `$DSH_HOME/linked
145
154
  - The `references` action (backed by `fs.references`) matches **path names** case-insensitively with the best match first (exact name → prefix → substring) and directories flagged `dir`, so the model can turn a file name you mention into a real remote path.
146
155
  - `@` in the composer still opens DSH's own menu (local files, folders, conversations). The plugin adds its own candidate groups to that menu:
147
156
  - inside a linked or remote workspace a single **`@`** adds a “**Remote files & folders**” group (listed first) on top of DSH's own local suggestions — it lists the workspace's remote tree; picking one inserts a real reference chip, and the model receives that remote path;
148
- - Candidates are listed **one directory at a time**: `@` opens the remote root, further characters filter by name, and a trailing `/` descends into that folder (for example `@code/` lists what is inside the remote `code/`), so a huge tree never stalls the menu;
157
+ - Rows look exactly like DSH's own "Files & folders" group: **an icon plus the bare name** (no detail line), and a folder carries an "**enter directory · Tab**" hint. Press `Tab` (or click the folder) → the menu stays open, the token becomes `@folder/` and that folder's contents are listed, so you can keep walking down level by level;
158
+ - You can still just type: `@co` filters by name and `@code/` jumps straight into the remote `code/` folder. Candidates are listed **one directory at a time** (through `fs.list`), so a remote with thousands of files still answers in a few hundred milliseconds;
149
159
  - The context menu still copies addresses: **Copy relative address** / **Copy absolute address** give the path itself, without an `@` prefix.
150
160
  - Content search gained two switches — “search usually ignored folders” (`node_modules`/`.venv`/`dist` included, `.git` always out) and “file names only” — plus a “Stop” button that cancels a running sweep; the scan stats (“Scanned N files · X”) appear above the results.
151
- - At most 30 candidates per listing and hidden files are skipped; keep typing to narrow and descend, and use the sidebar tree when you want to browse.
152
161
  - Group order: the plugin registers its trigger source with `order: -1` (DSH sorts sources by `order`, its own one uses the default 0), so “Remote files & folders” always comes first, then DSH's own “Files and folders” and “Conversations”. That second label belongs to the shell's `reference` locale namespace, so the plugin cannot rename it.
153
162
 
154
163
  ### Running icon / local skills
package/README.md CHANGED
@@ -25,7 +25,7 @@
25
25
  - **DSH**:0.2.1-rc.4 或更高(`engines` 允许 `>=0.2.0-rc.2 <0.3.0-0`)。
26
26
  - **SSH**:主机写在 `~/.ssh/config`,或加入 DSH 的 SSH Manager(`dsh-ssh-tunnel`,可选)。裸 `~/.ssh/config` 也够用:插件自带 SSH 客户端,首次连接**自动信任并记录**主机指纹到 `$DSH_HOME/linked-workspace/known_hosts.json`,指纹变化时拒绝连接并提示删除对应条目。**不安装 `dsh-ssh-tunnel` 也能用**:没有 `IdentityFile` 的主机可在这个插件的「添加工作区」弹窗里填一次密码,密码保存在本机(见「配置 → SSH 凭据」)。
27
27
  - **dsh-better-sidebar**(可选):`>=0.24.0`。装上才有右侧栏目录页与文件编辑页;缺少时其余功能(设置页、目录选择、模型工具)照常可用。
28
- - **文档编辑**(可选):Python 3 及 `python-docx`、`openpyxl`、`python-pptx`、`PyMuPDF`;可用 `DSH_OFFICE_PYTHON` 指定解释器。Markdown 不需要 Python。
28
+ - **文档编辑**(可选):Python 3 及 `python-docx`、`openpyxl`、`python-pptx`、`PyMuPDF`;可用 `DSH_OFFICE_PYTHON` 指定解释器。Markdown 预览在插件进程内渲染,不需要 Python,也不需要在 PATH 里放 `node`。
29
29
  - **开发**:Node.js ≥ 20。
30
30
 
31
31
  ## 快速开始
@@ -63,6 +63,17 @@
63
63
  >
64
64
  > 所以刚重启 DSH 时,还没打开过的工作区显示「未连接」是正常的——那是「这个进程还没连过」而不是「连不上」。想立刻确认,点设置页卡片上的**重新连接**:它会丢掉旧连接、当场拨一次号,成功就变「已连接」并显示耗时,失败则把主机的原话显示出来。
65
65
 
66
+ ### 聊天产物一键定位
67
+
68
+ 目录面板工具栏最左边有个时钟按钮 **定位最近产物**:它问宿主「这轮聊天最后展示的是哪个文件」,
69
+ 然后把右侧面板打开(或切到前台)并在树里定位、以标签页打开那个文件。
70
+
71
+ 两侧打开哪一边由「设置 → 联动工作区 → 最近产物打开位置」决定:默认优先远端,
72
+ 也可以改成优先本地副本;远程工作区没有本地副本,只会打开远端。
73
+ 文件不在任何工作区目录里时,提示里会写出实际路径并复制到剪贴板。
74
+
75
+ 「设置 → 联动工作区 → 最近产物打开位置」可以选默认走远端还是本地;远程工作区的会话没有本地副本,所以永远只开远端那一份。
76
+
66
77
  ### 右侧栏「联动工作区目录」
67
78
 
68
79
  目录栏标题右侧显示该工作区所在远端卷的可用空间,悬停可看到总量与已用百分比。
@@ -145,10 +156,11 @@
145
156
  - `references` 动作(对应 `fs.references`)按**路径名**做大小写不敏感匹配,最佳匹配排在最前(完全同名 → 前缀 → 包含),目录带 `dir` 标记;模型可以用它把你口头提到的文件名解析成远端真实路径。
146
157
  - 输入框里的 **`@`** 仍然是 DSH 原有的菜单(本地文件、文件夹、对话);插件往这个菜单里又加了一组自己的候选:
147
158
  - 只要会话属于联动/远程工作区,单打一个 **`@`** 就会在 DSH 原生的本地候选之上,多出一组「**远程文件与文件夹**」(排在最前)——列出当前工作区远端树的文件与文件夹;选中后插入一个真正的引用 chip,模型收到的是该远端路径;
148
- - 候选**每次只列一个目录**:`@` 打开远端根目录,再打字符按名字过滤,写完目录名加 `/` 会进到下一层(例如 `@code/` 列出远端 `code/` 里的内容),几千个文件也不会卡住菜单;
159
+ - 行样式与 DSH 自带的「文件与文件夹」一致:**只有图标和名字**(不再跟一条释义),目录行右侧带「**进入目录 · Tab**」提示。按 `Tab` 或直接点该目录 → 菜单不关闭、光标处的 token 变成 `@目录/`,并列出这个目录里的内容,可以一层层往下走;
160
+ - 也可以纯键盘打字:`@co` 按名字过滤,`@code/` 直接进到远端 `code/` 这一层。候选**每次只列一个目录**(走 `fs.list`),远端有几千个文件也是几百毫秒出结果,不会卡住菜单;
161
+ - 只列当前目录、最多 30 条、跳过隐藏文件;想整体浏览仍用右侧栏的目录树。
149
162
  - 右键仍然是取地址:**复制相对地址** / **复制绝对地址** 给出的是路径本身,不带 `@` 前缀。
150
163
  - 内容搜索多了两枚开关:「包含通常忽略的目录」(`node_modules`/`.venv`/`dist` 也会搜,`.git` 始终排除)、「只列文件名」;搜索中可以点「停止」中途取消,结果上方会显示「扫描 N 个文件 · X」。
151
- - 每个候选最多 30 条、跳过隐藏文件;按 `Ctrl/⌘` 逐层打字即可下钻,想整体浏览仍用右侧栏目录树。
152
164
  - 分组顺序:插件注册触发器时用 `order: -1`(DSH 按 `order` 升序排,它自己的 source 用默认 0),所以「远程文件与文件夹」总排在最前,其次是 DSH 原生的「文件与文件夹」「对话」。DSH 那组的标题归外壳的 `reference` 文案命名空间所有,插件无法改名。
153
165
 
154
166
  ### 运行中图标 / 本地技能
package/docs/API.md CHANGED
@@ -24,7 +24,7 @@ Codes: `BAD_REQUEST`, `NOT_FOUND`, `SSH_CONNECT`, `AUTH_FAILED`,
24
24
  | `docs.text` | `{ path, linkedId?, remoteId?, maxChars? }` | `{ kind, path, size, mtime, pageCount?, text, truncated }` (plain text out of PDF / Word / Excel / PowerPoint; `maxChars` is clamped to 1000–200000, default 40000) |
25
25
  | `docs.write` | `{ path, data, expectedMtime?, linkedId?, remoteId? }` | `{ kind, path, size, mtime }` |
26
26
  | `docs.create` | `{ path, kind?, linkedId?, remoteId? }` | `{ kind, path, size, mtime }` |
27
- | `docs.mdPreview` | `{ path, text?, linkedId?, remoteId? }` | `{ kind, html }` |
27
+ | `docs.mdPreview` | `{ path, text?, linkedId?, remoteId? }` | `{ kind, html }` (rendered in-process; the fragment carries the KaTeX stylesheet and expects the plugin's `/dsh-linked-workspace/assets/katex/` fonts) |
28
28
  | `docs.mdPdf` | `{ path, text?, linkedId?, remoteId? }` | `{ kind: "pdf", path, size, mtime }` |
29
29
 
30
30
  ## Records
@@ -112,6 +112,7 @@ scope root, or absolute inside it.
112
112
  | `linked.push` | `{ id, paths?, dryRun?, conflict?, jobId? }` | `{ linkedId, dryRun, conflict, files, pushed, skipped, conflictsLeft, bytes, cancelled }` (`conflict` is `skip` by default; every file is written as a temporary file and renamed into place; `paths` entries may be files or folders — a folder matches everything under it — and every planned entry carries `localMtime` / `remoteMtime`) |
113
113
  | `linked.pushCancel` | `{ jobId }` | `{ cancelled }` (stops after the file being written) |
114
114
  | `transfer.history` | `{}` | `{ entries: [{ kind: "transfer" \| "push", direction?, linkedId?, files, bytes, skipped, truncated?, at }] }` (newest first, at most 50) |
115
+ | `linked.lastArtifact` | `{ sessionId }` | `{ artifact: { path, at } \| null }` (the file the chat presented most recently in that session; in memory, cleared on restart) |
115
116
  | `linked.sessionScope` | `{ sessionId }` | `{ scope: { linkedId?, remoteId?, root, cwd } \| null }` (resolves which linked/remote workspace a session belongs to by matching the registry path against every record; session ids are compared with or without the `session-` prefix. The `@` picker calls this instead of guessing from the agent context, which only carries `sessionId`) |
116
117
  | `fs.references` | `{ linkedId?/remoteId?, query, limit?, includeIgnored?, side? }` | `{ ok, query, candidates: [{ path, relative, name, kind }], total, truncated, scannedEntries }` (path completion for `@`-style references: matches the **path**, case-insensitive, best match first — exact name, then prefix, then substring; `limit` defaults to 50 and caps at 200; walking stops after 20000 entries or 3 s; `side: 'local'` searches the local tree of a linked workspace. **An empty `query` returns no candidates**, and a full tree walk takes 5–20 s on a real remote, so the `@` picker no longer uses this method — it lists one directory at a time by calling `fs.list` with the parent path) |
117
118
  | `fs.compare` | `{ linkedId?, path? }` | `{ path, relative, localPath, localMissing, counts: { onlyLocal, onlyRemote, changed, same }, onlyLocal, onlyRemote, changed, truncated, remoteTruncated, localTruncated, skippedLinks }` (linked workspaces only; excludes `.git`, `node_modules`, `.local`, `.remote`; 4000 files and depth 12 **per side**, 200 rows per group; `skippedLinks` counts symlinks and non-regular files) |
@@ -149,7 +150,7 @@ Under `$DSH_HOME/linked-workspace/`:
149
150
  - `linked.json` — linked workspaces (no credentials).
150
151
  - `remote-workspaces.json` — remote workspaces (no credentials).
151
152
  - `forwards.json` — `{ version, forwards: [{ id, hostId, hostName, remoteHost, remotePort, localPort, startedAt }] }`. Since 0.25.0 the tunnels opened from 设置 → 端口转发 are standing arrangements: the listener is re-bound on start (with a new local port if the old one is taken, and the record updated), and only `hosts.unforward` removes an entry.
152
- - `settings.json` — `{ editorTheme, editorThemeFamily, editorThemeMode, fileOpenMode, autoSave, execEnabled, execHostIds, execWorkspaceIds, execTimeoutMs, execMaxOutputChars, execShell, hostKeyPolicy, outputEncoding, extraRoots }`. The four `autoPush*` keys are still accepted so an old file loads unchanged, but since 0.24.0 auto push is configured per workspace (`linked.json` → each record's `autoPush`), and those keys no longer drive any watcher.
153
+ - `settings.json` — `{ editorTheme, editorThemeFamily, editorThemeMode, fileOpenMode, autoSave, execEnabled, execHostIds, execWorkspaceIds, execTimeoutMs, execMaxOutputChars, execShell, hostKeyPolicy, outputEncoding, extraRoots, revealSide }`. `revealSide` is `"remote"` (default) or `"local"`: which tree the **Locate last artifact** button opens a chat artifact in for a linked workspace. Remote workspaces always use the remote tree. The four `autoPush*` keys are still accepted so an old file loads unchanged, but since 0.24.0 auto push is configured per workspace (`linked.json` → each record's `autoPush`), and those keys no longer drive any watcher.
153
154
  - `linked.json` — every record carries `autoPush: { enabled, debounceMs, include[], exclude[] }` (`debounceMs` clamped to 300–60000, default 1500). `linked.list` returns it, `linked.update { id, autoPush }` writes it, and the Host starts/stops one `fs.watch` per enabled workspace.
154
155
  The exec keys are off unless you turn them on: `execEnabled` defaults to
155
156
  `false`, `execHostIds` (host allow-list) starts empty, and
package/docs/VERIFY.md CHANGED
@@ -36,12 +36,14 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
36
36
  9. 会话属于联动/远程工作区时,输入框单打一个 **`@`** → 菜单里除了 DSH 原生的「文件与文件夹」「对话」,还有一组「**远程文件与文件夹**」,并且排在 DSH 自己那两组之前(插件用 `order: -1`,DSH 自己的 source 用默认 0)。DSH 那组仍叫「文件与文件夹」——它属于外壳 `reference` 文案命名空间,重复注册会抛错,插件改不了。
37
37
  10. 继续打字过滤:`@co` → 只剩匹配项(如 `.conda/`、`code/`);写到目录名再加 `/`(如 `@code/`)→ 列出该目录里的内容(每次只列一个目录,几百毫秒返回,远端几千个文件也不卡菜单)。
38
38
  11. 选中任一远端候选 → 输入框出现真正的引用 chip(`data-composer-chip="linked-workspace"`,悬停显示相对路径),发送后模型收到该远端路径。
39
+
39
40
  12. 接口自检:`linked.sessionScope { sessionId }` → `{ scope: { linkedId | remoteId, root, cwd } }`;会话 id 带不带 `session-` 前缀都能解析;不属于任何联动/远程工作区时返回 `{ scope: null }`,此时 `@` 只剩 DSH 原生分组。
40
- 14. 文件标签跨刷新与重启:打开「联动工作区目录」,点开两个文件(出现两个文件标签,记住当前标签)→ 刷新页面 → 两个标签与当前标签都恢复;再把 DSH(或 Web 实例的 Host 进程)整个重启,重新打开目录标签 → 标签依旧在。`localStorage` 里键为 `dsh-linked-workspace:pane-tabs`,每面板最多 24 个标签、最多记 12 个面板;关掉全部标签后该面板的记录会被删除。
41
41
 
42
42
  13. 面板不被轮询冲掉:在会话里打开右侧「联动工作区目录」,展开两层目录并点开一个文件(出现文件标签),然后闲置 50 秒以上 → 文件标签仍在、展开状态不变;期间会话快照短暂缺少 cwd 时两个目录标签也不会被注销(旧实现会 dispose 后重建,正在看的文件随之关闭)。
43
43
 
44
+ 14. 文件标签跨刷新与重启:打开「联动工作区目录」,点开两个文件(出现两个文件标签,记住当前标签)→ 刷新页面 → 两个标签与当前标签都恢复;再把 DSH(或 Web 实例的 Host 进程)整个重启,重新打开目录标签 → 标签依旧在。`localStorage` 里键为 `dsh-linked-workspace:pane-tabs`,每面板最多 24 个标签、最多记 12 个面板;关掉全部标签后该面板的记录会被删除。
44
45
 
46
+ 15. 远程组的行样式与下钻:单打 `@` →「远程文件与文件夹」每行只有图标 + 名字(没有整条相对路径的释义),目录行右侧出现「进入目录 · Tab」提示;对目录按 **Tab**(或点该行)→ 菜单不关闭、token 变成 `@目录/` 并列出该目录内容(可再按 Tab 继续下钻);点文件 → 插入引用 chip、菜单关闭。实测:`@` → Tab → `@r4/`(列出 `sub/`、`content-needle.txt`、`demo.html`…)→ 再 Tab → `@r4/sub/`(列出 `inner.txt`)→ 点 `inner.txt` → chip `inner.txt`。
45
47
  ## 远端命令执行(0.17.0)
46
48
 
47
49
  > 注意:本机这套 DSH **Web** 构建里没有可见的设置入口(账号菜单只有「意见反馈 / 退出登录」,`Ctrl+K` 是会话搜索,插件详情页只有「卸载」),所以设置区块的渲染要在**桌面端**确认;Host 侧行为可以直接用下面的 API 命令验证。
@@ -399,7 +401,40 @@ DSH_HOME/linked-workspace/exec-audit.jsonl` 追加一行 JSON,含 `auditId`、
399
401
  4. 浏览器(`http://127.0.0.1:<port>/?token=…`)里点目录工具栏的齿轮:应打开「联动工作区设置」标签并完整渲染整页(含工作区卡片、端口转发表单),不再提示找不到设置入口。
400
402
  5. 设置标签页与桌面端设置对话框同时改动同一项(例如显示模式)后,另一边刷新一次应看到相同结果。
401
403
 
402
- ## 右键菜单(0.25.0)
404
+ ## 定位最近产物(Unreleased)
405
+
406
+ 1. 在联动工作区的会话里打开右侧「联动工作区目录」面板,工具栏最左边应有一个十字准星图标,悬停提示「定位最近产物」。
407
+ 2. 让助手在聊天里展示一个文件(present),然后点这个按钮:右侧面板自动打开(或切到前台)并在树里定位到该文件、以标签页打开。
408
+ 3. 设置 → 联动工作区 → 「最近产物打开位置」切到「优先本地目录」后重做第 2 步:联动工作区打开的是本地副本;远程工作区不受影响,仍然只打开远端,本地磁盘不应出现该文件。
409
+ 4. 在一个还没展示过任何产物的会话里点按钮:提示「聊天里还没有可定位的产物」,不弹错误框。
410
+ 5. 展示的文件不在任何联动/远程工作区目录内时点按钮:提示里带完整实际路径,并已复制到剪贴板。
411
+
412
+ ## 目录树与设置页(Unreleased)
413
+
414
+ 1. 打开右侧「联动工作区目录」,展开几层后切到别的会话/标签再切回来:两棵树立刻按原来的展开状态显示,**不应出现停在「加载中…」的行**;刷新页面后同理。
415
+ 2. 把某个目录的网络请求卡住(例如临时用 devtools 让 `fs.list` 不返回)再展开它:20 秒后该行变成「加载超时,点击重试」,点一下能正常列出内容。
416
+ 3. 设置 → 联动工作区 → 「最近产物打开位置」:点「优先本地目录」后该按钮边框与底色变高亮、字重加粗;点回「优先远程目录」高亮随之切换。
417
+ 4. 同一页的「常用快捷键」默认只显示标题行 + 「展开(5 条)」按钮,点开后出现 `<kbd>` 列表、按钮变「收起」;「允许的主机」同样默认收起,按钮显示「展开(已选 N 个)」,收起时右侧显示已选主机名。
418
+
419
+ ## 右键菜单(Unreleased)
403
420
 
404
421
  1. 在高度吃紧的窗口里右键靠下的行(例如窗口 800px 高时右键第 18 行):菜单整体上翻到光标上方、最下面的「更改权限」「属性」都点得到;若上下空间都不够,菜单自身出现滚动条而不是被窗口裁掉。
405
422
 
423
+ ## Markdown 预览与公式(Unreleased)
424
+
425
+ 1. 打开一个同时含 `$...$` 与 `$$...$$` 的 Markdown 文件点「预览」:行内公式与正文**在同一基线**上,上下标不再掉到下一行;块级公式单独成行、居中、上下各留一截空白。
426
+ 2. 断开网络(或屏蔽 cdn.jsdelivr.net)后重复第 1 步:效果必须完全相同 —— 样式随渲染结果内联,字体由插件自己提供(`/dsh-linked-workspace/assets/katex/fonts/*.woff2`),预览不应再请求任何第三方域名。
427
+ 3. 公式里带中文:`$\text{速度} = \frac{\Delta x}{\Delta t}$` 正常显示;故意写错一个公式(如 `$\frac{a$`)只把那一处显示成红色错误,其余段落照常渲染。
428
+ 4. 预览里的样式不应影响应用本身:打开一个含公式的 Markdown 预览后,聊天区与侧栏的正文、按钮样式保持不变。
429
+ 5. 同一页里放一个很宽的块级公式:宽度放不下时该行自己横向滚动,不把整页撑出横向滚动条。
430
+ 6. 打开一份公式密集的文档(例如 ADR 里几十个块级公式):**分式的分子分母上下分开、下标在基线下方、公式编号不压在公式上**。用开发者工具检查 `.katex-display` 的 `overflow-x` 应为 `auto`、`.vlist>span` 应为 `position: relative`;页面里应存在一个带 `data-rw-katex` 的 `<style>`(KaTeX 样式表由预览自己渲染,不再依赖宿主或 CDN)。
431
+ 7. 带编号的公式(`$$…\tag{2.3-1}$$`):编号排在**公式右侧**、与公式之间留出约 1.6em 空隙,绝不与公式重叠;把窗口调窄到公式需要横向滚动时,编号随公式一起被推到右侧(可横向滚动看到),不会浮在中间。检查 `.tag` 的 `position` 为 `static`。文档里没有 `\tag` 的公式不受影响(仍居中、不加空格)。
432
+ 8. 在一台 **PATH 里没有 `node`** 的机器上(或用 `set PATH=C:\Windows\system32` 启动 DSH)打开含公式的 Markdown 预览:公式必须照常渲染成数学排版,**不能**退化成原样的 `$$ … $$` 文本 —— 渲染在 Host 进程内完成,不依赖外部 node。
433
+
434
+ ## 占位目录里的文件(Unreleased)
435
+
436
+ 1. 在**远程工作区**会话里让助手给出一个指向远端文件的 Markdown 相对链接(例如 `2016_完成度.md`),点它:右侧不应再出现「文件不存在:…\remote-placeholders\<uuid>\…」,而是直接打开该文件,且标签页地址是**远端绝对路径**(`/shared_data_…`)。
437
+ 2. 在同一个标签页里改一行再保存:远端文件内容随之改变(可用 `linked_workspace` 的 `read_outside` 或 `ssh` 核对);关掉标签页重新打开,内容是新版。
438
+ 3. 打开一个**本地**工作区里的文件(`D:\…`)和一个占位目录下的文件:只有后者被转交,本地文件标签原样保留、不被关闭。
439
+ 4. 占位目录下带子目录的路径(例如 `…\remote-placeholders\<uuid>\sub\notes.md`)同样转交成功;目录与无扩展名的路径不转交。
440
+ 5. 关闭并重启 DSH 后再点一次这样的链接:行为不变(首次轮询就能转交,不需要刷新页面);新建一个远程工作区后不刷新页面也能转交。