@xbzbing/dsh-git-panel 1.7.0 → 1.8.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 +35 -22
- package/README.md +35 -22
- package/lib/client.js +169 -43
- package/lib/client.mermaid.js +4338 -0
- package/lib/host/actions.js +44 -2
- package/lib/host/core.d.ts +18 -6
- package/lib/host/core.js +23 -9
- package/lib/host/index.d.ts +14 -2
- package/lib/host/index.js +79 -7
- package/lib/host/llm-face.d.ts +21 -0
- package/lib/host/open-file.d.ts +16 -0
- package/lib/host/open-file.js +29 -0
- package/lib/host/queries.d.ts +8 -0
- package/lib/host/queries.js +69 -9
- package/lib/host/suggest.js +24 -4
- package/lib/host/types.d.ts +75 -2
- package/lib/host/types.js +2 -0
- package/package.json +19 -5
package/README.en.md
CHANGED
|
@@ -11,37 +11,44 @@ The panel only reads the Git repository at the current session's working directo
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
#
|
|
14
|
+
# Stable release (npm)
|
|
15
15
|
dsh plugin --profile web add @xbzbing/dsh-git-panel@latest
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
dsh plugin --profile web add github
|
|
17
|
+
# Pre-release (GitHub Release asset; never published to npm)
|
|
18
|
+
dsh plugin --profile web add https://github.com/xbzbing/dsh-git-panel/releases/download/v1.8.0-rc.1/xbzbing-dsh-git-panel-1.8.0-rc.1.tgz
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Pre-release versions carry a `-` suffix (e.g. `1.8.0-rc.1`): they appear only as GitHub prereleases, are never pushed to npm, and never trigger the in-panel "update available" prompt. A stable release ships to npm and as a stable GitHub Release at the same time. `lib/` is not committed to the repository — do not install with `dsh plugin add github:…`; use the npm or Release asset URL above.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
After installing or updating, the **Git** panel appears in the workspace tab bar (after Chat and Trajectory) with no service restart and no page refresh: dsh's hmr watches the profile's `package.json` and patch files and mounts the plugin live, while the client bundle (`lib/client.js`) is picked up within a second of being replaced and pushed to the browser over `/plugins/events`, where the old fiber is torn down and the new code remounted in place — already-open pages get the update without reloading. Only host-half modules (`lib/host/*.js`, whose loaded code keeps running until the next restart) and profile changes made while hmr is unavailable still need a restart. In-panel settings (the input-bar marker toggle and the default diff view on the detail page) are hot-written and apply immediately.
|
|
24
|
+
|
|
25
|
+
> **Compatibility**: verified on `dsh@0.2.1-rc.2` — installation, the Git panel, the input-bar marker, and the host RPC all work normally.
|
|
24
26
|
|
|
25
27
|
## Features
|
|
26
28
|
|
|
27
|
-
- **Overview** — three columns
|
|
28
|
-
- **Changes** —
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
34
|
-
- **
|
|
35
|
-
- **
|
|
36
|
-
- **Image zoom** — the file preview and the diff panes share one zoom component: pinch on a Mac trackpad (delivered as a Ctrl+wheel event by Chromium/Firefox/Safari 15+, as Safari gesture events earlier) and Ctrl+wheel both zoom around the cursor (10%–800%); once zoomed, pan with two-finger scrolling, the wheel, the scrollbars, or a **left-button mouse drag** (grab cursor — a drag never doubles as a double click, and dragging the browser's own scrollbar is left alone); a floating zoom bar offers − / percentage / + / Fit / fullscreen (fullscreen lives in the bar only: an inline click entry would swallow the first click of every double click); double-click toggles between fit and 100%; the lightbox keeps zoom and pan, and closes on <kbd>Esc</kbd>, the close control, or a press on its empty area.
|
|
37
|
-
- **In-code find** — the file source preview and the diff views support <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>F</kbd> to find in place: every match is highlighted preserving syntax colors, with an active/total count, <kbd>Enter</kbd> / <kbd>Shift</kbd>+<kbd>Enter</kbd> or `‹` `›` to walk matches, a case-sensitivity toggle (insensitive by default), and <kbd>Esc</kbd> to close. Match counting scans the whole content, so matches outside the viewport are counted and reachable too.
|
|
38
|
-
- **Syntax-highlighted diffs** — the overview modal, changes page, and file browser share dsh's built-in highlighter. Languages are selected by file extension and grammars load on demand; word-level change emphasis remains available in the diff views.
|
|
39
|
-
- **Diff modes** — unified / split / before / after views. Unified is a single inline column (each change shown as adjacent `-`/`+` lines, saving horizontal space); split is side-by-side. Both carry on-demand expansion of hidden between-hunk context and word-level emphasis on changed lines. The default view is selectable on the plugin detail page (unified / split) and can be switched per diff from the toolbar.
|
|
40
|
-
- **Mobile / narrow-panel layout** — at 620px wide or below (a phone in portrait, or a sidebar squeezing the panel) the UI switches to a single-column drill-in: the three columns collapse to one, and you tap from a list into its detail / diff / preview and come back with a Back button. The Overview branch filter becomes a bottom sheet, commit rows go two-line for easier tapping, the tab-bar controls wrap onto a second row instead of hiding, and the side-by-side diff mode is dropped on narrow screens. Widening the panel restores the three-column layout, so the desktop experience is unchanged. On touch devices (e.g. tablets) the per-file row actions stay visible and hit targets grow.
|
|
41
|
-
- **Show input-bar marker toggle** — the plugin detail page can toggle the input-bar marker; when off, the input bar stays clean and the Git tab shows a status dot instead (green = synced, orange = dirty). The two are mutually exclusive and changes apply immediately. The same config section also sets the default diff view (unified / split) and the commit-graph line style (parallel VSCode style / compact git-log style, parallel by default). "AI commit message" is its own config card: besides the button toggle it sets the generation language (Auto / 中文 / English; Auto by default, following the language you write commits in for that repository) and tunes the input budget / output limit / generation timeout (ranges 16–512 KiB / 256–16384 tokens / 5–120 s; out-of-range values clamp to the boundary).
|
|
42
|
-
- **Input-bar Git marker** — a zsh-theme `<repo> (<branch>)` marker: the repo name is cyan, `(branch)` is green when in sync and orange when there are uncommitted changes; hover shows the full repository path, and clicking jumps to the panel (to Changes when dirty, otherwise to Overview); in non-Git directories the input-bar marker is hidden, while the workspace Git tab still opens the file browser.
|
|
29
|
+
- **Overview** — three columns: the branch / tag list, a searchable (commit message, hash, author, date) commit history graph, and the selected commit's changed-file tree and message; click a file to see its diff within that commit in a modal.
|
|
30
|
+
- **Changes** — per-file stage / unstage / discard and batch discard of the checked changes (with confirmation), manual commit and **Amend**, stash (create / apply / pop / drop), plus file-count and added·deleted statistics.
|
|
31
|
+
- **Common Git actions** — switch branch (a remote ref becomes a same-named tracking branch, never a detached HEAD; uncommitted changes can be stashed first), create and delete tags, and revert / reset a commit (hard reset lists the changes it will discard and requires an extra acknowledgement). All of them only rewrite the local repository and never push automatically.
|
|
32
|
+
- **AI commit-message suggestion** — writes a commit message from the current uncommitted changes in the style of the repository's existing commits, with the language inferred from the repository history by default (or pinned to 中文 / English); the model can be pinned on the detail page from the DSH model list (provider → model → reasoning-effort cascade, **following the current session by default**), where the suggestion can also be turned off and the input budget, output limit, and timeout tuned. **Generation sends your diff content to the provider of the model you picked.**
|
|
33
|
+
- **Input-bar Git marker** — a zsh-style `<repo> (<branch>)`, green when in sync and orange when there are uncommitted changes; hover shows the repository path and a click jumps to the panel. It can be turned off on the plugin detail page, which moves the status to a dot beside the Git tab.
|
|
34
|
+
- **File browser** — browse the workspace tree inside the panel (loaded on demand, `.gitignore` entries dimmed, `.git` hidden) and preview code / Markdown / HTML / images (local images embedded in rendered Markdown display inline, e.g. README figures; ```mermaid fences render as diagrams with a code-block fallback); the source preview wraps long lines by default and can switch to horizontal scrolling; it also works outside a Git repository, rooted at the current working directory.
|
|
35
|
+
- **Diff and source viewing** — unified / split / before / after views with syntax highlighting, word-level emphasis, on-demand expansion of hidden context, and <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>F</kbd> find-in-place; images zoom around the cursor (10%–800%) and can be panned by dragging or opened fullscreen.
|
|
36
|
+
- **Narrow panel / mobile** — at 620px wide or below the UI switches to a single-column drill-in (branch filter as a bottom sheet, two-line commit rows) and restores the three columns when widened.
|
|
37
|
+
- **Shared-worktree guards** — write actions share the repository with the dsh AI, so dialog footers suggest letting the AI run Git for you; a `.git/index.lock` clash retries once and reports a friendly "Git is busy".
|
|
43
38
|
- The UI follows the DSH system language, in Simplified Chinese and English.
|
|
44
39
|
|
|
40
|
+
## Permissions and data boundaries
|
|
41
|
+
|
|
42
|
+
The panel runs with the DSH process's privileges. These are the boundaries worth knowing before installing:
|
|
43
|
+
|
|
44
|
+
- **Git commands** — every git command goes through the host `subprocess` service: argv arrays, no shell string concatenation, cwd locked to the repository root, with a per-command timeout and output caps. It never uses `--force` and never touches your git config.
|
|
45
|
+
- **File access** — it only reads files inside the workspace (diffs, file browser, the AI-suggestion input), after validation plus a realpath containment check: symlinks pointing outside the repository are refused and `.git` is not browsable. The one write is **discarding an untracked entry** — it deletes the working-tree file after your confirmation, and refuses the whole batch when an entry is itself a Git repository.
|
|
46
|
+
- **Network** — the plugin itself makes exactly one request, `GET https://api.github.com/repos/<owner>/<repo>/releases/latest`, for the "new version available" notice in the version bar (5 s timeout, cached in-process). `fetch` / `pull` / `push` / `publish` reach the network only after you click, through git commands, and credentials stay with git: the plugin never reads, stores, or returns a token or credential.
|
|
47
|
+
- **External service** — only "AI commit message" sends diff content to the model provider you configured in DSH; the host performs the call and the plugin holds no credentials.
|
|
48
|
+
- **System dependency** — the `git` CLI. Without git, or outside a Git repository, only the file browser is shown, rooted at the current working directory.
|
|
49
|
+
|
|
50
|
+
The client bundle (`lib/client.js`) makes no network requests of its own — it talks to the host over same-origin RPC — and the plugin collects no telemetry. UI-only preferences such as the panel font size and pane widths live in browser localStorage and never contain repository content. Apart from git commands and the confirmed deletion, the plugin's code reads and writes nothing outside the workspace; the detail-page settings are persisted by the host into the profile config.
|
|
51
|
+
|
|
45
52
|
## Screenshots
|
|
46
53
|
|
|
47
54
|
| Overview | File-diff modal |
|
|
@@ -49,6 +56,8 @@ After installing or updating, restart the `dsh web` service and refresh the page
|
|
|
49
56
|
|  |  |
|
|
50
57
|
| Changes | File browser |
|
|
51
58
|
|  |  |
|
|
59
|
+
| Narrow / mobile | Plugin config |
|
|
60
|
+
|  |  |
|
|
52
61
|
|
|
53
62
|
## Architecture
|
|
54
63
|
|
|
@@ -67,7 +76,7 @@ npm run test:e2e # isolated file:// headless-browser e2e (never touches a run
|
|
|
67
76
|
npm test # unit + e2e
|
|
68
77
|
```
|
|
69
78
|
|
|
70
|
-
The host output is emitted one file per `src/host/` module (stack traces land in the module that raised) and is never minified: the typert gateway validates arguments by method parameter name, and minification would rename them and break the wire contract. Client changes are
|
|
79
|
+
The host output is emitted one file per `src/host/` module (stack traces land in the module that raised) and is never minified: the typert gateway validates arguments by method parameter name, and minification would rename them and break the wire contract. Client changes are hot-reloaded: after rebuilding `lib/client.js`, the running dsh detects the file change within a second and pushes it to the browser for an in-place swap (old fiber torn down, new code remounted) — no page refresh needed; host changes still need a restart, since loaded modules keep running their previous code. `lib/` is local build output and is not committed; for local development, add the plugin to a dsh web profile's `dsh.profile.bundles` with a `file:` dependency pointing at this directory, then run `node build.mjs`.
|
|
71
80
|
|
|
72
81
|
## Project structure
|
|
73
82
|
|
|
@@ -98,6 +107,10 @@ src/
|
|
|
98
107
|
diff.ts unified diff → side-by-side rows + inline rows + stats
|
|
99
108
|
```
|
|
100
109
|
|
|
110
|
+
## Acknowledgements
|
|
111
|
+
|
|
112
|
+
Thanks to [@ivanant](https://github.com/ivanant) for the many optimization suggestions and iteration requests filed against this project. Mobile layout, batch selection in the changes page, AI commit messages, commit-graph and icon polish, and publishing a branch that has no upstream all came mostly from his real-world usage reports — feedback that moved the panel well past "it works".
|
|
113
|
+
|
|
101
114
|
## License
|
|
102
115
|
|
|
103
116
|
[MIT License](LICENSE).
|
package/README.md
CHANGED
|
@@ -11,37 +11,44 @@
|
|
|
11
11
|
## 安装
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
# npm
|
|
14
|
+
# 正式版(npm)
|
|
15
15
|
dsh plugin --profile web add @xbzbing/dsh-git-panel@latest
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
dsh plugin --profile web add github
|
|
17
|
+
# 预发布(GitHub Release 附件,不发 npm)
|
|
18
|
+
dsh plugin --profile web add https://github.com/xbzbing/dsh-git-panel/releases/download/v1.8.0-rc.1/xbzbing-dsh-git-panel-1.8.0-rc.1.tgz
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
预发布版本号带 `-`(如 `1.8.0-rc.1`),只出现在 GitHub Release,不会推送 npm,也不会触发面板里的「有新版本」提示;正式版发布时 npm 与稳定 Release 同时上线。`lib/` 不随仓库提交,请不要用 `dsh plugin add github:…` 安装——改用上面的 npm 或 Release 附件 URL。
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
安装或更新后,工作区标签栏(「对话」「轨迹」之后)就会出现 **Git** 面板,无需重启服务、也无需刷新页面:dsh 的 hmr 监听 profile 的 `package.json` 与 patch 文件,插件装好即热挂载;client 半产物(`lib/client.js`)被替换后也会被秒级轮询拾取,经 `/plugins/events` 推给浏览器原地热替换(拆掉旧 fiber 重挂新代码),已打开的页面不刷新即可拿到更新。仅 host 半模块(`lib/host/*.js`,进程内已加载的旧代码会一直跑到重启为止)与 hmr 不可用时的 profile 变更仍需重启服务。面板内的配置项(详情页的输入框标记开关、差异默认视图)走配置热写,改动即时生效。
|
|
24
|
+
|
|
25
|
+
> **兼容性**:已在 `dsh@0.2.1-rc.2` 上实测,安装、Git 面板、输入框标记与 host RPC 均可正常使用。
|
|
24
26
|
|
|
25
27
|
## 功能
|
|
26
28
|
|
|
27
|
-
- **Git
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
- **图片缩放**:文件浏览与差异对照的图片共用同一缩放组件——Mac 触控板双指捏合(Chromium/Firefox/Safari 15+ 以 Ctrl+滚轮事件送达、旧 Safari 走 gesture 事件)与 <kbd>Ctrl</kbd>+滚轮都以光标为锚点缩放(10%–800%),放大后可用双指滚动、滚轮、滚动条或**鼠标左键拖拽**平移(抓手光标;拖拽不会被当成双击,另拖原生滚动条不受影响),浮动工具栏提供 − / 百分比 / + / 适应窗口 / 全屏(全屏入口只在工具栏,图片单击不触发,否则每次双击都会被第一次单击打断),双击在适应窗口与 100% 间切换,灯箱内可继续缩放拖拽,<kbd>Esc</kbd>、点关闭钮或点灯箱空白区域退出。
|
|
37
|
-
- **代码内查找**:文件浏览的源码视图与差异对照都支持 <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>F</kbd> 就地查找——高亮全部命中并保留语法着色,显示「当前 / 总数」,<kbd>Enter</kbd> / <kbd>Shift</kbd>+<kbd>Enter</kbd> 或 `‹` `›` 在命中间跳转,可切换区分大小写(默认不敏感),<kbd>Esc</kbd> 关闭。命中统计覆盖整份内容,视口外的命中同样计入并可跳转。
|
|
38
|
-
- **语法高亮差异**:总览弹窗、变更记录和文件浏览共用 dsh 官方语法高亮,按文件扩展名选择语言,语法资源按需加载;差异视图的改动词级强调保留原有交互。
|
|
39
|
-
- **对照模式**:差异支持「统一 / 对照 / 变更前 / 变更后」四种视图切换。统一视图为单栏行内对比(改动行前后紧邻,省横向空间),对照视图为左右并排;两种视图都带块间隐藏上下文的按需展开与改动行的词级高亮。默认视图可在插件详情页选择(统一 / 并排),也可在每个差异视图工具栏临时切换。
|
|
40
|
-
- **移动端 / 窄面板自适应**:面板宽度收窄到 620px 及以下(手机竖屏,或右侧栏挤压面板)时自动切换为单栏「钻取」布局——三栏折叠为一栏,列表与详情 / 差异 / 预览之间点击进入、带「返回」按钮退出;Git 总览的分支筛选改为从底部升起的面板(bottom sheet),提交行改为两行式更易点按,顶栏控件换行到第二行而非隐藏,差异对比在窄屏隐藏「对照」(并排)模式。面板变宽后自动恢复三栏布局,桌面体验不变。触控设备(如平板)上逐文件操作按钮常驻显示、点按区域放大。
|
|
41
|
-
- **显示输入框标记开关**:插件详情页可切换输入框标记;关闭后输入框不再显示分支标记,改为在「Git」标签旁显示状态圆点(绿=已同步、橙色=有变更),两者互斥,保存后立即生效。同一处配置区还可设置差异对比的默认视图(统一 / 并排)、提交历史图的线条样式(平行线 VSCode 风格 / 紧凑 git log 风格,默认平行线)。「AI 生成提交信息」为独立配置卡片:开关按钮之外,可设置生成语言(自动 / 中文 / English,默认自动——跟随你在此仓库的提交语言)并调整输入预算 / 输出上限 / 生成超时三项(范围 16–512 KiB / 256–16384 tokens / 5–120 秒,超出范围的值会被夹到边界)。
|
|
42
|
-
- **输入框 Git 标记**:一个 zsh 主题风格的 `<仓库名> (<分支>)` 标记,仓库名青色,`(分支)` 在已同步时为绿色、有未提交变更时为橙色;悬停显示完整仓库路径,点击跳转面板(有未提交变更进入变更记录,否则进入 Git 总览);非 Git 目录不显示输入框标记,可通过工作区的「Git」标签进入文件浏览。
|
|
29
|
+
- **Git 总览**:三栏——分支 / 标签列表、可搜索(提交信息、commit 哈希、作者、日期)的提交历史图、选中提交的变更文件树与提交信息;点文件在 modal 里查看该文件在此提交中的差异。
|
|
30
|
+
- **变更记录**:逐文件暂存 / 取消暂存 / 丢弃与批量放弃选中改动(二次确认)、手动提交与 **Amend**、贮藏(创建 / 应用 / 弹出 / 丢弃),以及文件数与增删行统计。
|
|
31
|
+
- **常用 Git 操作**:分支切换(远程引用落为同名跟踪分支,不留游离 HEAD;有未提交改动可先贮藏再切换)、标签创建与删除、提交还原 / 重置(硬重置会列出将丢弃的改动并要求额外勾选)。都只改写本地仓库,不自动推送。
|
|
32
|
+
- **AI 生成提交信息**:按当前未提交变更与仓库既有提交风格生成提交信息,语言默认跟随仓库历史自动推断(也可固定中文 / English);模型可在详情页从 DSH 模型列表中固定选择(提供方 → 模型 → 推理强度三级级联,**默认跟随当前会话**),并可关闭生成或调整输入预算、输出上限与超时。**生成会把 diff 内容发送给你所选模型的供应商。**
|
|
33
|
+
- **输入框 Git 标记**:zsh 风格的 `<仓库名> (<分支>)`,已同步为绿色、有未提交变更为橙色;悬停显示仓库路径,点击跳转面板。可在插件详情页关闭,改为在「Git」标签旁显示状态圆点。
|
|
34
|
+
- **文件浏览**:面板内直接浏览工作区目录树(按需加载、`.gitignore` 项半透明、不显示 `.git`)并预览代码 / Markdown / HTML / 图片(Markdown 渲染视图内嵌的本地图片可直接显示,如 README 配图;```mermaid 代码块渲染为图表,解析失败回退为代码块);源码预览默认自动换行,可切换为横向滚动查看长行;非 Git 目录也能用,以当前工作目录为根。
|
|
35
|
+
- **差异与源码查看**:统一 / 对照 / 变更前 / 变更后四种视图,语法高亮、词级改动强调、块间隐藏上下文按需展开,<kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>F</kbd> 就地查找;图片以光标为锚点缩放(10%–800%)、可拖拽平移与全屏。
|
|
36
|
+
- **窄面板 / 移动端**:宽度 ≤620px 时自动切为单栏「钻取」布局(分支筛选改为底部弹层、提交行改两行式),变宽后自动恢复三栏。
|
|
37
|
+
- **共享工作区护栏**:与 dsh 的 AI 共用同一仓库,写操作弹窗统一提示「可直接让 AI 执行 Git 操作」;撞上 `.git/index.lock` 会自动重试一次并提示「Git 正忙」。
|
|
43
38
|
- UI 跟随 DSH 系统语言设置,支持简体中文和英文。
|
|
44
39
|
|
|
40
|
+
## 权限与数据边界
|
|
41
|
+
|
|
42
|
+
面板以 DSH 进程的权限运行,安装前值得知道这些边界:
|
|
43
|
+
|
|
44
|
+
- **Git 命令**:所有 git 命令都经宿主的 `subprocess` 服务执行——argv 数组、不拼接 shell 字符串、工作目录锁定在仓库根,每条命令带超时与输出上限;不使用 `--force`,也不改动 git 配置。
|
|
45
|
+
- **文件访问**:只读工作区内的文件(差异、文件浏览、AI 生成的输入),路径经校验并做 realpath 包含检查——软链指向仓库外一律拒绝,`.git` 不可浏览。**唯一的写盘动作**是「放弃未跟踪条目」:按你的确认直接删除工作区文件,条目本身是 Git 仓库时整批拒绝。
|
|
46
|
+
- **网络**:插件自身只发起一个请求——`GET https://api.github.com/repos/<owner>/<repo>/releases/latest`,用于版本条上的「有新版本」提示(5 秒超时,结果带进程内缓存)。`fetch` / `pull` / `push` / `publish` 只在你点击后经 git 命令联网,凭据始终由 git 处理;插件不读取、不存储、不返回任何令牌或凭据。
|
|
47
|
+
- **外部服务**:只有「AI 生成提交信息」会把 diff 内容发送给你在 DSH 中配置的模型供应商;模型调用由宿主完成,插件不持有凭据。
|
|
48
|
+
- **系统依赖**:需要 `git` CLI;未安装 git 或目录不是 Git 仓库时只显示文件浏览,以当前工作目录为根。
|
|
49
|
+
|
|
50
|
+
客户端 bundle(`lib/client.js`)不发起网络请求,只与宿主走同源 RPC;插件不采集遥测。面板字号、分栏宽度这类界面偏好只存在浏览器 localStorage,不含仓库内容。除 git 命令与被确认的删除外,插件代码不在工作区之外读写文件;详情页的配置项由宿主写进 profile 配置。
|
|
51
|
+
|
|
45
52
|
## 界面
|
|
46
53
|
|
|
47
54
|
| Git 总览 | 文件差异 modal |
|
|
@@ -49,6 +56,8 @@ dsh plugin --profile web add github:xbzbing/dsh-git-panel
|
|
|
49
56
|
|  |  |
|
|
50
57
|
| 变更记录 | 文件浏览 |
|
|
51
58
|
|  |  |
|
|
59
|
+
| 窄面板 / 移动端 | 插件配置 |
|
|
60
|
+
|  |  |
|
|
52
61
|
|
|
53
62
|
## 架构
|
|
54
63
|
|
|
@@ -67,7 +76,7 @@ npm run test:e2e # 隔离的 file:// 无头浏览器 e2e(不碰任何运行
|
|
|
67
76
|
npm test # 单测 + e2e
|
|
68
77
|
```
|
|
69
78
|
|
|
70
|
-
host 产物按 `src/host/` 逐模块输出(一个源文件一个 js,堆栈直接落在出问题的模块),且不做压缩:typert 网关靠方法参数名做参数校验,压缩会改名并破坏 wire 契约。client
|
|
79
|
+
host 产物按 `src/host/` 逐模块输出(一个源文件一个 js,堆栈直接落在出问题的模块),且不做压缩:typert 网关靠方法参数名做参数校验,压缩会改名并破坏 wire 契约。client 改动有热重载:重新构建 `lib/client.js` 后,运行中的 dsh 秒级检测到文件变化并推给浏览器原地热替换,无需刷新页面;host 半改动仍需重启(已加载的旧代码跑到重启为止)。`lib/` 是本地构建产物、不入库;本地联调:把插件加入 dsh web profile 的 `dsh.profile.bundles`,用 `file:` 依赖指向本目录,`node build.mjs` 后即生效。
|
|
71
80
|
|
|
72
81
|
## 项目结构
|
|
73
82
|
|
|
@@ -98,6 +107,10 @@ src/
|
|
|
98
107
|
diff.ts unified diff → 并排行 + 统一行 + 统计
|
|
99
108
|
```
|
|
100
109
|
|
|
110
|
+
## 致谢
|
|
111
|
+
|
|
112
|
+
感谢 [@ivanant](https://github.com/ivanant) 为项目提出的各种优化建议和迭代需求。移动端布局、变更记录的批量选择、AI 生成提交信息、提交图与图标的细节打磨、没有远程分支时的推送(publish)等改进,大多来自他持续反馈的真实使用场景;这些反馈把面板从「能用」推到了现在的形态。
|
|
113
|
+
|
|
101
114
|
## 许可证
|
|
102
115
|
|
|
103
116
|
本项目采用 [MIT License](LICENSE)。
|