@xbzbing/dsh-git-panel 1.6.1 → 1.6.2

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 CHANGED
@@ -26,7 +26,7 @@ After installing or updating, restart the `dsh web` service and refresh the page
26
26
 
27
27
  - **Overview** — three columns. The left column is the branch / tag list; clicking a ref filters history by it. The middle column is the commit history graph, searchable by commit message, commit hash, author, or date; hovering a commit shows a card with its full commit message (comment). The right column is the selected commit's changed-file tree and commit message; click a file to see its diff within that commit in a modal.
28
28
  - **Changes** — the local working tree. The left column has a statistics bar (file count / added·deleted lines / last-change time), the uncommitted change list with per-file checkboxes, and a commit box with an **Amend** checkbox; per-file stage / unstage / discard and manual commit are supported. The right column is the selected file's diff.
29
- - **AI commit-message suggestion** — the "AI suggest" button beside the commit box writes a commit message from the current uncommitted changes (restricted to your checked files when any are selected) in the style of the latest commit, using the model you have configured in DSH; the result lands in the commit box for you to edit before committing. No changes to summarize, a missing model service, and generation failures all report a clear message. **Privacy note: the generation request sends your diff content to the provider of the model you configured in DSH.** The plugin detail page can turn the button off and tune the input budget (diff bytes sent to the model, default 128 KiB), the output limit (default 4096 tokens; reasoning counts against it on thinking models), and the generation timeout (default 15 s).
29
+ - **AI commit-message suggestion** — the "AI suggest" button beside the commit box writes a commit message from the current uncommitted changes (restricted to your checked files when any are selected) in the style of the repository's existing commits, using the model you have configured in DSH; the result lands in the commit box for you to edit before committing (while it runs, the box turns read-only and shows a loading icon inside it, so your typing cannot race the result; on success it is filled and focused, and a failure never overwrites what you already wrote). No changes to summarize, a missing model service, and generation failures all report a clear message. **The language is automatic by default**: it is inferred from the repository's own commit history (a recency-weighted vote that ignores mechanical commits such as releases, merges and reverts, and looks only at the current git author's commits once they number 3 or more), so a Chinese repository gets Chinese and an English one gets English; the plugin detail page can also pin 中文 or English. **Privacy note: the generation request sends your diff content to the provider of the model you configured in DSH.** The plugin detail page can turn the button off and tune the input budget (diff bytes sent to the model, default 128 KiB), the output limit (default 4096 tokens; reasoning counts against it on thinking models), and the generation timeout (default 15 s).
30
30
  - **Tag management** — the commit-detail header in the Overview right column creates a tag at the selected commit (lightweight, or annotated with a message); tags already on that commit show as deletable chips, and deletion asks for confirmation. Creating and deleting tags only affects the local repository and is never pushed to the remote; run `git push <remote> <tagname>` (or `--tags`) yourself to sync.
31
31
  - **Stash** — the Changes page stashes the current uncommitted changes (with an optional message); the stash list below supports apply / pop / drop. A pop or apply that conflicts keeps the stash entry and reports it, so nothing is lost halfway. Drop asks for confirmation.
32
32
  - **Switch branch** — hovering a local branch or remote ref in the Overview left column reveals a "Switch" button at the end of the row (on a narrow panel the rows of the "Filter branch" bottom sheet carry it; touch devices always show it). The checked-out branch has none, and clicking the row itself still filters the history. Clicking "Switch" opens a confirm dialog. A remote ref is never checked out directly (that would detach HEAD): an existing local branch of the same name is switched to, otherwise the confirm step runs `git checkout -b <name> --track <origin/name>` to create and track it. The dialog shows the current → target switch, and when there are uncommitted changes it reports the count and offers both ways out — switch directly (git refuses and leaves the work tree untouched if the changes collide with the target) or stash first (untracked files included) and restore them afterwards from Changes → Stash (never restored automatically; restoring may need manual conflict resolution). A landed switch reloads the history, branch list, change list, and the Files tab's directory cache.
@@ -38,7 +38,7 @@ After installing or updating, restart the `dsh web` service and refresh the page
38
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
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
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 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).
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
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.
43
43
  - The UI follows the DSH system language, in Simplified Chinese and English.
44
44
 
@@ -80,7 +80,7 @@ src/
80
80
  core.ts workspace resolution + snapshotForSession
81
81
  actions.ts GitAction → git command sequences (commit / amend / stage …)
82
82
  queries.ts history / diff / file-lines / image-diff / dir-list / file-content / show / branches / tags / worktree-stats
83
- suggest.ts AI commit-message suggestion (diff collection + one ctx.llm call)
83
+ suggest.ts AI commit-message suggestion (diff collection + language inference + one ctx.llm call)
84
84
  parser.ts git output parsed into structured data
85
85
  version.ts package version + GitHub release update check
86
86
  client/
package/README.md CHANGED
@@ -26,7 +26,7 @@ dsh plugin --profile web add github:xbzbing/dsh-git-panel
26
26
 
27
27
  - **Git 总览**:三栏布局。左栏是分支 / 标签列表,点击某个引用即按它过滤历史;中栏是提交历史图,支持按提交信息、commit 哈希、作者、日期搜索,悬停某条提交弹出卡片显示完整提交信息(comment);右栏是选中提交的变更文件树与提交信息,点击文件在弹出的 modal 里查看该文件在此提交中的差异。
28
28
  - **变更记录**:面向本地工作区。左栏是统计条(文件数 / 增删行数 / 最近变更时间)、带复选框的未提交变更列表、以及含 **Amend** 复选框的提交框,支持逐文件暂存 / 取消暂存 / 丢弃与手动提交;右栏是选中文件的差异对照。
29
- - **AI 生成提交信息**:提交框旁的「AI 生成」按钮根据当前未提交变更(勾选了文件则只看这些文件)与最近一次提交的风格,调用你在 DSH 中配置的模型生成提交信息,填入提交框后可编辑再提交;没有可生成的变更、模型服务不可用或生成失败都会给出明确提示。**隐私提示:生成请求会把 diff 内容发送给你在 DSH 中所配置模型的供应商。** 可在插件详情页关闭该按钮,并调整输入预算(发送给模型的 diff 上限,默认 128 KiB)、输出上限(默认 4096 tokens,思考模型的推理计入该预算)与生成超时(默认 15 秒)。
29
+ - **AI 生成提交信息**:提交框旁的「AI 生成」按钮根据当前未提交变更(勾选了文件则只看这些文件)与仓库既有提交风格,调用你在 DSH 中配置的模型生成提交信息,填入提交框后可编辑再提交(生成期间提交框转为只读并在框内显示 loading 图标,避免手写内容与生成结果竞争;成功后自动填入并聚焦,失败不覆盖已有草稿);没有可生成的变更、模型服务不可用或生成失败都会给出明确提示。**生成语言默认自动**:从仓库历史提交的语言推断(按新旧加权的投票,忽略 release / merge / revert 等机械提交;当前 git 作者在此仓库有 ≥3 条提交时只看本人的),中文仓库即生成中文、英文仓库即生成英文,也可在插件详情页固定为中文或 English。**隐私提示:生成请求会把 diff 内容发送给你在 DSH 中所配置模型的供应商。** 可在插件详情页关闭该按钮,并调整输入预算(发送给模型的 diff 上限,默认 128 KiB)、输出上限(默认 4096 tokens,思考模型的推理计入该预算)与生成超时(默认 15 秒)。
30
30
  - **标签管理**:在「Git 总览」右栏的提交详情顶部可为选中的提交创建标签(轻量标签,或带说明的附注标签);该提交上已有的标签以可删除的标签片呈现,删除走二次确认。创建与删除标签都只作用于本地仓库,不会推送到远程,如需同步需自行 `git push <remote> <tagname>`(或 `--tags`)。
31
31
  - **切换分支**:鼠标移到 Git 总览左栏的本地分支或远程引用行上,行尾出现「切换」按钮(窄面板在「筛选分支」底部弹层的行上,触屏设备按钮常显);当前分支没有该按钮,单击行本身仍是筛选提交历史。点击「切换」后弹出确认框。远程引用不会直接检出(那会游离 HEAD):已有同名本地分支就切换它,否则确认后执行 `git checkout -b <名> --track <origin/名>` 创建本地分支并设置跟踪。确认框显示「当前 → 目标」;有未提交变更时列出数量并提供两种选择——直接切换(与目标分支冲突时由 Git 拒绝、工作区不变),或先贮藏(含未跟踪文件)再切换,之后到「变更记录 → 贮藏」手动恢复(不会自动恢复,恢复冲突需手动解决)。切换成功后提交历史、分支列表、变更列表与文件浏览的目录缓存一并刷新。
32
32
  - **提交回撤**:同一处提交操作区可「还原此提交」(revert,追加一个反向提交、不动工作区)或「重置到此」(reset,软 / 混合 / 硬三挡)。硬重置会列出将被永久丢弃的未提交改动并要求额外勾选确认,始终不作为默认方式;检测到未提交改动时提示这些改动可能是 dsh AI 正在进行的工作。还原与重置都只改写本地仓库,不会推送到远程,远端分支需你自行推送同步。
@@ -38,7 +38,7 @@ dsh plugin --profile web add github:xbzbing/dsh-git-panel
38
38
  - **语法高亮差异**:总览弹窗、变更记录和文件浏览共用 dsh 官方语法高亮,按文件扩展名选择语言,语法资源按需加载;差异视图的改动词级强调保留原有交互。
39
39
  - **对照模式**:差异支持「统一 / 对照 / 变更前 / 变更后」四种视图切换。统一视图为单栏行内对比(改动行前后紧邻,省横向空间),对照视图为左右并排;两种视图都带块间隐藏上下文的按需展开与改动行的词级高亮。默认视图可在插件详情页选择(统一 / 并排),也可在每个差异视图工具栏临时切换。
40
40
  - **移动端 / 窄面板自适应**:面板宽度收窄到 620px 及以下(手机竖屏,或右侧栏挤压面板)时自动切换为单栏「钻取」布局——三栏折叠为一栏,列表与详情 / 差异 / 预览之间点击进入、带「返回」按钮退出;Git 总览的分支筛选改为从底部升起的面板(bottom sheet),提交行改为两行式更易点按,顶栏控件换行到第二行而非隐藏,差异对比在窄屏隐藏「对照」(并排)模式。面板变宽后自动恢复三栏布局,桌面体验不变。触控设备(如平板)上逐文件操作按钮常驻显示、点按区域放大。
41
- - **显示输入框标记开关**:插件详情页可切换输入框标记;关闭后输入框不再显示分支标记,改为在「Git」标签旁显示状态圆点(绿=已同步、橙色=有变更),两者互斥,保存后立即生效。同一处配置区还可设置差异对比的默认视图(统一 / 并排)、提交历史图的线条样式(平行线 VSCode 风格 / 紧凑 git log 风格,默认平行线)。「AI 生成提交信息」为独立配置卡片:开关按钮之外,可调整输入预算 / 输出上限 / 生成超时三项(范围 16–512 KiB / 256–16384 tokens / 5–120 秒,超出范围的值会被夹到边界)。
41
+ - **显示输入框标记开关**:插件详情页可切换输入框标记;关闭后输入框不再显示分支标记,改为在「Git」标签旁显示状态圆点(绿=已同步、橙色=有变更),两者互斥,保存后立即生效。同一处配置区还可设置差异对比的默认视图(统一 / 并排)、提交历史图的线条样式(平行线 VSCode 风格 / 紧凑 git log 风格,默认平行线)。「AI 生成提交信息」为独立配置卡片:开关按钮之外,可设置生成语言(自动 / 中文 / English,默认自动——跟随你在此仓库的提交语言)并调整输入预算 / 输出上限 / 生成超时三项(范围 16–512 KiB / 256–16384 tokens / 5–120 秒,超出范围的值会被夹到边界)。
42
42
  - **输入框 Git 标记**:一个 zsh 主题风格的 `<仓库名> (<分支>)` 标记,仓库名青色,`(分支)` 在已同步时为绿色、有未提交变更时为橙色;悬停显示完整仓库路径,点击跳转面板(有未提交变更进入变更记录,否则进入 Git 总览);非 Git 目录不显示输入框标记,可通过工作区的「Git」标签进入文件浏览。
43
43
  - UI 跟随 DSH 系统语言设置,支持简体中文和英文。
44
44
 
@@ -80,7 +80,7 @@ src/
80
80
  core.ts workspace 解析 + snapshotForSession
81
81
  actions.ts GitAction → git 命令序列(commit / amend / stage 等)
82
82
  queries.ts history / diff / file-lines / image-diff / dir-list / file-content / show / branches / tags / worktree-stats
83
- suggest.ts AI 生成提交信息(diff 收集 + ctx.llm 一次性调用)
83
+ suggest.ts AI 生成提交信息(diff 收集 + 提交语言推断 + ctx.llm 一次性调用)
84
84
  parser.ts git 输出解析为结构化数据
85
85
  version.ts 本包版本 + GitHub release 更新检查
86
86
  client/