From 1fcf96ad0166420cbdb013365ecae42e3537b42a Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 21 Feb 2023 21:36:53 +0800 Subject: [PATCH] Improve PR Review Box UI (#22986) This PR follows: * #22950 ### Before The Review Box has many problems: * It doesn't work for small screens. * It has an anonying animation which makes the UI laggy. * It uses "custom dropdown menu" which is very difficult to fine tune. * `$().toggle('visible')` is not a correct call * jQuery just accepts any invalid `duration` argument: `$().toggle('anyting')` * The button is not a button.
![image](https://user-images.githubusercontent.com/2114189/219948865-6da3f39c-6fde-4c86-9e42-da5020f3d0c3.png)
### After These problems are fixed, and eliminate many `!important` games.
![image](https://user-images.githubusercontent.com/2114189/219952744-8862fe1a-7ef1-49e4-bf92-2d0c1f104ee4.png) ![image](https://user-images.githubusercontent.com/2114189/219952771-be169a76-45fd-47a8-8f9c-b447d064f4ca.png) ![image](https://user-images.githubusercontent.com/2114189/219952784-3f52e9b7-64ce-4ad1-9553-64c33fb83042.png)
And most dropdown icons still looks good:
![image](https://user-images.githubusercontent.com/2114189/219952942-52866a00-e0f9-4af7-8fb5-eb1a8cad1ff3.png) ![image](https://user-images.githubusercontent.com/2114189/219948909-b3bfb844-f84e-4b79-ab1f-382ec66dec31.png)
Co-authored-by: delvh --- templates/repo/diff/box.tmpl | 4 ++-- templates/repo/diff/new_review.tmpl | 10 ++++----- templates/repo/home.tmpl | 2 +- web_src/js/features/common-global.js | 1 + web_src/js/features/repo-issue.js | 10 ++++----- web_src/less/_base.less | 21 +++++------------- web_src/less/_editor.less | 2 +- web_src/less/_repository.less | 5 ----- web_src/less/_review.less | 32 +++++++++++++--------------- 9 files changed, 35 insertions(+), 52 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 1e79824355..4e6879650d 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -24,10 +24,10 @@ {{svg "octicon-diff" 16 "gt-mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}} -
+
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}} -