From c46f53a627393766b6a7a4efc10218cbb792e7e3 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 2 Feb 2023 13:39:55 +0800 Subject: [PATCH] Fix diff UI for unexpandable items (#22700) Follows #21094 Before: There are 2 problems: 1. Sometimes, the header starts with a number, sometimes, it starts with an icon button. It makes the UI look like misaligned. 2. The second item's bottom border is too thick (actually, that's an empty element with border, which should be hidden as well) 3. (An old problem) the number is not mono-font ![image](https://user-images.githubusercontent.com/2114189/215935944-003fe2d3-69bf-413c-bbae-0a4668a508c3.png) After: Fix above problems. ![image](https://user-images.githubusercontent.com/2114189/215944811-b867a20c-110c-47a2-aa52-572a8162a44d.png) --------- Co-authored-by: Lunny Xiao Co-authored-by: John Olheiser --- templates/repo/diff/box.tmpl | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index f74714499a..798a7eae14 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -76,19 +76,18 @@ {{$isImage := or (call $.IsBlobAnImage $blobBase) (call $.IsBlobAnImage $blobHead)}} {{$isCsv := (call $.IsCsvFile $file)}} {{$showFileViewToggle := or $isImage (and (not $file.IsIncomplete) $isCsv)}} -
+ {{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}} +