fix(git-lens): 纯重命名不再计入分组合计,计数簇改用字体令牌(#131)
(a) numstat 为 0/0 的条目(纯重命名、仅改权限)行上什么都不打印,但 sumLineCounts 仍把它计进 files,于是「只含纯重命名的分组」在分组头渲染 出一个空的 +N −M 计数簇。合计函数改为跳过两侧都为 0 的条目:合计=「行上 真的打印出来的数字之和」,与既有「二进制 / 未跟踪不贡献任何数」同一条 口径。只改这一个源头,两个分组头共用的 files > 0 门控不用动。 (b) .lineCounts 的裸 font-size: 10px 换成 font: var(--dsw-font-xxxs-11) (11px/14px,weight 400),并按简写要求在其后用 font-family 覆盖回 --ds-font-family-code 代码字体。前后值:10px(行高继承 18px)→ 11px/14px; 行与分组头都是 28px 固定高度、文字 18px 行高,故布局不变,只有数字本身 大 1px。 测试: - change-tree-counts:新增 0/0 条目不参与合计(纯重命名 / 仅改权限), 同时钉住「改了内容的 rename 仍贡献数字」。 - changes-tab:新增「只含纯重命名的两个分组都查不到 [data-lines="group"] 空计数簇」用例(并断言两个重命名行确实渲染了,避免空过),配一条对照 用例「组内真有数字时计数簇照常出现且数字正确」;另加一条样式守护,钉住 .lineCounts 走 --dsw-font-* 令牌、不含裸 font-size px。 - 还原源码/CSS 改动后这三条全红(空 span 被断言到、font 令牌断言失败)。
This commit is contained in:
1 parent
ce8366fb11
commit
504d428b79
4 files changed
+113
-9
No files matched your search
@@ -199,13 +199,16 @@
|
||||
/* A row's / band's line counts (#131): `+N −M` in the diff pane's own ink (the
|
||||
`.statAdd` / `.statDel` atoms of `diff.module.css`, reused rather than
|
||||
re-coloured here). Tabular figures keep the column from shifting between
|
||||
readings, and the code face matches every other number in the tab. */
|
||||
readings, and the code face matches every other number in the tab. Size and
|
||||
line height come from the smallest host font token (11px/14px) — the family
|
||||
is overridden back to the code stack right after the shorthand, which is the
|
||||
order the shorthand requires. */
|
||||
.lineCounts {
|
||||
flex: none;
|
||||
display: inline-flex;
|
||||
gap: 5px;
|
||||
font: var(--dsw-font-xxxs-11);
|
||||
font-family: var(--ds-font-family-code, monospace);
|
||||
font-size: 10px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user