From b093d2cda434e6fc037ac020fdd062872dc2e82f Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 15:20:01 +0200 Subject: [PATCH 01/11] Add button on diff header to copy file name --- templates/repo/diff/box.tmpl | 1 + web_src/css/modules/button.css | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 132f999808cc6..ae8c734e41934 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -107,6 +107,7 @@ {{end}} {{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}{{if .IsLFSFile}} ({{$.locale.Tr "repo.stored_lfs"}}){{end}} + {{if $file.IsGenerated}} {{$.locale.Tr "repo.diff.generated"}} {{end}} diff --git a/web_src/css/modules/button.css b/web_src/css/modules/button.css index 1f2d2a4494de6..65ba195769a0b 100644 --- a/web_src/css/modules/button.css +++ b/web_src/css/modules/button.css @@ -29,6 +29,12 @@ color: inherit; } +.ui.button.button-link:hover, +.ui.button.button-link:focus, +.ui.button.button-link:active { + background: transparent; +} + .page-content .ui.button { box-shadow: none !important; } From 6574d4a40387b82d18872ab1f6f0fd2c9adbca73 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 15:24:16 +0200 Subject: [PATCH 02/11] adjust margin --- templates/repo/diff/box.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index ae8c734e41934..e35369368d7c3 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -109,10 +109,10 @@ {{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}{{if .IsLFSFile}} ({{$.locale.Tr "repo.stored_lfs"}}){{end}} {{if $file.IsGenerated}} - {{$.locale.Tr "repo.diff.generated"}} + {{$.locale.Tr "repo.diff.generated"}} {{end}} {{if $file.IsVendored}} - {{$.locale.Tr "repo.diff.vendored"}} + {{$.locale.Tr "repo.diff.vendored"}} {{end}} {{if and $file.Mode $file.OldMode}} {{$file.OldMode}} → {{$file.Mode}} From a504d18cbd30a13b54298f3a4fb4161eebba26c1 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 15:38:10 +0200 Subject: [PATCH 03/11] use gap in review header and move changed label --- templates/repo/diff/box.tmpl | 17 +++++++++-------- web_src/css/repo.css | 10 +++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index e35369368d7c3..076ddd476df49 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -87,9 +87,10 @@ {{$isCsv := (call $.IsCsvFile $file)}} {{$showFileViewToggle := or $isImage (and (not $file.IsIncomplete) $isCsv)}} {{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}} + {{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived)}}

-
+
{{if $file.IsGenerated}} - {{$.locale.Tr "repo.diff.generated"}} + {{$.locale.Tr "repo.diff.generated"}} {{end}} {{if $file.IsVendored}} - {{$.locale.Tr "repo.diff.vendored"}} + {{$.locale.Tr "repo.diff.vendored"}} {{end}} {{if and $file.Mode $file.OldMode}} {{$file.OldMode}} → {{$file.Mode}} @@ -120,7 +121,7 @@ {{$file.Mode}} {{end}}
-
+
{{if $showFileViewToggle}}
@@ -130,6 +131,9 @@ {{if $file.IsProtected}} {{$.locale.Tr "repo.diff.protected"}} {{end}} + {{if and $isReviewFile $file.HasChangedSinceLastReview}} + {{$.locale.Tr "repo.pulls.has_changed_since_last_review"}} + {{end}} {{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}} @@ -141,10 +145,7 @@ {{$.locale.Tr "repo.diff.view_file"}} {{end}} {{end}} - {{if and $.IsSigned $.PageIsPullFiles (not $.IsArchived)}} - {{if $file.HasChangedSinceLastReview}} - {{$.locale.Tr "repo.pulls.has_changed_since_last_review"}} - {{end}} + {{if $isReviewFile}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 05f0019020e70..0478a494e09c0 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3097,10 +3097,6 @@ tbody.commit-list { border-radius: var(--border-radius) !important; } -.diff-file-header-actions > * + * { - margin-left: 0.5rem !important; -} - .ui.attached.header.diff-file-header.sticky-2nd-row { position: sticky; top: 47px; /* match .repository .diff-detail-box */ @@ -3123,11 +3119,15 @@ tbody.commit-list { flex-shrink: 0; } -.ui.attached.header.diff-file-header .diff-file-name { +.diff-file-name { flex: auto; min-width: 100px; } +.diff-file-name .ui.label { + margin-left: 0 !important; +} + .diff-stats-bar { display: inline-block; background-color: var(--color-red); From 896e3e7b8cc7562061f014b18837e14a3f814830 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 15:42:25 +0200 Subject: [PATCH 04/11] tweak button height --- web_src/css/repo.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 0478a494e09c0..1d7f6d955c1b7 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -1733,6 +1733,11 @@ margin-right: 0; } +.repository .diff-box .header:not(.resolved-placeholder) .button:has(svg) { + padding-top: 6px; + padding-bottom: 6px; +} + .repository .diff-box .resolved-placeholder { display: flex; align-items: center; From 9705da792bd316a2034059b08f3c4a292824dd1e Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 16:02:19 +0200 Subject: [PATCH 05/11] fix button borders --- web_src/css/modules/button.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web_src/css/modules/button.css b/web_src/css/modules/button.css index 65ba195769a0b..4093ef31b6f67 100644 --- a/web_src/css/modules/button.css +++ b/web_src/css/modules/button.css @@ -61,7 +61,11 @@ border-left: 1px solid var(--color-light-border); } -.ui.buttons .button + .button { +.ui.buttons .button:first-child:has(+ .button.active) { + border-right: none !important; +} + +.ui.buttons .button + .button:not(.active) { border-left: none; } From e44bfa6a920c7ea106fcd0cbc4c88ec77315de96 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 17:16:44 +0200 Subject: [PATCH 06/11] improve mobile layout --- templates/repo/diff/box.tmpl | 20 ++++++++++---------- web_src/css/base.css | 3 ++- web_src/css/repo.css | 22 ++++------------------ 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 076ddd476df49..d1bf748a45969 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -15,7 +15,7 @@
-
-
+
{{if $showFileViewToggle}}
@@ -132,10 +132,10 @@ {{$.locale.Tr "repo.diff.protected"}} {{end}} {{if and $isReviewFile $file.HasChangedSinceLastReview}} - {{$.locale.Tr "repo.pulls.has_changed_since_last_review"}} + {{$.locale.Tr "repo.pulls.has_changed_since_last_review"}} {{end}} {{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}} - + {{end}} {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} diff --git a/web_src/css/base.css b/web_src/css/base.css index 204a9f0ce9969..cf405f9602b0c 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -1520,7 +1520,8 @@ img.ui.avatar, } @media (max-width: 767px) { - .not-mobile { + /* double selector so it wins over .gt-df etc */ + .not-mobile.not-mobile { display: none !important; } } diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 1d7f6d955c1b7..6247c62982456 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -1616,12 +1616,6 @@ margin-right: -4px; } -.repository .diff-detail-box > div::after { - clear: both; - content: ""; - display: block; -} - .repository .diff-detail-box .diff-detail-stats strong { margin-left: 0.25rem; margin-right: 0.25rem; @@ -1658,12 +1652,10 @@ height: 33px; } -.repository .diff-detail-box .diff-detail-actions > * { - margin-right: 0; -} - -.repository .diff-detail-box .diff-detail-actions > * + * { - margin-left: 0.25rem; +.diff-detail-actions > *, +.diff-detail-actions .button { + margin-left: 0 !important; + margin-right: 0 !important; } @media (max-width: 480px) { @@ -1728,8 +1720,6 @@ .repository .diff-box .header:not(.resolved-placeholder) .button { padding: 8px 12px; flex: 0 0 auto; - margin-top: -8px; - margin-bottom: -8px; margin-right: 0; } @@ -3120,10 +3110,6 @@ tbody.commit-list { } } -.ui.attached.header.diff-file-header .diff-file-header-actions { - flex-shrink: 0; -} - .diff-file-name { flex: auto; min-width: 100px; From a7b528265299d99ba3863f0e7b4f32a3dc90aac8 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 17:19:16 +0200 Subject: [PATCH 07/11] reduce page padding on mobile --- web_src/css/base.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web_src/css/base.css b/web_src/css/base.css index cf405f9602b0c..ce19a38faa2b7 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -1164,6 +1164,12 @@ img.ui.avatar, padding: 0 32px; } +@media (max-width: 767px) { + .ui.container.fluid.padded { + padding: 0 8px; + } +} + .ui.form .ui.button { font-weight: var(--font-weight-normal); } From aa3afab6f68bf091bff39f62dbb5a6277100581f Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 17:24:27 +0200 Subject: [PATCH 08/11] reduce header padding --- web_src/css/repo.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 6247c62982456..8a0ee3d5af32b 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3084,6 +3084,11 @@ tbody.commit-list { word-break: break-all; } +.diff-file-header { + padding-top: 5px !important; + padding-bottom: 5px !important; +} + .diff-file-box[data-folded="true"] .diff-file-body { display: none; } From 6d37f8259d8cbeaf4ebd87b3afe3e0fd795a5755 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 19:51:39 +0200 Subject: [PATCH 09/11] back out button change --- web_src/css/modules/button.css | 6 ------ 1 file changed, 6 deletions(-) diff --git a/web_src/css/modules/button.css b/web_src/css/modules/button.css index 4093ef31b6f67..d9bc69043d3d3 100644 --- a/web_src/css/modules/button.css +++ b/web_src/css/modules/button.css @@ -29,12 +29,6 @@ color: inherit; } -.ui.button.button-link:hover, -.ui.button.button-link:focus, -.ui.button.button-link:active { - background: transparent; -} - .page-content .ui.button { box-shadow: none !important; } From d7f3de6192fd4a5da596fed986639bc37ada3c03 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 May 2023 19:52:41 +0200 Subject: [PATCH 10/11] use 14px icon --- templates/repo/diff/box.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index d1bf748a45969..46da117c84030 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -108,7 +108,7 @@ {{end}}
{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}{{if .IsLFSFile}} ({{$.locale.Tr "repo.stored_lfs"}}){{end}} - + {{if $file.IsGenerated}} {{$.locale.Tr "repo.diff.generated"}} {{end}} From cd7edf6ce7563c8317de04aff1430a8e69305684 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 30 May 2023 02:17:56 +0200 Subject: [PATCH 11/11] make fluid and non-fluid containers always have same width and padding --- web_src/css/base.css | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/web_src/css/base.css b/web_src/css/base.css index ce19a38faa2b7..57887dda2f552 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -888,19 +888,32 @@ img.ui.avatar, .page-content .ui.ui.ui.container:not(.fluid) { width: 1280px; max-width: calc(100vw - 64px); + margin-left: auto; + margin-right: auto; +} + +.ui.container.fluid.padded { + padding: 0 32px; } /* enable fluid page widths for medium size viewports */ @media (min-width: 768px) and (max-width: 1200px) { - .ui.ui.ui.container:not(.fluid) { - width: calc(100vw - 64px); + .page-content .ui.ui.ui.container:not(.fluid) { + width: calc(100vw - 32px); + max-width: calc(100vw - 32px); + } + .ui.container.fluid.padded { + padding: 0 16px; } } -@media only screen and (max-width: 767px) { +@media (max-width: 767px) { .page-content .ui.ui.ui.container:not(.fluid) { - width: auto; /* copied from semantic css */ - max-width: 100%; + width: calc(100vw - 16px); + max-width: calc(100vw - 16px); + } + .ui.container.fluid.padded { + padding: 0 8px; } } @@ -1160,16 +1173,6 @@ img.ui.avatar, float: right; } -.ui.container.fluid.padded { - padding: 0 32px; -} - -@media (max-width: 767px) { - .ui.container.fluid.padded { - padding: 0 8px; - } -} - .ui.form .ui.button { font-weight: var(--font-weight-normal); } @@ -1554,12 +1557,6 @@ img.ui.avatar, clip: auto; } -@media (min-width: 768px) and (max-width: 991px) { - .ui.container { - width: 95%; - } -} - .ui.menu.new-menu { margin-bottom: 15px; background: var(--color-navbar);