Repository navigation
Releases: xbzbing/dsh-git-panel
Release list
v1.5.3
中文
Git 总览提交详情与分支列的交互/样式打磨。
- 变更文件树可折叠:提交详情右栏的变更文件树,目录此前写死为展开、箭头点击无效(看似可折叠实则不可),现修复为可点击折叠/展开;默认全展开,切换选中提交时重置为全展开。目录行支持键盘操作(Tab 聚焦、Enter/Space 切换)。
- 「全部分支」居中:分支列顶部「全部分支」标题改为居中对齐。
English
Interaction and style polish for the Git-overview commit detail and branch column.
- Collapsible changed-file tree: in the commit detail, the changed-file tree's folders were hardcoded open with an inert chevron (looked collapsible but wasn't). Folders are now click-collapsible; expanded by default and reset to fully expanded when the selected commit changes. Folder rows are keyboard-operable (Tab to focus, Enter/Space to toggle).
- Centered "all branches": the "all branches" header at the top of the branch column is now center-aligned.
Full Changelog: v1.5.2...v1.5.3
v1.5.2
中文
Git 总览提交详情新增变更汇总。
- 变更汇总行:右栏「提交详情」在选中提交后,于文件树上方显示该提交的变更文件数与 +增 / −删行数,下方以分隔线与文件列表区分。
- 口径:行数绑定到变更文件列表——二进制文件计入文件数但不计行;洁净合并(文件列表为空)统计清零,与文件树保持一致。
- 行数经 host
git show --numstat本地求和,与原有命令并行、结果缓存,仅在点选提交时按需取数,对面板性能无感知影响。
English
Adds a change summary to the Git-overview commit detail.
- Change summary row: after selecting a commit, the right-pane detail shows the commit's changed-file count and +added / −deleted lines above the file tree, separated from the file list by a divider.
- Convention: line counts are bound to the changed-file list — binary files count as files but contribute no lines; a clean merge (empty file list) reports zero, consistent with the file tree.
- Counts come from a local
git show --numstatrun in parallel with the existing commands and cached, fetched only on commit selection — no perceptible impact on panel performance.
Full Changelog: v1.5.1...v1.5.2
v1.5.1
中文
状态栏同步能力补全 + 交互细节打磨。
- 推送 / 发布:本地严格领先(ahead>0 且 behind===0)时,状态栏新增「推送」按钮(纯
git push,绝不--force,确认框预览待推送范围);分支无上游时提供「发布」按钮(git push -u <remote> HEAD,二次确认)。分叉时推送、拉取均不提供。远程名经isSafeRemoteName校验,推送错误信息剥除内嵌凭据。 - 同步检查提示:「检查同步」按钮增加 hover 提示,简要说明功能。
- 更快的 tooltip:状态栏与版本条改用统一的自定义快速 tooltip(约 140ms,替代原生 ~500ms 延迟);精简中文动作标签。
- 星标邀请:顶部星标链接改用快速 tooltip,并加入点亮 star 的邀请文案。
English
Completes the status-bar sync capability and polishes interaction details.
- Push / Publish: when strictly ahead (ahead>0 and behind===0), the status bar now shows a Push button (plain
git push, never--force, with an outgoing-range preview); a branch with no upstream gets a Publish button (git push -u <remote> HEAD, double-confirm). Neither is offered when diverged. The remote name is validated viaisSafeRemoteNameand credentials are scrubbed from push error messages. - Sync-check hint: the "check sync" button now carries a hover tooltip explaining what it does.
- Faster tooltips: the status bar and version bar use a shared fast custom tooltip (~140ms, replacing the native ~500ms delay); shortened the Chinese action labels.
- Star invite: the top star link uses the fast tooltip and adds a friendly star-us invitation.
Full Changelog: v1.5.0...v1.5.1
v1.5.0
中文
新增:Git 总览左列状态栏
- 左侧新增常驻状态栏:远程仓库链接(仅 GitHub 项目显示图标,点击在新标签页打开仓库主页;内嵌凭据已剥除,不泄入链接)。
- 右侧显示当前分支的同步状态(已同步 / 领先 / 落后 / 分叉 / 无上游)+「检查同步」按钮(
git fetch --all --prune,回灌最新快照刷新 ahead/behind)。 - 仅在「严格落后」(落后 > 0 且领先 = 0)时出现「拉取同步」按钮:走
git pull --ff-only快进拉取,确认框预览将引入的提交数 / 文件数 / 增删行(全本地统计、无网络),不产生合并提交、不动未提交内容。 - 网络命令注入
GIT_TERMINAL_PROMPT=0,遇凭据/主机密钥交互快速失败而非挂起。 - 分支列表行新增选中背景样式。
修复
parseRefs按refs/heads|remotes|tags正确分类,斜杠本地分支(如feat/x)不再被误判为远程 ref 标签。- 提交历史图:tip 提交圆点上方不再残留悬空半线。
内部
- 状态栏渲染拆分到
overview-statusbar.tsx,清理冗余 i18n 文案与导出。
兼容性:无破坏性改动,无新增第三方依赖。
English
New: Git overview left-column status bar
- A persistent status bar: remote repository link (icon shown only for GitHub projects, opens the repo home in a new tab; embedded credentials are stripped from the URL).
- Branch sync state (synced / ahead / behind / diverged / no upstream) + a Check sync button (
git fetch --all --prune, feeds a fresh snapshot back to refresh ahead/behind). - A Pull button appears only when strictly behind (behind > 0 and ahead = 0): a
git pull --ff-onlyfast-forward, with a confirm dialog previewing the incoming commits / files / ± lines (all computed locally, no network). No merge commit, uncommitted work untouched. GIT_TERMINAL_PROMPT=0on network commands so credential/host-key prompts fail fast instead of hanging.- Branch-list rows gained a selection background.
Fixes
parseRefsclassifies byrefs/heads|remotes|tags; a slashed local branch (e.g.feat/x) is no longer misclassified as a remote ref chip.- Commit graph: no dangling half-line above a tip commit's node.
Internal
- Status bar extracted into
overview-statusbar.tsx; dead i18n strings and a stray export removed.
No breaking changes, no new third-party dependencies.
Full changelog: v1.4.0...v1.5.0
v1.4.0
主要变更
- Git 操作区(Git 总览的提交详情):为提交创建/删除标签(轻量或附注)、贮藏当前改动并应用/弹出/丢弃、还原提交(revert)、重置到提交(软/混合/硬;硬重置会列出将丢失的改动并需额外确认)。所有写操作走二次确认,弹窗底部恒显「信任 AI」提示。
- 提交历史图:修复连线与配色(按车道单色、主分支线钉在最左);新增线条样式切换——平行线(VSCode 风格,默认)/ 紧凑(git log 风格)。
- 大仓库体验:变更记录列表按行虚拟化,且在数千文件变更时自动简化统计,避免面板卡死(issue #16)。
- 细节:提交详情标签独立成行、hover 卡补充提交时间;README 说明标签/还原/重置均为本地操作、不推送远程。
验证
npm run check全绿:类型检查、183 单测、3 个 e2e、lib/与源码一致。未改依赖,版本 1.3.0 → 1.4.0。
What's changed
- Commit operations (in the Overview commit detail): create/delete tags (lightweight or annotated), stash the current changes and apply/pop/drop, revert a commit, and reset to a commit (soft/mixed/hard; hard reset lists the changes it will discard and needs an extra confirmation). Every write goes through a confirmation dialog with a persistent "trust AI" hint.
- Commit history graph: fixed the lane routing and coloring (one color per lane, main line pinned leftmost); added a line-style toggle — parallel (VSCode-like, default) / compact (git log style).
- Large repositories: the Changes list is row-virtualized, and stats degrade gracefully above thousands of changes so the panel stays responsive (issue #16).
- Details: commit-detail tags on their own row, hover card shows the commit time; README clarifies that tag/revert/reset are local-only and not pushed to the remote.
Verification
npm run checkis green: typecheck, 183 unit tests, 3 e2e, andlib/in sync with source. No dependency changes; version 1.3.0 → 1.4.0.
Full changelog: v1.3.0...v1.4.0
v1.3.0
主要变更
- 移动端 / 窄面板自适应(#7):面板宽度 ≤620px(手机竖屏,或侧栏挤压面板)时切换为单栏「钻取」布局——三栏折叠为一栏,列表与详情 / 差异 / 预览之间点击进入、带「返回」按钮退出;Git 总览分支筛选改为从底部升起的面板(bottom sheet,支持 Escape / 点击背景关闭),提交行改两行式更易点按,顶栏控件换行到第二行而非隐藏,窄屏隐藏「对照」(并排)模式。面板变宽后自动恢复三栏,桌面体验不变。触控设备上逐文件操作按钮常驻、点按区域放大,并适配 safe-area 与 prefers-reduced-motion。
- AI 生成提交信息(#10):变更记录提交框旁新增「AI 生成」按钮,根据当前未提交变更(可按勾选文件缩小范围)与最近一次提交风格,调用你在 DSH 中配置的模型生成提交信息,填入后可编辑再提交;可在插件详情页关闭。隐私提示:生成请求会把 diff 内容发送给所配置模型的供应商。
- 提交历史图修复(#11):修复 Git 总览历史图中每个提交下方多画一条线的问题(车道去重 + 按语义分段绘制边),并修正游离 HEAD 提交链的可见性。
验证
npm run check 全绿:typecheck + 单测 147/147 + e2e(run / run2 / run3 三轮,含移动端钻取/返回/bottom sheet/无横向溢出/split→unified 回退断言)+ lib/ 构建产物新鲜度。host / wire 契约 / 信任边界零改动。
v1.2.0
主要变更
- Git 面板状态粘性:切走工作区标签再在 1 分钟内切回时,保留原来的子 tab(Git 总览 / 变更记录 / 文件浏览),不再重置为默认入口;超过 1 分钟则回归默认进入逻辑。输入框标记的显式跳转仍优先于粘性恢复。
- 文件浏览状态保留:同一窗口内返回时,已展开的目录、目录列表、选中文件及其预览内容、Markdown/HTML 渲染模式一并恢复;加载中的预览会在恢复时自动重新拉取,避免空白。
验证
tsc --noEmit类型检查通过。- 单元测试 127 条(含子 tab 粘性窗口的边界 / 过期 / 刷新用例)、e2e 2 组(含卸载重挂后 Files 子 tab、展开目录、选中项、预览恢复的回归)全部通过。
- 一键门禁
npm run check(类型 + 测试 + lib 与 src 一致)通过。
v1.1.2
主要变更
- 文件浏览:右侧预览区在「复制相对路径」旁新增「复制文件内容」按钮,仅文本文件显示,复制当前预览的文本内容(独立复制状态 + 代际守卫,切换文件时重置)。
- 代码简化:一轮行为等价的内部清理(提交图着色复用局部变量、去除死重赋值与恒真守卫、抽出
commitFromFields去重两处 commit 构造),无用户可见变化。
验证
tsc --noEmit类型检查通过。- 单元测试 123 条、e2e 2 组全部通过(
npm run check门禁:类型 + 测试 + lib 与 src 一致)。
v1.1.1
主要变更
系统未安装 Git(git 不在 PATH)时,不再在面板里显示「Git 不可用」,改为自动退化为「文件浏览」:
- 当前位于 git 目录(文件系统探测到
.git,不依赖 git 进程):退化为文件浏览,并在顶部提示「系统未安装 Git,Git 面板不可用,请安装 Git 工具后重试。」。 - 当前不在 git 目录:静默退化为文件浏览。
- 两种情况下,输入框的分支标记与「Git」标签旁的状态圆点均不显示。
验证
npm run check 全绿:tsc --noEmit 类型检查通过;单元测试 123/123 通过(含 4 条新增:git 目录判定 isGitRepo、无 git 时目录列举回退 cwd 等);e2e(run.mjs / run2.mjs)全通过;lib/ 构建产物与 src/ 一致。
v1.1.0
主要变更
- 文件浏览新增 HTML 预览:HTML 默认显示源码,可点击「渲染」在隔离沙箱(
allow-scripts、无同源权限)中预览页面,不会自动执行。 - 源码视图与差异对照新增 代码内查找(Ctrl/⌘+F):就地高亮全部命中并保留语法着色,显示「当前 / 总数」,Enter / Shift+Enter 或
‹›跳转,可切换区分大小写(默认不敏感),Esc 关闭;命中统计覆盖整份内容,视口外命中同样计入并可跳转。 - 大文件性能:源码视图按行虚拟化(只渲染视口内的行),超大文件关闭语法高亮、超长行截断;查找扫描防抖 + 小写缓存,键入与大小写切换不再逐次重扫全文。
验证
npm run check全绿:typecheck + 120 单测 + 2 e2e(新增 HTML 预览沙箱、两处 Ctrl+F 查找、大小写开关、行虚拟化断言)+lib/一致性校验。