From 2c74ad7a352de733e07e5ea5c398bd5d1fa8d1c4 Mon Sep 17 00:00:00 2001 From: Sebastian Sauer Date: Thu, 2 Nov 2023 21:18:11 +0100 Subject: [PATCH 1/7] Remove duplicate review diff stats they are already displayed in tab menu --- templates/repo/diff/box.tmpl | 5 ----- web_src/css/repo.css | 28 ---------------------------- 2 files changed, 33 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index c037c3b365238..3bd6e4275c610 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -17,11 +17,6 @@ diffTreeBtn.setAttribute('data-tooltip-content', diffTreeBtn.getAttribute(diffTreeVisible ? 'data-hide-text' : 'data-show-text')); {{end}} - {{if not .DiffNotAvailable}} -
- {{svg "octicon-diff" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}} -
- {{end}}
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index e4995d42298b6..19e22093b45c5 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -1515,34 +1515,6 @@ flex-wrap: wrap; } } -.repository .diff-detail-box .diff-detail-stats strong { - margin-left: 0.25rem; - margin-right: 0.25rem; -} - -/* Because the translations contain the we need to style with nth-of-type */ - -.repository .diff-detail-box .diff-detail-stats strong:nth-of-type(1) { - color: var(--color-yellow); -} - -.repository .diff-detail-box .diff-detail-stats strong:nth-of-type(2) { - color: var(--color-green); -} - -.repository .diff-detail-box .diff-detail-stats strong:nth-of-type(3) { - color: var(--color-red); -} - -@media (max-width: 480px) { - .repository .diff-detail-box .diff-detail-stats { - font-size: 0; - line-height: 1.6rem; - } - .repository .diff-detail-box .diff-detail-stats strong { - font-size: 1rem; - } -} .diff-detail-actions { display: flex; From b0f3bbac6ea0930e1eb49f3f091d8b250553f37f Mon Sep 17 00:00:00 2001 From: Sebastian Sauer Date: Thu, 2 Nov 2023 21:20:13 +0100 Subject: [PATCH 2/7] Hide viewed files on screens smaller 480px github hides them on small screens, too --- templates/repo/diff/box.tmpl | 2 +- web_src/css/review.css | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 3bd6e4275c610..80643570c54fd 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -20,7 +20,7 @@
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}} -
+
diff --git a/web_src/css/review.css b/web_src/css/review.css index c831f38976d12..aee157720d813 100644 --- a/web_src/css/review.css +++ b/web_src/css/review.css @@ -290,3 +290,9 @@ width: 100%; height: 8px; } + +@media (max-width: 480px) { + #viewed-files-summary-container { + display: none !important ; + } +} From cf4ae515d1623f963d520e7a1a967e96df66730b Mon Sep 17 00:00:00 2001 From: Sebastian Sauer Date: Thu, 2 Nov 2023 21:21:50 +0100 Subject: [PATCH 3/7] Review bar doesn't need more height on small screens there is currently no wrapping even on very small screens --- web_src/css/repo.css | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 19e22093b45c5..6d919cec802e5 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -1506,7 +1506,6 @@ @media (max-width: 991.98px) { .repository .diff-detail-box { flex-direction: row; - height: 77px; /* this height should match sticky-2nd-row */ } } @@ -1707,12 +1706,6 @@ border: none; } -@media (max-width: 991.98px) { - .diff-file-box { - scroll-margin-top: 77px; /* match .repository .diff-detail-box */ - } -} - /* TODO: this can potentially be made "global" by removing the class prefix */ .diff-file-box .ui.attached.header, .diff-file-box .ui.attached.table { @@ -2798,18 +2791,6 @@ tbody.commit-list { z-index: 7; } -@media (max-width: 991.98px) { - .ui.attached.header.diff-file-header.sticky-2nd-row { - top: 77px; /* match .repository .diff-detail-box */ - } -} - -@media (max-width: 480px) { - .ui.attached.header.diff-file-header.sticky-2nd-row { - position: static; - } -} - .diff-file-name { flex: auto; min-width: 100px; From 9643f380b1126bede4171de4e7b659da9fb307d0 Mon Sep 17 00:00:00 2001 From: Sebastian Sauer Date: Thu, 2 Nov 2023 21:30:21 +0100 Subject: [PATCH 4/7] Fix whitespace lint --- web_src/css/review.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/review.css b/web_src/css/review.css index aee157720d813..2afeefcde73da 100644 --- a/web_src/css/review.css +++ b/web_src/css/review.css @@ -293,6 +293,6 @@ @media (max-width: 480px) { #viewed-files-summary-container { - display: none !important ; + display: none !important; } } From 148ec362d935cfa45d75ee0a6993788dc97ea12f Mon Sep 17 00:00:00 2001 From: Sebastian Sauer Date: Thu, 2 Nov 2023 21:46:46 +0100 Subject: [PATCH 5/7] Revert "Remove duplicate review diff stats" This reverts commit 2c74ad7a352de733e07e5ea5c398bd5d1fa8d1c4. --- templates/repo/diff/box.tmpl | 5 +++++ web_src/css/repo.css | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 80643570c54fd..b73e85262df86 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -17,6 +17,11 @@ diffTreeBtn.setAttribute('data-tooltip-content', diffTreeBtn.getAttribute(diffTreeVisible ? 'data-hide-text' : 'data-show-text')); {{end}} + {{if not .DiffNotAvailable}} +
+ {{svg "octicon-diff" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}} +
+ {{end}}
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 6d919cec802e5..4901a669eae52 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -1514,6 +1514,34 @@ flex-wrap: wrap; } } +.repository .diff-detail-box .diff-detail-stats strong { + margin-left: 0.25rem; + margin-right: 0.25rem; +} + +/* Because the translations contain the we need to style with nth-of-type */ + +.repository .diff-detail-box .diff-detail-stats strong:nth-of-type(1) { + color: var(--color-yellow); +} + +.repository .diff-detail-box .diff-detail-stats strong:nth-of-type(2) { + color: var(--color-green); +} + +.repository .diff-detail-box .diff-detail-stats strong:nth-of-type(3) { + color: var(--color-red); +} + +@media (max-width: 480px) { + .repository .diff-detail-box .diff-detail-stats { + font-size: 0; + line-height: 1.6rem; + } + .repository .diff-detail-box .diff-detail-stats strong { + font-size: 1rem; + } +} .diff-detail-actions { display: flex; From 3fd03a6641befda5c183adef56e5e1312d0ace30 Mon Sep 17 00:00:00 2001 From: Sebastian Sauer Date: Thu, 2 Nov 2023 21:52:54 +0100 Subject: [PATCH 6/7] Only hide diff info on smaller screens --- web_src/css/repo.css | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 4901a669eae52..b615bd3c7629f 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -1533,13 +1533,9 @@ color: var(--color-red); } -@media (max-width: 480px) { +@media (max-width: 991.98px) { .repository .diff-detail-box .diff-detail-stats { - font-size: 0; - line-height: 1.6rem; - } - .repository .diff-detail-box .diff-detail-stats strong { - font-size: 1rem; + display: none !important; } } From b8aa506f126a94a4974c4d6b2af339892548074e Mon Sep 17 00:00:00 2001 From: Sebastian Sauer Date: Fri, 3 Nov 2023 19:06:55 +0100 Subject: [PATCH 7/7] Use not mobile class --- templates/repo/diff/box.tmpl | 2 +- web_src/css/review.css | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index b73e85262df86..84ef68b680ba3 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -25,7 +25,7 @@
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}} -
+
diff --git a/web_src/css/review.css b/web_src/css/review.css index 2afeefcde73da..c831f38976d12 100644 --- a/web_src/css/review.css +++ b/web_src/css/review.css @@ -290,9 +290,3 @@ width: 100%; height: 8px; } - -@media (max-width: 480px) { - #viewed-files-summary-container { - display: none !important; - } -}