From fba4ee7efcd0baead1611c0885468c15916cc7e1 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 25 Oct 2023 00:47:17 +0200 Subject: [PATCH 1/7] Add gap between diff boxes (#27776) Before (almost no gap between files): Screenshot 2023-10-24 at 19 43 32 After (with 8px gap): Screenshot 2023-10-24 at 19 43 22 --- web_src/css/repo.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index c3e230f8e1389..7d76dd8b3ffdd 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -2734,6 +2734,9 @@ tbody.commit-list { #diff-file-boxes { flex: 1; max-width: 100%; + display: flex; + flex-direction: column; + gap: 8px; } #diff-file-tree { From 572f0963edc71239634ee782a3c69213479f34ba Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 25 Oct 2023 05:09:18 +0200 Subject: [PATCH 2/7] Only show diff file tree when more than one file changed (#27775) When 0 or 1 files changed in a diff, we don't need to show a file tree. This behaviour matches GitHub. Single-file diff after this change, note absence of button: image Co-authored-by: Giteabot --- templates/repo/diff/box.tmpl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 289ed90d3fd3f..c037c3b365238 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -1,7 +1,8 @@ +{{$showFileTree := (and (not .DiffNotAvailable) (gt .Diff.NumFiles 1))}}
- {{if not .DiffNotAvailable}} + {{if $showFileTree}}