v0.1.5
dsh-diff-stat v0.1.5
Seventh release. The diff surfaces learn line-number gutters — the file peek numbers its lines and the diff window pins every hunk to its real position in the current file — plus a separated sticky path header, three presentation fixes (the undo button no longer clips at the card edge, the phantom horizontal scrollbar is gone, the review diff matches the peek width), and the supported harness matrix extends to
0.1.2-alpha.3.
Install / 安装
# from npm / 从 npm 安装
dsh plugin --profile web add dsh-diff-stat
# or from GitHub / 或从 GitHub 安装
dsh plugin --profile web add github:HaoyueQin/dsh-diff-statUninstall:
dsh plugin --profile web remove dsh-diff-statHighlights / 亮点
- Line-number gutters: the file peek numbers its lines
1..N; the diff window resolves each hunk's numbering basis from ONE cached fenced read — the post-image locate for hunks with content, the old side's leading shared context for deletion-only hunks, a free1for settled wire creates/overwrites. Deleted rows read the old side, context/added rows the new side, changed rows carry the reference accent bars, and the number column is sticky-left while long lines scroll beneath it. A hunk that cannot be located (host absent, drifted file, over budget) numbers window-relatively1..N— the gutter always renders, and never invents positions it cannot prove. - Separated sticky path header: the file path no longer blends into the numbered rows — it sits in its own bordered strip above the body (the inline peek's top-bar presentation), pinned to the pane top while a long diff scrolls, with the name itself sticky-left over horizontal scrolling.
Fixes / 修复
- The undo button stays inside the card: the card header declared
width: 100%next to its horizontal padding, and the harness ships no global border-box reset — under content-box sizing the header's padding box overflowed the card by 20px, the flex content area ran to theoverflow:hiddenclip edge, and the auto-margin undo button rendered flush against it, slicing the last glyph (撤销). The redundant width is dropped andbox-sizing: border-boxpinned. - No more phantom horizontal scrollbar: every diff row sized
min-width: 100%under content-box, so each row plus its horizontal padding overflowed the scroll pane by a constant 16px — the pane carried a scrollbar even when the diff lines were short. - The review diff matches the peek width: the turn card indented the expanded diff 30px from the left, so reviewing and peeking the same file stacked two panes of visibly different widths. Both are children of the same file-row block sharing the right edge; the inset is dropped and the diff spans the peek width exactly.
Infrastructure / 基建
- Supported harness matrix extends to
0.1.2-alpha.3: client-runtime, ui-slots, thetool.call.toolviewandconversation.chat.turnTailslot contracts, theuiConversationevent registry, and the wireFsDiffMetaare diff-free between alpha.2 and alpha.3 — verified item by item against the tag diff, zero code adaptation. The align check gains gutter-numbering invariants (replacement, insertion, and gapped hunks across located and relative bases).
Full Changelog: v0.1.4...v0.1.5
中文说明
第七个版本。主线:行号槽、路径头分隔条与三处展示修复,支持矩阵延展至 0.1.2-alpha.3。
行号槽:文件视图按 1..N 编号;diff 窗口把每个 hunk 钉到当前文件中的真实位置——展开窗口只做一次缓存围栏读取(prepareDiffWindow,与上下文增强合并):有内容的 hunk 唯一匹配后像定位,纯删除 hunk 锚定旧侧前导共享上下文,已结算的 wire 创建/覆盖免定位(后像即整个文件,基准为 1),超预算 hunk 跳过定位。删除行读旧侧号码(红)、上下文/新增行读新侧号码,变更行带左缘色条;号码列 sticky-left,横向滚动长行时恒在。无法定位的 hunk(host 缺席、文件已被再改动、超预算)退回窗口内 1..N 相对编号——行号槽始终渲染,但绝不报无法证实的号。对齐行携带各侧行索引(del 仅 oldIdx、add 仅 newIdx、ctx 双带),check:align 新增编号不变量断言(替换/插入/带 gap,定位与相对两种基准)。
路径头分隔条:diff 窗口顶部的文件名此前混在行号行中,现独立为带底边的分隔条(与内嵌查看顶栏同款:三等字色、磨砂底);长 diff 竖向滚动时钉在窗口顶部,横向滚动时文件名钉在左侧——对应内嵌查看「顶栏始终可见」的行为。
展示修复:①撤销按钮裁字——.header 的 width:100% 加水平内边距在 harness 无全局 border-box 重置的环境下按 content-box 外溢 20px,flex 行可用区顶到卡片 overflow:hidden 剪裁边,margin-left:auto 的撤销按钮被竖切最后一字;去掉冗余宽度并钉 box-sizing: border-box(对齐 stock 逐元素声明惯例)。②幻影横向滚动条——每行 min-width:100% 加内边距按 content-box 恒溢出滚动容器 16px,短内容也常驻滚动条;border-box 根除。③审查与打开等宽——轮末卡展开 diff 曾有 30px 左缩进,同一文件的审查与内嵌查看堆叠出两种宽度;缩进移除,两者同列同宽。
验证:pnpm typecheck、pnpm check:align、pnpm build 全绿;发布 tag 经 CI 校验「tag 名 == package.json 版本」与「lib 零漂移」后自动出包(run 33480646569 全绿)。