@him666233/dsh-inline-diff 1.3.0 → 1.4.1
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/README.en.md +28 -9
- package/README.md +28 -9
- package/client.js +2665 -337
- package/index.js +1509 -740
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -4,23 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
> **Originality notice (important)**: This project is **an entirely original work**. It has **no relationship whatsoever** with [JanEickholt/dsh-inline-diff](https://github.com/JanEickholt/dsh-inline-diff) **or any other plugin, repository, or project with the same or a similar name**. This project did not reference, copy, or port any of those projects; the implementation approach, module split, code organization, and final rendering are completely different. Any similarity in part of the functionality (inline diff display in conversations) is **coincidental** — this project only discovered the same-named/similar project when searching for similar plugins after the implementation was already complete. This project is **not** a derivative work, a re-creation, or a fork of any other project.
|
|
6
6
|
|
|
7
|
-
DeepSeek Harness plugin: renders inline diff cards in place for every `edit` / `write` / `str_replace_editor` call in the conversation, automatically detects the file language (57 languages) and applies red/green-safe syntax highlighting, and provides side-by-side comparison, inline character-level highlighting, moved-block and passive line-number annotations, and Read range display; command, search, web, and generic tool calls can also switch to the expanded style (IN/OUT open by default), and command and tool cards color their input/output status per segment. **Since 1.3.0 the UI and documentation are fully bilingual (Chinese / English), with an independent language switch on the settings page
|
|
7
|
+
DeepSeek Harness plugin: renders inline diff cards in place for every `edit` / `write` / `str_replace_editor` call in the conversation, automatically detects the file language (57 languages) and applies red/green-safe syntax highlighting, and provides side-by-side comparison, inline character-level highlighting, moved-block and passive line-number annotations, and Read range display; command, search, web, and generic tool calls can also switch to the expanded style (IN/OUT open by default), and command and tool cards color their input/output status per segment. **Since 1.3.0 the UI and documentation are fully bilingual (Chinese / English), with an independent language switch on the settings page; since 1.4.0 the default is “Follow DSH”, and the release adds card/output/dialog motion plus a built-in version check, update and rollback panel in the settings page; since 1.4.1 tools added by third-party plugins (dsh-ssh's `ssh_*`, MCP-bridged tools, etc.) join the expanded style automatically, and an extra-readable-folders setting for files outside the workspace is available.**
|
|
8
8
|
|
|
9
9
|
- **Author**: [Him666233](https://github.com/Him666233)
|
|
10
10
|
- **Repository**: [Him666233/dsh-inline-diff](https://github.com/Him666233/dsh-inline-diff)
|
|
11
11
|
- **License**: MIT
|
|
12
12
|
- **npm**: `@him666233/dsh-inline-diff`
|
|
13
|
-
- **Current version**: 1.
|
|
13
|
+
- **Current version**: 1.4.1
|
|
14
14
|
|
|
15
15
|
> “Expanded style / Expanded” in the settings means the expanded, flat, transparent output style of modern coding agents; the project contains no third-party product brand names.
|
|
16
16
|
|
|
17
17
|
## Compatibility
|
|
18
18
|
|
|
19
19
|
- **DSH version range (`engines.dsh`)**: `>=0.2.2-rc.1 <0.3.0`
|
|
20
|
-
- **Tested
|
|
20
|
+
- **Tested versions**: `0.2.2-rc.5` (Web profile: third-party tool rows, native Read rows, and settings); `0.2.2-rc.1` (desktop profile) and `0.2.2-rc.2` (Web profile) remain the existing baselines; Windows 11 passes `npm run check` and all 195 tests on real hardware, macOS is covered by code-level audit plus the three-platform CI matrix (no real hardware)
|
|
21
21
|
- Outside the `engines.dsh` range, the DSH loader refuses to load the plugin and never silently runs an unverified version
|
|
22
|
+
- Tools added by third-party plugins (dsh-ssh's `ssh_*`, MCP-bridged tools, etc.): as long as the Host exposes them globally and they have no view of their own, they join “Other tool calls” automatically; when a tool ships its own view, this plugin steps aside and does not override it. The catalog comes from the Host's read-only `/dsh-inline-diff/api/tools` route and refreshes every 30 seconds or when the window regains focus. These rows reuse the existing “Other tool calls” settings (language, shell/inner tones, light/dark/follow-appearance, motion, and process folding); no new setting is added
|
|
22
23
|
- If the desktop app and the Web UI use different profiles, the plugin must be installed separately in each
|
|
23
|
-
- Does not shadow the tool-call entries of `conversation.chat.node` (the official Tool layer owns that entry and declares the `tool.call.toolview` sub-slot, and declaring it again throws);
|
|
24
|
+
- Does not shadow the tool-call entries of `conversation.chat.node` (the official Tool layer owns that entry and declares the `tool.call.toolview` sub-slot, and declaring it again throws); tool rows are taken over through keyed `tool.call.toolview`: built-in rows follow the settings, and since 1.4.1 third-party tools that are globally visible in the Host and have no view of their own are taken over by the dynamic fallback; any remaining tools that cannot be taken over (registered in an agent scope, expanded style not enabled, registration failed, etc.) keep the official generic row
|
|
24
25
|
- Does not take over slots from startup-animation plugins; animation keyframes use a separate namespace (`dsh-inline-diff-*`), and the Read range observer only reacts to Read-row-related DOM changes, avoiding contention with startup animations for the main thread
|
|
25
26
|
- Coexists with third-party themes: keyed `tool.call.toolview` uses priority `-100` to avoid duplicate-key conflicts with theme plugins that also register tool views (e.g. claude-style registers at `-1`); card headers carry an `aria-haspopup="false"` exemption and only respond to real user gestures, so a theme replaying a synthetic click when its fold animation ends cannot turn “Expand / Trace / file path” clicks into a card collapse
|
|
26
27
|
|
|
@@ -79,18 +80,26 @@ Then add the following to the profile's `package.json`:
|
|
|
79
80
|
- File-change, command, and other tool-call cards all use the “shell + inner” two-tone structure; the shell follows the current theme (including third-party themes) — derived colors resolve at the `body` layer, so both the official stock theme (tokens on `body`) and skin themes (tokens on `:root`) are followed correctly and no tint of the previous theme remains after switching; the inner area uses the code-block surface and matching text color of the official light/dark appearance; the three card types can each configure shell/inner tones (shell: auto / light / dark; inner: auto / light / dark / same as shell);
|
|
80
81
|
- Reads the host's actual light/dark appearance (light / dark / follow system); cards and the settings window automatically use readable backgrounds and text colors, so a third-party theme switching to light never produces light-on-light text; dialogs and cards are opaque surfaces and never show the wallpaper through;
|
|
81
82
|
- Four independent display options: file cards, command rows, other tool calls, and process folding; the settings dialog has a fixed title bar with independently scrolling content and scrollbars that hug or inset from their regions as appropriate.
|
|
83
|
+
- Files outside the workspace: live edit cards use the execution snapshot and show the full diff; after a restart, history replay and `str_replace_editor` can use folders explicitly authorized under “Extra readable folders (outside workspace)” in the settings page to read the current file and restore line numbers and whole-file comparison (without authorization they show only the changed hunks from tool metadata).
|
|
82
84
|
|
|
83
85
|
## Settings
|
|
84
86
|
|
|
85
87
|
Bottom of the sidebar → “Diff style”, or the DSH settings page → “Inline Diff”:
|
|
86
88
|
|
|
87
|
-
**Language (new in 1.3.0)**:
|
|
89
|
+
**Language (new in 1.3.0; Follow DSH is the default since 1.4.0)**:
|
|
88
90
|
|
|
89
91
|
| Setting | Options |
|
|
90
92
|
| --- | --- |
|
|
91
|
-
| Language | 中文
|
|
93
|
+
| Language | 中文 / English / **Follow DSH (default)** |
|
|
92
94
|
|
|
93
|
-
Changes take effect immediately without a refresh and never modify DSH's global language; documentation language: Chinese is the default ([README.md](README.md)), and English is in this file ([README.en.md](README.en.md)). The top of the settings page also shows a prominent originality notice: this project is a fully original work and has no relationship with any same-named/similar plugin (including [JanEickholt/dsh-inline-diff](https://github.com/JanEickholt/dsh-inline-diff)).
|
|
95
|
+
Changes take effect immediately without a refresh and never modify DSH's global language; the default follows DSH (Chinese when DSH is Chinese, English for other host languages). Old archives that never explicitly picked a language migrate once to Follow DSH; explicit choices are preserved. documentation language: Chinese is the default ([README.md](README.md)), and English is in this file ([README.en.md](README.en.md)). The top of the settings page also shows a prominent originality notice: this project is a fully original work and has no relationship with any same-named/similar plugin (including [JanEickholt/dsh-inline-diff](https://github.com/JanEickholt/dsh-inline-diff)).
|
|
96
|
+
|
|
97
|
+
**Version & updates (new in 1.4.0)**:
|
|
98
|
+
|
|
99
|
+
| Action | Description |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| Check for updates | The Host reads every published version of `@him666233/dsh-inline-diff` from npm (60s cache) and marks Latest / Installed / Deprecated / Unavailable |
|
|
102
|
+
| Update / roll back / reinstall | Pick any version and the action follows the version relationship; on Web it runs the official plugin-install command once (automatic rollback with log on failure) and tells you to restart DSH afterwards; on Desktop a copyable command is shown (quit DSH completely first) |
|
|
94
103
|
|
|
95
104
|
Four display styles:
|
|
96
105
|
|
|
@@ -103,6 +112,12 @@ Four display styles:
|
|
|
103
112
|
|
|
104
113
|
When “Other tool calls → Expanded” is enabled while “Process folding” is still DSH native, the plugin automatically switches it to “Unfolded”; otherwise completed tool rows would be hidden by DSH folding groups.
|
|
105
114
|
|
|
115
|
+
**Extra readable folders (outside workspace, new in 1.4.1)**:
|
|
116
|
+
|
|
117
|
+
| Setting | Description |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| Extra readable folders | Folders explicitly added by the user (at most 12), used only by history replay / `str_replace_editor` to read the current file outside the workspace and restore line numbers and whole-file comparison; the list is stored by the Host (`$DSH_HOME/dsh-inline-diff/read-roots.json`, shared by profiles with the same DSH_HOME), filesystem roots are rejected, and card style, language and motion are unchanged |
|
|
120
|
+
|
|
106
121
|
Syntax highlighting and language badge (independent of the table above):
|
|
107
122
|
|
|
108
123
|
| Setting | Options |
|
|
@@ -112,11 +127,15 @@ Syntax highlighting and language badge (independent of the table above):
|
|
|
112
127
|
| Unknown language | Show “Unknown” / Hide |
|
|
113
128
|
| Font emphasis | Color + font style / Color only |
|
|
114
129
|
|
|
115
|
-
Settings are saved in localStorage (`dsh-inline-diff.settings.
|
|
130
|
+
Settings are saved in localStorage (`dsh-inline-diff.settings.v5`); old v4 / v3 / v2 values are migrated automatically and the old keys are removed. The default UI language is “Follow DSH”.
|
|
116
131
|
|
|
117
132
|
## Data and limitations
|
|
118
133
|
|
|
119
|
-
|
|
134
|
+
By default the plugin makes no network requests and has no telemetry, and the client uses no `innerHTML` / `dangerouslySetInnerHTML` / `eval`; the only exception is when the user explicitly clicks “Check for updates / Install”, where the Host fetches npm registry metadata and invokes the local `dsh` CLI. Those requests contain only the package name/version — never session content, file content, keys or device information. The Host keeps only the before/after text needed for display in in-memory snapshots (LRU: at most 240 entries, 4 MB per side, plus a 64 MB total cap) and never writes it to disk; the Host read-only APIs are protected by the DSH browser trust boundary (`connection` admission, falling back to a local loopback fence when that service is unavailable); display reads are limited to registered workspaces or folders explicitly authorized on the settings page, with a 1 MB request-body cap, JSON-only bodies, a 10-second request-read timeout, a 15-second file-read timeout, and an 8-concurrent-read limit. Very large files and very long single lines have a materialization budget on the browser side (200k lines / 1,000,000 characters per line); beyond it the plugin automatically degrades to changed hunks with a reason notice and never freezes the page. The Host saves snapshots only for `edit` / `write`, while `str_replace_editor` shows the changed hunks from the tool metadata and tries to locate line numbers — its card and the expanded dialog use a dedicated “this tool call keeps no execution snapshot” notice (not history-replay wording); after an app restart, history replay is likewise explained in the expanded dialog. In extreme cases the plugin falls back step by step: “snapshot → current-file read → tool-metadata changed hunks → explicit explanation”; the UI language, settings storage, and syntax highlighting also have Chinese / default-value fallbacks, so the final outcome is a readable explanation rather than a silent failure. History-replay line numbers are located again in the current file; if the file has since changed and the hunk cannot be located uniquely, “line numbers pending” is shown and the dialog explains that only the changed hunks can be shown. The same card shows the execution snapshot of that edit and does not refresh as the file changes later; the full display behavior (snapshot semantics, refresh rules, line-number legend, dialog layering and scrolling, performance notes) is documented in the repository's [docs/display-behavior.en.md](https://github.com/Him666233/dsh-inline-diff/blob/main/docs/display-behavior.en.md).
|
|
135
|
+
|
|
136
|
+
Motion: tasteful animations only cover running-card mount, output arrival and dialog opens; historical replay and settled cards render their final state immediately, and everything is disabled when the OS “reduce motion” preference is on.
|
|
137
|
+
|
|
138
|
+
Version & updates: the panel lists only npm releases; a one-click install replaces the current profile installation with the npm release (a local dev build would be overwritten), and DSH must be restarted afterwards. Desktop v1 has no in-place one-click install and shows a manual command instead.
|
|
120
139
|
|
|
121
140
|
For the full documentation, internal architecture, and known limitations, see the repository's [README](https://github.com/Him666233/dsh-inline-diff/blob/main/README.en.md).
|
|
122
141
|
|
package/README.md
CHANGED
|
@@ -4,23 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
> **原创声明(重要)**:本项目是**完全原创**的作品,与 [JanEickholt/dsh-inline-diff](https://github.com/JanEickholt/dsh-inline-diff) **以及任何其他同名插件、仓库或项目没有任何关系**。本项目没有参考、复制或移植上述项目;两者的实现方式、模块划分、代码组织与最终渲染效果完全不同。部分功能相似(对话内联差异展示)纯属**雷同巧合**——本项目是在完成实现之后搜索同类插件时,才发现存在同名/相似项目。本项目**不是**任何其他项目的衍生作品、复刻作品或分支。
|
|
6
6
|
|
|
7
|
-
DeepSeek Harness 插件:为每次 `edit` / `write` / `str_replace_editor` 调用在对话中就地渲染内联差异卡片,自动识别文件语言(57 种)并做避开红绿的语法高亮,并提供左右对照、行内字符级高亮、移动块与被动行号说明、Read 行范围展示;命令、搜索、网页与通用工具调用还可切换为默认展开 IN/OUT 的「展开风格」,命令与工具卡片的输入/输出状态按段独立着色。**1.3.0
|
|
7
|
+
DeepSeek Harness 插件:为每次 `edit` / `write` / `str_replace_editor` 调用在对话中就地渲染内联差异卡片,自动识别文件语言(57 种)并做避开红绿的语法高亮,并提供左右对照、行内字符级高亮、移动块与被动行号说明、Read 行范围展示;命令、搜索、网页与通用工具调用还可切换为默认展开 IN/OUT 的「展开风格」,命令与工具卡片的输入/输出状态按段独立着色。**1.3.0 起界面与文档提供完整中英双语,并可在设置页独立切换语言;1.4.0 起默认「跟随 DSH」,并新增卡片/输出/弹窗动效以及设置页自带的版本检查、更新与回退;1.4.1 起第三方插件新增的工具(如 dsh-ssh 的 `ssh_*`、MCP 桥接工具)也会自动纳入展开风格,并新增工作区外额外可读目录设置。**
|
|
8
8
|
|
|
9
9
|
- **作者**:[Him666233](https://github.com/Him666233)
|
|
10
10
|
- **仓库**:[Him666233/dsh-inline-diff](https://github.com/Him666233/dsh-inline-diff)
|
|
11
11
|
- **License**:MIT
|
|
12
12
|
- **npm**:`@him666233/dsh-inline-diff`
|
|
13
|
-
- **当前版本**:1.
|
|
13
|
+
- **当前版本**:1.4.1
|
|
14
14
|
|
|
15
15
|
> 设置项中的「展开风格 / Expanded」指展开式、平板式、类现代编码代理的透明输出效果;项目不包含任何第三方产品品牌字样。
|
|
16
16
|
|
|
17
17
|
## 兼容性
|
|
18
18
|
|
|
19
19
|
- **DSH 版本范围(`engines.dsh`)**:`>=0.2.2-rc.1 <0.3.0`
|
|
20
|
-
- **实测版本**:`0.2.2-rc.1`
|
|
20
|
+
- **实测版本**:`0.2.2-rc.5`(Web profile:第三方工具行、Read 原生行与设置项);`0.2.2-rc.1`(桌面端 profile)与 `0.2.2-rc.2`(Web profile)为既有基线;Windows 11 实机跑通 `npm run check` 与 195 项测试,macOS 按代码级审计 + 三平台 CI 矩阵覆盖(无实机)
|
|
21
21
|
- 不在 `engines.dsh` 范围内时,DSH 加载器会拒绝加载本插件,不会静默运行未验证版本
|
|
22
|
+
- 第三方插件新增的工具(dsh-ssh 的 `ssh_*`、MCP 桥接工具等):只要 Host 全局可见且没有自己的视图,就自动按「其它工具调用」接管;第三方自带视图时让位,不覆盖。清单由 Host 的只读 `/dsh-inline-diff/api/tools` 提供,每 30 秒或窗口重新获得焦点时刷新。这些行复用「其它工具调用」的现有配置(语言、外壳/内部配色、浅色/深色/跟随外观、动效与过程折叠),不新增设置项
|
|
22
23
|
- 桌面端与 Web UI 若使用不同 profile,需要分别安装
|
|
23
|
-
- 不 shadow `conversation.chat.node` 的 tool-call 条目(官方 Tool 层拥有该条目并声明 `tool.call.toolview` 子槽,重复声明会抛错),只通过 keyed `tool.call.toolview`
|
|
24
|
+
- 不 shadow `conversation.chat.node` 的 tool-call 条目(官方 Tool 层拥有该条目并声明 `tool.call.toolview` 子槽,重复声明会抛错),只通过 keyed `tool.call.toolview` 注册接管工具行;内建工具行按设置接管,1.4.1 起 Host 全局可见且无自己视图的第三方工具由动态兜底接管,其余无法接管的工具(agent scope 注册、未开启展开风格、注册失败等)沿用官方通用行
|
|
24
25
|
- 与启动动画类插件互不接管 slot;动画关键帧使用独立命名空间(`dsh-inline-diff-*`),Read 范围观察器只响应 Read 行相关 DOM 变更,避免抢占启动动画的主线程
|
|
25
26
|
- 与第三方主题共存:keyed `tool.call.toolview` 使用 priority `-100`,避免与同样注册工具视图的主题插件(如 claude-style 在 `-1` 注册)发生重复 key 冲突;卡片头部带 `aria-haspopup="false"` 豁免并只响应真实用户手势,避免主题在折叠动画结束时重放合成点击、把「放大 / 轨迹 / 文件路径」的点击变成折叠卡片
|
|
26
27
|
|
|
@@ -79,18 +80,26 @@ pnpm add link:/absolute/path/to/dsh-inline-diff/plugin
|
|
|
79
80
|
- 文件修改、命令执行、其它工具调用三类卡片都使用「外壳 + 内部」双色结构;外壳跟随当前主题(含第三方主题)——派生颜色在 `body` 层解析,官方原版主题(token 在 `body`)与皮肤主题(token 在 `:root`)都能正确跟随,切换后不会残留上一个主题的色调;内部使用官方明暗外观的代码块底色与对应字色;三类卡片可分别配置外壳/内部配色(外壳:自动 / 浅色 / 深色;内部:自动 / 浅色 / 深色 / 与外壳一致);
|
|
80
81
|
- 读取宿主实际明暗外观(浅色 / 深色 / 跟随系统),卡片与设置窗口自动使用可读的底色和字色,第三方主题切浅色时也不会浅底浅字;弹窗与卡片均为不透明表面,不会透出壁纸;
|
|
81
82
|
- 四项独立展示选项:文件卡片、命令执行行、其它工具调用、过程折叠;设置弹窗标题栏固定、内容独立滚动,滚动条按区域贴边或内缩。
|
|
83
|
+
- 工作区外文件:实时编辑卡片使用执行快照显示完整差异;应用重启后的历史回放与 `str_replace_editor` 可通过设置页「额外可读目录(工作区外)」显式授权目录,读取“当前文件”补齐行号与全文对照(未授权时只显示工具元数据里的修改块)。
|
|
82
84
|
|
|
83
85
|
## 设置
|
|
84
86
|
|
|
85
87
|
侧边栏底部「差异样式」或 DSH 设置页「内联差异」:
|
|
86
88
|
|
|
87
|
-
**界面语言(1.3.0
|
|
89
|
+
**界面语言(1.3.0 新增,1.4.0 起默认跟随 DSH)**:
|
|
88
90
|
|
|
89
91
|
| 设置项 | 可选项 |
|
|
90
92
|
| --- | --- |
|
|
91
|
-
| 界面语言 / Language |
|
|
93
|
+
| 界面语言 / Language | 中文 / English / **跟随 DSH(默认)** |
|
|
92
94
|
|
|
93
|
-
切换立即生效、无需刷新,不会改动 DSH
|
|
95
|
+
切换立即生效、无需刷新,不会改动 DSH 全局语言;默认跟随 DSH(DSH 中文时中文,其它语言时英文);旧存档中从未明确选择过语言的会一次性迁移为跟随 DSH,曾明确选过的保留。文档语言:中文默认(本文件),英文见 [README.en.md](README.en.md)。设置页顶部同时展示一条醒目的原创声明:本项目为完全原创作品,与任何同名/相似插件(包括 [JanEickholt/dsh-inline-diff](https://github.com/JanEickholt/dsh-inline-diff))没有任何关系。
|
|
96
|
+
|
|
97
|
+
**版本与更新(1.4.0 新增)**:
|
|
98
|
+
|
|
99
|
+
| 操作 | 说明 |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| 检查更新 | Host 侧读取 npm 上 `@him666233/dsh-inline-diff` 的全部版本(60 秒缓存),标记最新 / 当前 / 已废弃 / 不可安装 |
|
|
102
|
+
| 更新 / 回退 / 重装 | 选择任意版本后按版本关系显示对应动作;Web 端一键调用官方插件安装命令(失败自动回滚并显示日志),成功后提示重启 DSH;桌面端显示可复制命令(需先完全退出 DSH) |
|
|
94
103
|
|
|
95
104
|
四项展示风格:
|
|
96
105
|
|
|
@@ -103,6 +112,12 @@ pnpm add link:/absolute/path/to/dsh-inline-diff/plugin
|
|
|
103
112
|
|
|
104
113
|
开启「其它工具调用 → 展开风格」时,若「过程折叠」仍为 DSH 原生,插件会自动把它切到「不折叠」,否则已完成的工具行会被 DSH 折叠组遮住。
|
|
105
114
|
|
|
115
|
+
**额外可读目录(工作区外,1.4.1 新增)**:
|
|
116
|
+
|
|
117
|
+
| 设置项 | 说明 |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| 额外可读目录 | 用户显式添加的目录(最多 12 个),仅用于历史回放 / `str_replace_editor` 读取工作区外“当前文件”补齐行号与全文对照;清单保存在 Host(`$DSH_HOME/dsh-inline-diff/read-roots.json`,同一 DSH_HOME 的 profile 共享),拒绝文件系统根;不改变卡片样式、语言或动效 |
|
|
120
|
+
|
|
106
121
|
语法高亮与语言徽章(独立于上表):
|
|
107
122
|
|
|
108
123
|
| 设置项 | 可选项 |
|
|
@@ -112,11 +127,15 @@ pnpm add link:/absolute/path/to/dsh-inline-diff/plugin
|
|
|
112
127
|
| 未知语言 | 显示“未知语言” / 不显示 |
|
|
113
128
|
| 字体强调 | 颜色 + 字体样式 / 仅颜色 |
|
|
114
129
|
|
|
115
|
-
设置保存在 localStorage(`dsh-inline-diff.settings.
|
|
130
|
+
设置保存在 localStorage(`dsh-inline-diff.settings.v5`);旧 v4 / v3 / v2 值自动迁移并删除旧键。默认界面语言为「跟随 DSH」。
|
|
116
131
|
|
|
117
132
|
## 数据与限制
|
|
118
133
|
|
|
119
|
-
|
|
134
|
+
插件默认没有网络请求或遥测,客户端不使用 `innerHTML` / `dangerouslySetInnerHTML` / `eval`;唯一例外是用户主动点击「检查更新 / 安装」时 Host 访问 npm registry 并调用本机 `dsh` CLI,请求只含包名/版本号,不发送会话内容、文件内容、密钥或设备信息。Host 只保留显示所需的修改前后文本到内存快照(LRU:最多 240 条、每侧上限 4MB,并限制总量 64MB),不落盘;Host 只读 API 受 DSH 浏览器信任边界(`connection` 准入,无该服务时回退本机 loopback 围栏)保护,展示读取只允许已注册 workspace 或设置页显式授权的额外可读目录,并有请求体 1MB、仅 JSON、10 秒读取超时、15 秒文件读超时与 8 并发上限。超大文件与超大单行在浏览器侧有物化预算(20 万行 / 单行 100 万字符),超限自动降级为差异块并提示原因,不会冻结页面。Host 只为 `edit` / `write` 保存快照,`str_replace_editor` 按工具元数据中的修改块展示并尽量定位行号,卡片与放大弹窗用「不保存执行快照」的专用说明(不是历史回放措辞);应用重启后的历史回放同样会在放大弹窗内说明。极端情况下按「快照 → 当前文件读取 → 工具元数据差异块 → 明确说明」逐级回退;界面语言、设置存储、语法高亮同样有中文 / 默认值兜底,最终才显示可读的错误说明而不是静默失败。历史回放的行号按当前文件重新定位;若文件此后又被改动导致无法唯一定位,会显示「行号待定」并在弹窗说明只展示修改块。同一张卡片展示的是该次编辑的执行快照,不会随文件后续改动刷新;完整的显示行为说明(快照语义、刷新规则、行号图例、弹窗层级与滚动、性能提示)见仓库 [docs/display-behavior.md](https://github.com/Him666233/dsh-inline-diff/blob/main/docs/display-behavior.md)。
|
|
135
|
+
|
|
136
|
+
动效方面:只给运行中卡片挂载、输出出现与弹窗打开加克制动画,历史回放与已结算卡片直接显示终态,系统「减少动效」下全部关闭。
|
|
137
|
+
|
|
138
|
+
版本与更新方面:更新面板列出的是 npm 已发布版本;一键安装会用发布版覆盖当前 profile 中的安装(本地开发构建会被覆盖),安装后必须重启 DSH 生效;桌面端 v1 不提供运行中一键安装,只显示手动命令。
|
|
120
139
|
|
|
121
140
|
完整说明、内部架构与已知限制见仓库根目录 [README](https://github.com/Him666233/dsh-inline-diff#readme)。
|
|
122
141
|
|