From aa4d1d94f79e8edd9fa9ff2813fea12b085b2cae Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 30 Mar 2023 14:06:10 +0200 Subject: Diff improvements (#23553) - Avoid flash of wrong tree toggle icon on page load by setting icon based on sync state - Avoid "pop-in" of tree on page load by leaving space based on sync state - Use the same border/box-shadow combo used on comment `:target` also for file `:target`. - Refactor `DiffFileTree.vue` to use `toggleElem` instead of hardcoded class name. - Left-align inline comment boxes and make them fit the same amount of markup content on a line as GitHub. - Fix height of `diff-file-list` Fixes: https://github.com/go-gitea/gitea/issues/23593 Screenshot 2023-03-18 at 00 52 04 Screenshot 2023-03-18 at 00 59 43 Screenshot 2023-03-18 at 01 27 14 Screenshot 2023-03-19 at 21 44 16 (Yes I'm aware the border-radius in bottom corners is suboptimal, but this would be notorously hard to fix without relying on `overflow: hidden`). --- templates/repo/diff/box.tmpl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 4a5fc4b7cf..36e669276e 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -15,11 +15,18 @@
- + +
{{svg "octicon-diff" 16 "gt-mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
@@ -68,6 +75,9 @@
+
{{range $i, $file := .Diff.Files}} {{/*notice: the index of Diff.Files should not be used for element ID, because the index will be restarted from 0 when doing load-more for PRs with a lot of files*/}} -- cgit v1.2.3