From 7f433d27041f04299c0ee990983923fdb5b954a8 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 2 Aug 2023 01:41:01 +0000 Subject: [PATCH 01/38] improve --- options/locale/locale_en-US.ini | 2 ++ templates/repo/pulls/status.tmpl | 32 +++++++++++++-------- web_src/css/repo.css | 13 +++++++++ web_src/js/features/repo-issue-pr-status.js | 17 +++++++++++ web_src/js/features/repo-legacy.js | 2 ++ 5 files changed, 54 insertions(+), 12 deletions(-) create mode 100644 web_src/js/features/repo-issue-pr-status.js diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index cf04830cbb2a2..4e0c508e6a158 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1751,6 +1751,8 @@ pulls.status_checks_failure = Some checks failed pulls.status_checks_error = Some checks reported errors pulls.status_checks_requested = Required pulls.status_checks_details = Details +pulls.status_checks_hide_all = Hide all checks +pulls.status_checks_show_all = Show all checks pulls.update_branch = Update branch by merge pulls.update_branch_rebase = Update branch by rebase pulls.update_branch_success = Branch update was successful diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl index 25d8954658f34..06049ff019939 100644 --- a/templates/repo/pulls/status.tmpl +++ b/templates/repo/pulls/status.tmpl @@ -14,21 +14,29 @@ {{else}} {{$.locale.Tr "repo.pulls.status_checking"}} {{end}} +
+ + {{$.locale.Tr "repo.pulls.status_checks_hide_all"}}
+ {{end}} - {{range $.LatestCommitStatuses}} -
- {{template "repo/commit_status" .}} -
- {{.Context}} {{.Description}} -
- {{if $.is_context_required}} - {{if (call $.is_context_required .Context)}}
{{$.locale.Tr "repo.pulls.status_checks_requested"}}
{{end}} - {{end}} - {{if .TargetURL}}{{$.locale.Tr "repo.pulls.status_checks_details"}}{{end}} +
+ {{range $.LatestCommitStatuses}} +
+ {{template "repo/commit_status" .}} +
+ {{.Context}} {{.Description}} +
+ {{if $.is_context_required}} + {{if (call $.is_context_required .Context)}}
{{$.locale.Tr "repo.pulls.status_checks_requested"}}
{{end}} + {{end}} + {{if .TargetURL}}{{$.locale.Tr "repo.pulls.status_checks_details"}}{{end}} +
-
- {{end}} + {{end}} +
{{end}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 04cb4eed2d01c..ca18e546f9ae7 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3284,6 +3284,19 @@ tbody.commit-list { } } +.ui.segment.pr-status-list { + padding: 0 0.1em; + max-height: 30vh; + overflow-x: auto; + transition: max-height 0.4s; +} + +.ui.segment.pr-status-list.hide{ + padding: 0 0.1em; + max-height: 0; + transition: max-height 0.4s; +} + .pr-status { padding: 0 !important; /* To clear fomantic's padding on .ui.segment elements */ display: flex; diff --git a/web_src/js/features/repo-issue-pr-status.js b/web_src/js/features/repo-issue-pr-status.js new file mode 100644 index 0000000000000..de69101c5ed01 --- /dev/null +++ b/web_src/js/features/repo-issue-pr-status.js @@ -0,0 +1,17 @@ +import $ from 'jquery'; + +export function initRepoPullRequestCommitStatus() { + const $prStatusList = $('.pr-status-list'); + + $('.hide-all-checks').on('click', async (e) => { + e.preventDefault(); + const $this = $(e.currentTarget); + if ($prStatusList.hasClass('hide')) { + $prStatusList.removeClass('hide'); + $this.text($this.attr('data-hide-all')); + } else { + $prStatusList.addClass('hide'); + $this.text($this.attr('data-show-all')); + } + }); +} diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js index 5991df6322c57..82ca5951edc0e 100644 --- a/web_src/js/features/repo-legacy.js +++ b/web_src/js/features/repo-legacy.js @@ -21,6 +21,7 @@ import {initCommentContent, initMarkupContent} from '../markup/content.js'; import {initCompReactionSelector} from './comp/ReactionSelector.js'; import {initRepoSettingBranches} from './repo-settings.js'; import {initRepoPullRequestMergeForm} from './repo-issue-pr-form.js'; +import {initRepoPullRequestCommitStatus} from './repo-issue-pr-status.js'; import {hideElem, showElem} from '../utils/dom.js'; import {getComboMarkdownEditor, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js'; import {attachRefIssueContextPopup} from './contextpopup.js'; @@ -547,6 +548,7 @@ export function initRepository() { initCompReactionSelector($(document)); initRepoPullRequestMergeForm(); + initRepoPullRequestCommitStatus(); } // Pull request From b56220edf9760d71376c8205def4e31797835899 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 2 Aug 2023 04:27:53 +0000 Subject: [PATCH 02/38] fix lint --- templates/repo/pulls/status.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl index 06049ff019939..8cb1142fd2bb5 100644 --- a/templates/repo/pulls/status.tmpl +++ b/templates/repo/pulls/status.tmpl @@ -15,7 +15,7 @@ {{$.locale.Tr "repo.pulls.status_checking"}} {{end}}
- {{$.locale.Tr "repo.pulls.status_checks_hide_all"}} From 5303f8fe217ccd4c5c3e15ad67fffff31623dfcb Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 2 Aug 2023 04:35:27 +0000 Subject: [PATCH 03/38] improve --- web_src/css/repo.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index ca18e546f9ae7..330e8b92546ff 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3285,14 +3285,14 @@ tbody.commit-list { } .ui.segment.pr-status-list { - padding: 0 0.1em; + padding: 0 0.1em 0 0; max-height: 30vh; overflow-x: auto; transition: max-height 0.4s; } .ui.segment.pr-status-list.hide{ - padding: 0 0.1em; + padding: 0 0.1em 0 0; max-height: 0; transition: max-height 0.4s; } From bd2214ffe23eed38bbb6ee95a0c434325e32a55e Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 2 Aug 2023 07:27:42 +0000 Subject: [PATCH 04/38] improve --- web_src/css/repo.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 330e8b92546ff..b7f52e3857341 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3285,15 +3285,16 @@ tbody.commit-list { } .ui.segment.pr-status-list { - padding: 0 0.1em 0 0; + padding: 0; max-height: 30vh; - overflow-x: auto; + overflow-x: hidden; transition: max-height 0.4s; } .ui.segment.pr-status-list.hide{ - padding: 0 0.1em 0 0; + padding: 0; max-height: 0; + overflow-x: hidden; transition: max-height 0.4s; } From 97e60b392d0adface9b7e8c038d798777abb5755 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 2 Aug 2023 08:33:03 +0000 Subject: [PATCH 05/38] improve --- web_src/css/repo.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index b7f52e3857341..3370ef15e956a 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3304,6 +3304,14 @@ tbody.commit-list { align-items: center; } +.pr-status:first-child { + border-top: none !important; +} + +.pr-status:last-child { + border-bottom: none !important; +} + .pr-status .commit-status { margin: 1em; flex-shrink: 0; From 4a189a54d942ac1e482c74a39ce0b125128c218c Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 3 Aug 2023 06:07:35 +0000 Subject: [PATCH 06/38] improve tiddy commit status --- routers/web/repo/pull.go | 3 + templates/repo/branch/list.tmpl | 4 +- templates/repo/commit_statuses.tmpl | 16 +++--- templates/repo/issue/view_content/pull.tmpl | 7 ++- templates/repo/pulls/status.tmpl | 64 ++++++++++++--------- web_src/css/modules/tippy.css | 2 +- web_src/css/repo.css | 40 +++++++++---- web_src/js/features/repo-issue-pr-status.js | 9 +-- 8 files changed, 91 insertions(+), 54 deletions(-) diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index d76e90bf248b8..b7573e46e6171 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -477,6 +477,7 @@ func PrepareMergedViewPullInfo(ctx *context.Context, issue *issues_model.Issue) if len(commitStatuses) != 0 { ctx.Data["LatestCommitStatuses"] = commitStatuses ctx.Data["LatestCommitStatus"] = git_model.CalcCommitStatus(commitStatuses) + ctx.Data["ShowHideButton"] = true } } @@ -539,6 +540,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C if len(commitStatuses) > 0 { ctx.Data["LatestCommitStatuses"] = commitStatuses ctx.Data["LatestCommitStatus"] = git_model.CalcCommitStatus(commitStatuses) + ctx.Data["ShowHideButton"] = true } compareInfo, err := baseGitRepo.GetCompareInfo(pull.BaseRepo.RepoPath(), @@ -631,6 +633,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C if len(commitStatuses) > 0 { ctx.Data["LatestCommitStatuses"] = commitStatuses ctx.Data["LatestCommitStatus"] = git_model.CalcCommitStatus(commitStatuses) + ctx.Data["ShowHideButton"] = true } if pb != nil && pb.EnableStatusCheck { diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index b32e8cace7748..5754ee98901d3 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -25,7 +25,7 @@
{{.DefaultBranchBranch.DBBranch.Name}} - {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}} + {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID) "root" $}}

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}} · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

@@ -92,7 +92,7 @@
{{.DBBranch.Name}} - {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}} + {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID) "root" $}}

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{$.locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

{{end}} diff --git a/templates/repo/commit_statuses.tmpl b/templates/repo/commit_statuses.tmpl index 20a59bf0d7171..9dab48d1bb614 100644 --- a/templates/repo/commit_statuses.tmpl +++ b/templates/repo/commit_statuses.tmpl @@ -9,14 +9,12 @@ {{end}}
- {{range .Statuses}} -
- {{template "repo/commit_status" .}} - {{.Context}} {{.Description}} - {{if .TargetURL}} - {{$.root.locale.Tr "repo.pulls.status_checks_details"}} - {{end}} -
- {{end}} + {{template "repo/pulls/status" (dict + "locale" .root.locale + "CommitStatuses" .Statuses + "CommitStatus" .Status + "IsTippy" true + "is_context_required" .root.is_context_required + )}}
{{end}} diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 214d77a12d434..d9d38c6edbeb6 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -20,7 +20,12 @@ {{- else if .Issue.PullRequest.CanAutoMerge}}green {{- else}}red{{end}}">{{svg "octicon-git-merge" 40}}
- {{template "repo/pulls/status" .}} + {{template "repo/pulls/status" (dict + "locale" .locale + "CommitStatus" .LatestCommitStatus + "CommitStatuses" .LatestCommitStatuses + "is_context_required" .is_context_required + )}} {{$showGeneralMergeForm := false}}
{{if .Issue.PullRequest.HasMerged}} diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl index 8cb1142fd2bb5..53ef005cc0da7 100644 --- a/templates/repo/pulls/status.tmpl +++ b/templates/repo/pulls/status.tmpl @@ -1,31 +1,42 @@ -{{if $.LatestCommitStatus}} - {{if not $.Issue.PullRequest.HasMerged}} -
- {{if eq .LatestCommitStatus.State "pending"}} - {{$.locale.Tr "repo.pulls.status_checking"}} - {{else if eq .LatestCommitStatus.State "success"}} - {{$.locale.Tr "repo.pulls.status_checks_success"}} - {{else if eq .LatestCommitStatus.State "warning"}} - {{$.locale.Tr "repo.pulls.status_checks_warning"}} - {{else if eq .LatestCommitStatus.State "failure"}} - {{$.locale.Tr "repo.pulls.status_checks_failure"}} - {{else if eq .LatestCommitStatus.State "error"}} - {{$.locale.Tr "repo.pulls.status_checks_error"}} - {{else}} - {{$.locale.Tr "repo.pulls.status_checking"}} - {{end}} - +{{/* +Template Attributes: +* locale: passed through for localization +* CommitStatus: summary of all commit status state +* CommitStatuses: all commit status elements +* IsTippy: whether this template is the content of tippy +* is_context_required: Used in pull request commit status check table +*/}} + +{{if .CommitStatus}} +
+
+ {{if eq .CommitStatus.State "pending"}} + {{.locale.Tr "repo.pulls.status_checking"}} + {{else if eq .CommitStatus.State "success"}} + {{.locale.Tr "repo.pulls.status_checks_success"}} + {{else if eq .CommitStatus.State "warning"}} + {{.locale.Tr "repo.pulls.status_checks_warning"}} + {{else if eq .CommitStatus.State "failure"}} + {{.locale.Tr "repo.pulls.status_checks_failure"}} + {{else if eq .CommitStatus.State "error"}} + {{.locale.Tr "repo.pulls.status_checks_error"}} + {{else}} + {{.locale.Tr "repo.pulls.status_checking"}} + {{end}} + + {{if not .IsTippy}} + - {{end}} + {{end}} +
-
- {{range $.LatestCommitStatuses}} -
+
+ {{range .CommitStatuses}} +
{{template "repo/commit_status" .}}
{{.Context}} {{.Description}} @@ -39,4 +50,5 @@
{{end}}
+
{{end}} diff --git a/web_src/css/modules/tippy.css b/web_src/css/modules/tippy.css index fe32597280331..2c762ee854018 100644 --- a/web_src/css/modules/tippy.css +++ b/web_src/css/modules/tippy.css @@ -37,7 +37,7 @@ .tippy-content { position: relative; - padding: 1rem; + padding: 0; z-index: 1; } diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 3370ef15e956a..4ce8355d366a3 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3284,50 +3284,60 @@ tbody.commit-list { } } -.ui.segment.pr-status-list { +.ui.segment.commit-status-list { padding: 0; max-height: 30vh; overflow-x: hidden; transition: max-height 0.4s; + border-bottom: 0 !important; +} + +.pr-commit-status.hide { + border-bottom: 0 !important; +} + +.pr-commit-status.hide .ui.attached.header { + border-bottom: 0 !important; } -.ui.segment.pr-status-list.hide{ +.pr-commit-status.hide .commit-status-list { padding: 0; max-height: 0; overflow-x: hidden; transition: max-height 0.4s; + border: 0; } -.pr-status { +.commit-status-item { padding: 0 !important; /* To clear fomantic's padding on .ui.segment elements */ display: flex; align-items: center; } -.pr-status:first-child { +.commit-status-item:first-child { border-top: none !important; } -.pr-status:last-child { +.commit-status-item:last-child { border-bottom: none !important; } -.pr-status .commit-status { +.commit-status-item .commit-status { margin: 1em; flex-shrink: 0; } -.pr-status .status-context { +.commit-status-item .status-context { display: flex; justify-content: space-between; width: 100%; } -.pr-status .status-context > span { +.commit-status-item .status-context > span { padding: 1em 0; } -.pr-status .status-details { +.commit-status-item .status-details { display: flex; padding-right: 0.5em; align-items: center; @@ -3335,17 +3345,25 @@ tbody.commit-list { } @media (max-width: 767.98px) { - .pr-status .status-details { + .commit-status-item .status-details { flex-direction: column; align-items: flex-end; justify-content: center; } } -.pr-status .status-details > span { +.commit-status-item .status-details > span { padding-right: 0.5em; /* To match the alignment with the "required" label */ } +.tippy-commit-status { + max-width: 100vw; +} + +.tippy-commit-status .ui.attached.header { + border-top: 0 !important; +} + .search-fullname { color: var(--color-text-light-2); } diff --git a/web_src/js/features/repo-issue-pr-status.js b/web_src/js/features/repo-issue-pr-status.js index de69101c5ed01..fb06999dd5d43 100644 --- a/web_src/js/features/repo-issue-pr-status.js +++ b/web_src/js/features/repo-issue-pr-status.js @@ -1,16 +1,17 @@ import $ from 'jquery'; export function initRepoPullRequestCommitStatus() { - const $prStatusList = $('.pr-status-list'); + const $prStatus = $('.pr-status'); $('.hide-all-checks').on('click', async (e) => { e.preventDefault(); const $this = $(e.currentTarget); - if ($prStatusList.hasClass('hide')) { - $prStatusList.removeClass('hide'); + + if ($prStatus.hasClass('hide')) { + $prStatus.removeClass('hide'); $this.text($this.attr('data-hide-all')); } else { - $prStatusList.addClass('hide'); + $prStatus.addClass('hide'); $this.text($this.attr('data-show-all')); } }); From a2cf2029486bbe51c4754cb66509387acb5b9d04 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 28 Sep 2023 02:13:53 +0000 Subject: [PATCH 07/38] convert to ctx.Locale.Tr --- templates/repo/pulls/status.tmpl | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl index 53ef005cc0da7..995fcded55a9c 100644 --- a/templates/repo/pulls/status.tmpl +++ b/templates/repo/pulls/status.tmpl @@ -1,6 +1,5 @@ {{/* Template Attributes: -* locale: passed through for localization * CommitStatus: summary of all commit status state * CommitStatuses: all commit status elements * IsTippy: whether this template is the content of tippy @@ -11,25 +10,25 @@ Template Attributes:
{{if eq .CommitStatus.State "pending"}} - {{.locale.Tr "repo.pulls.status_checking"}} + {{ctx.Locale.Tr "repo.pulls.status_checking"}} {{else if eq .CommitStatus.State "success"}} - {{.locale.Tr "repo.pulls.status_checks_success"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_success"}} {{else if eq .CommitStatus.State "warning"}} - {{.locale.Tr "repo.pulls.status_checks_warning"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_warning"}} {{else if eq .CommitStatus.State "failure"}} - {{.locale.Tr "repo.pulls.status_checks_failure"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_failure"}} {{else if eq .CommitStatus.State "error"}} - {{.locale.Tr "repo.pulls.status_checks_error"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_error"}} {{else}} - {{.locale.Tr "repo.pulls.status_checking"}} + {{ctx.Locale.Tr "repo.pulls.status_checking"}} {{end}} {{if not .IsTippy}}
- {{.locale.Tr "repo.pulls.status_checks_hide_all"}} + data-show-all="{{ctx.Locale.Tr "repo.pulls.status_checks_show_all"}}" + data-hide-all="{{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}"> + {{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}
{{end}}
@@ -42,9 +41,9 @@ Template Attributes: {{.Context}} {{.Description}}
{{if $.is_context_required}} - {{if (call $.is_context_required .Context)}}
{{$.locale.Tr "repo.pulls.status_checks_requested"}}
{{end}} + {{if (call $.is_context_required .Context)}}
{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}
{{end}} {{end}} - {{if .TargetURL}}{{$.locale.Tr "repo.pulls.status_checks_details"}}{{end}} + {{if .TargetURL}}{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}{{end}}
From 711c2f891baa47b0d6054f4a17e5f031a643dcad Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 28 Sep 2023 11:15:36 +0900 Subject: [PATCH 08/38] Update web_src/js/features/repo-issue-pr-status.js Co-authored-by: delvh --- web_src/js/features/repo-issue-pr-status.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web_src/js/features/repo-issue-pr-status.js b/web_src/js/features/repo-issue-pr-status.js index fb06999dd5d43..1bd53f0d7922d 100644 --- a/web_src/js/features/repo-issue-pr-status.js +++ b/web_src/js/features/repo-issue-pr-status.js @@ -8,11 +8,10 @@ export function initRepoPullRequestCommitStatus() { const $this = $(e.currentTarget); if ($prStatus.hasClass('hide')) { - $prStatus.removeClass('hide'); $this.text($this.attr('data-hide-all')); } else { - $prStatus.addClass('hide'); $this.text($this.attr('data-show-all')); } + $prStatus.toggleClass('hide'); }); } From aead5a58b83362a92e39eeca94e06ed482915964 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 28 Sep 2023 11:15:59 +0900 Subject: [PATCH 09/38] Update templates/repo/commit_statuses.tmpl Co-authored-by: delvh --- templates/repo/commit_statuses.tmpl | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/repo/commit_statuses.tmpl b/templates/repo/commit_statuses.tmpl index 9dab48d1bb614..533cd5a8bc540 100644 --- a/templates/repo/commit_statuses.tmpl +++ b/templates/repo/commit_statuses.tmpl @@ -10,7 +10,6 @@ {{end}}
{{template "repo/pulls/status" (dict - "locale" .root.locale "CommitStatuses" .Statuses "CommitStatus" .Status "IsTippy" true From 339dad1f76d87f476fb7bf27b12dfad82dfc3fb0 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 28 Sep 2023 11:16:20 +0900 Subject: [PATCH 10/38] Update templates/repo/issue/view_content/pull.tmpl Co-authored-by: delvh --- templates/repo/issue/view_content/pull.tmpl | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index e81083347e530..2f62bc382c3da 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -21,7 +21,6 @@ {{- else}}red{{end}}">{{svg "octicon-git-merge" 40}}
{{template "repo/pulls/status" (dict - "locale" .locale "CommitStatus" .LatestCommitStatus "CommitStatuses" .LatestCommitStatuses "is_context_required" .is_context_required From e8ddbc9bd40b8c09bf8110d423a64afd8c71bf32 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 28 Sep 2023 02:35:32 +0000 Subject: [PATCH 11/38] rename IsTippy into IsPopup --- templates/repo/commit_statuses.tmpl | 2 +- templates/repo/pulls/status.tmpl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/commit_statuses.tmpl b/templates/repo/commit_statuses.tmpl index 533cd5a8bc540..67601d44105cc 100644 --- a/templates/repo/commit_statuses.tmpl +++ b/templates/repo/commit_statuses.tmpl @@ -12,7 +12,7 @@ {{template "repo/pulls/status" (dict "CommitStatuses" .Statuses "CommitStatus" .Status - "IsTippy" true + "IsPopup" true "is_context_required" .root.is_context_required )}}
diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl index 995fcded55a9c..17b614b646720 100644 --- a/templates/repo/pulls/status.tmpl +++ b/templates/repo/pulls/status.tmpl @@ -2,12 +2,12 @@ Template Attributes: * CommitStatus: summary of all commit status state * CommitStatuses: all commit status elements -* IsTippy: whether this template is the content of tippy +* IsPopup: whether this template is in a popup * is_context_required: Used in pull request commit status check table */}} {{if .CommitStatus}} -
+
{{if eq .CommitStatus.State "pending"}} {{ctx.Locale.Tr "repo.pulls.status_checking"}} @@ -23,7 +23,7 @@ Template Attributes: {{ctx.Locale.Tr "repo.pulls.status_checking"}} {{end}} - {{if not .IsTippy}} + {{if not .IsPopup}}
Date: Wed, 18 Oct 2023 15:07:39 +0900 Subject: [PATCH 12/38] Update web_src/css/repo.css Co-authored-by: silverwind --- web_src/css/repo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 88387327fa555..e66e65e486e80 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3070,7 +3070,7 @@ tbody.commit-list { padding: 0; max-height: 30vh; overflow-x: hidden; - transition: max-height 0.4s; + transition: max-height 0.2s; border-bottom: 0 !important; } From 99698007e6f52b4e949653ef8de9d12b604b104a Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 18 Oct 2023 15:07:49 +0900 Subject: [PATCH 13/38] Update web_src/css/repo.css Co-authored-by: silverwind --- web_src/css/repo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index e66e65e486e80..a07fc8ad2570d 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3086,7 +3086,7 @@ tbody.commit-list { padding: 0; max-height: 0; overflow-x: hidden; - transition: max-height 0.4s; + transition: max-height 0.2s; border: 0; } From 08b7951f48dc7d1d8ac8413491a512ec4fa9a459 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 18 Oct 2023 06:09:15 +0000 Subject: [PATCH 14/38] convert max-height to 231px --- web_src/css/repo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index a07fc8ad2570d..4687c1ced65fe 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3068,7 +3068,7 @@ tbody.commit-list { .ui.segment.commit-status-list { padding: 0; - max-height: 30vh; + max-height: 231px; overflow-x: hidden; transition: max-height 0.2s; border-bottom: 0 !important; From fef5fc1fde01c9a93a78fc08a4c706662755db8f Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 18 Oct 2023 06:12:11 +0000 Subject: [PATCH 15/38] convert border-bottom 0 into none --- web_src/css/repo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 4687c1ced65fe..0447802d757d5 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3079,7 +3079,7 @@ tbody.commit-list { } .pr-commit-status.hide .ui.attached.header { - border-bottom: 0 !important; + border-bottom: none !important; } .pr-commit-status.hide .commit-status-list { From 9e4dfa54d983aa3d091c5be007a604064d10fb67 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 18 Oct 2023 06:24:41 +0000 Subject: [PATCH 16/38] remove jQuery --- web_src/js/features/repo-issue-pr-status.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/web_src/js/features/repo-issue-pr-status.js b/web_src/js/features/repo-issue-pr-status.js index 1bd53f0d7922d..da0468d43642b 100644 --- a/web_src/js/features/repo-issue-pr-status.js +++ b/web_src/js/features/repo-issue-pr-status.js @@ -1,17 +1,13 @@ -import $ from 'jquery'; - export function initRepoPullRequestCommitStatus() { - const $prStatus = $('.pr-status'); - - $('.hide-all-checks').on('click', async (e) => { - e.preventDefault(); - const $this = $(e.currentTarget); - - if ($prStatus.hasClass('hide')) { - $this.text($this.attr('data-hide-all')); + const btn = document.querySelector('.hide-all-checks'); + const prCommitStatus = document.querySelector('.pr-commit-status'); + if (!btn) return; + btn.addEventListener('click', () => { + if (prCommitStatus.classList.contains('hide')) { + btn.textContent = btn.getAttribute('data-hide-all'); } else { - $this.text($this.attr('data-show-all')); + btn.textContent = btn.getAttribute('data-show-all'); } - $prStatus.toggleClass('hide'); + prCommitStatus.classList.toggle('hide'); }); } From bef80d4fefa65e6037d6e43cd7b94eb8ad30c509 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 18 Oct 2023 15:26:33 +0900 Subject: [PATCH 17/38] Update templates/repo/pulls/status.tmpl Co-authored-by: silverwind --- templates/repo/pulls/status.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl index 17b614b646720..9559cedf314c5 100644 --- a/templates/repo/pulls/status.tmpl +++ b/templates/repo/pulls/status.tmpl @@ -25,10 +25,10 @@ Template Attributes: {{if not .IsPopup}}
- - {{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}
{{end}}
From 08f9ccd0721a3392ff1523a06c0f0f38ca901fb5 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 18 Oct 2023 06:40:29 +0000 Subject: [PATCH 18/38] improve --- web_src/css/repo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 0447802d757d5..fccb1721859a4 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3139,7 +3139,7 @@ tbody.commit-list { } .tippy-commit-status { - max-width: 100vw; + max-width: calc(100vw - 16px); } .tippy-commit-status .ui.attached.header { From 3b3f7672196553fc4a90369695d6744352bfa2d0 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Mon, 23 Oct 2023 01:49:19 +0000 Subject: [PATCH 19/38] improve --- 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 fccb1721859a4..14e6bb3a46b90 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3066,8 +3066,8 @@ tbody.commit-list { } } -.ui.segment.commit-status-list { - padding: 0; +.commit-status-list { + padding: 0 !important; max-height: 231px; overflow-x: hidden; transition: max-height 0.2s; @@ -3083,11 +3083,7 @@ tbody.commit-list { } .pr-commit-status.hide .commit-status-list { - padding: 0; max-height: 0; - overflow-x: hidden; - transition: max-height 0.2s; - border: 0; } .commit-status-item { From 4a9235627d88245edae1cd1db8bf370a482f68b8 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 1 Nov 2023 16:55:47 +0100 Subject: [PATCH 20/38] various styling improvments --- templates/repo/pulls/status.tmpl | 14 ++++++-------- web_src/css/repo.css | 13 +++++-------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl index 9559cedf314c5..8ee3d19a92fd0 100644 --- a/templates/repo/pulls/status.tmpl +++ b/templates/repo/pulls/status.tmpl @@ -37,14 +37,12 @@ Template Attributes: {{range .CommitStatuses}}
{{template "repo/commit_status" .}} -
- {{.Context}} {{.Description}} -
- {{if $.is_context_required}} - {{if (call $.is_context_required .Context)}}
{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}
{{end}} - {{end}} - {{if .TargetURL}}{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}{{end}} -
+ {{.Context}} {{.Description}} +
+ {{if $.is_context_required}} + {{if (call $.is_context_required .Context)}}
{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}
{{end}} + {{end}} + {{if .TargetURL}}{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}{{end}}
{{end}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 16a46014c0a7d..19cd27e66aec4 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3095,8 +3095,9 @@ tbody.commit-list { } .commit-status-item { - padding: 0 !important; /* To clear fomantic's padding on .ui.segment elements */ + padding: 1em 8px !important; display: flex; + gap: 8px; align-items: center; } @@ -3109,23 +3110,19 @@ tbody.commit-list { } .commit-status-item .commit-status { - margin: 1em; flex-shrink: 0; } .commit-status-item .status-context { display: flex; + flex: 1; justify-content: space-between; - width: 100%; -} - -.commit-status-item .status-context > span { - padding: 1em 0; + gap: 8px; + max-width: calc(100% - 26px); } .commit-status-item .status-details { display: flex; - padding-right: 0.5em; align-items: center; justify-content: flex-end; } From 228eb7be860272363f0c283466bddf777dc54e25 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 1 Nov 2023 17:02:09 +0100 Subject: [PATCH 21/38] set menu theme --- web_src/css/modules/tippy.css | 2 +- web_src/js/features/repo-commit.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/web_src/css/modules/tippy.css b/web_src/css/modules/tippy.css index 2c762ee854018..609d53f34cdf6 100644 --- a/web_src/css/modules/tippy.css +++ b/web_src/css/modules/tippy.css @@ -37,7 +37,7 @@ .tippy-content { position: relative; - padding: 0; + padding: 1rem; /* if you need different padding, set data-theme=menu */ z-index: 1; } diff --git a/web_src/js/features/repo-commit.js b/web_src/js/features/repo-commit.js index 7240bf398aec6..1fbb5cd0d7eaa 100644 --- a/web_src/js/features/repo-commit.js +++ b/web_src/js/features/repo-commit.js @@ -66,6 +66,7 @@ export function initCommitStatuses() { placement: top ? 'top-start' : 'bottom-start', interactive: true, role: 'dialog', + theme: 'menu', }); }); } From 483bab09ccbf188dd0e16dca7ac62777462112be Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 1 Nov 2023 17:20:44 +0100 Subject: [PATCH 22/38] use data-toggled attribute and improve transition --- templates/repo/pulls/status.tmpl | 2 +- web_src/css/repo.css | 15 ++++++++------- web_src/js/features/repo-issue-pr-status.js | 12 +++++------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl index 8ee3d19a92fd0..487bc265426a8 100644 --- a/templates/repo/pulls/status.tmpl +++ b/templates/repo/pulls/status.tmpl @@ -7,7 +7,7 @@ Template Attributes: */}} {{if .CommitStatus}} -
+
{{if eq .CommitStatus.State "pending"}} {{ctx.Locale.Tr "repo.pulls.status_checking"}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 19cd27e66aec4..4f8ae76b9b107 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3078,19 +3078,20 @@ tbody.commit-list { padding: 0 !important; max-height: 231px; overflow-x: hidden; - transition: max-height 0.2s; - border-bottom: 0 !important; + transition: max-height .2s; + border-bottom: none !important; } -.pr-commit-status.hide { - border-bottom: 0 !important; +.pr-commit-status[data-toggled="false"] { + border-bottom: none !important; } -.pr-commit-status.hide .ui.attached.header { - border-bottom: none !important; +.pr-commit-status[data-toggled="false"] .ui.attached.header { + transition-delay: .2s; + border-bottom-width: 0 !important; } -.pr-commit-status.hide .commit-status-list { +.pr-commit-status[data-toggled="false"] .commit-status-list { max-height: 0; } diff --git a/web_src/js/features/repo-issue-pr-status.js b/web_src/js/features/repo-issue-pr-status.js index da0468d43642b..d759ed5d858ad 100644 --- a/web_src/js/features/repo-issue-pr-status.js +++ b/web_src/js/features/repo-issue-pr-status.js @@ -1,13 +1,11 @@ export function initRepoPullRequestCommitStatus() { const btn = document.querySelector('.hide-all-checks'); - const prCommitStatus = document.querySelector('.pr-commit-status'); if (!btn) return; + btn.addEventListener('click', () => { - if (prCommitStatus.classList.contains('hide')) { - btn.textContent = btn.getAttribute('data-hide-all'); - } else { - btn.textContent = btn.getAttribute('data-show-all'); - } - prCommitStatus.classList.toggle('hide'); + const prCommitStatus = document.querySelector('.pr-commit-status'); + const toggled = prCommitStatus.getAttribute('data-toggled') === 'true'; + btn.textContent = btn.getAttribute(toggled ? 'data-hide-all' : 'data-show-all'); + prCommitStatus.setAttribute('data-toggled', String(!toggled)); }); } From 57cbaf7cbd964be064a9c04130004d359eb6e90a Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 1 Nov 2023 17:29:11 +0100 Subject: [PATCH 23/38] make popup fit exactly 5 items --- web_src/css/repo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 4f8ae76b9b107..0ad98f00d52e9 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3076,7 +3076,7 @@ tbody.commit-list { .commit-status-list { padding: 0 !important; - max-height: 231px; + max-height: 244px; /* fit exactly 5 items */ overflow-x: hidden; transition: max-height .2s; border-bottom: none !important; From e873cb48d657213301108d644179ca47669027f6 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 1 Nov 2023 17:37:00 +0100 Subject: [PATCH 24/38] fit 4 items, add dedicated tippy theme --- web_src/css/modules/tippy.css | 12 ++++++++++++ web_src/css/repo.css | 4 ++-- web_src/js/features/repo-commit.js | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/web_src/css/modules/tippy.css b/web_src/css/modules/tippy.css index 609d53f34cdf6..2122652ad9146 100644 --- a/web_src/css/modules/tippy.css +++ b/web_src/css/modules/tippy.css @@ -49,6 +49,10 @@ padding: 0; } +.tippy-box[data-theme="box-with-header"] .tippy-content { + padding: 0; +} + .tippy-box[data-placement^="top"] > .tippy-svg-arrow { bottom: 0; } @@ -116,3 +120,11 @@ .tippy-box[data-theme="menu"] .tippy-svg-arrow-inner { fill: var(--color-menu); } + +.tippy-box[data-theme="box-with-header"][data-placement^="top"] .tippy-svg-arrow-inner { + fill: var(--color-box-body); +} + +.tippy-box[data-theme="box-with-header"][data-placement^="bottom"] .tippy-svg-arrow-inner { + fill: var(--color-box-header); +} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 0ad98f00d52e9..51017531abf41 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3076,7 +3076,7 @@ tbody.commit-list { .commit-status-list { padding: 0 !important; - max-height: 244px; /* fit exactly 5 items */ + max-height: 195px; /* fit exactly 4 items */ overflow-x: hidden; transition: max-height .2s; border-bottom: none !important; @@ -3096,7 +3096,7 @@ tbody.commit-list { } .commit-status-item { - padding: 1em 8px !important; + padding: 14px 10px !important; display: flex; gap: 8px; align-items: center; diff --git a/web_src/js/features/repo-commit.js b/web_src/js/features/repo-commit.js index 1fbb5cd0d7eaa..76b34d2077719 100644 --- a/web_src/js/features/repo-commit.js +++ b/web_src/js/features/repo-commit.js @@ -66,7 +66,7 @@ export function initCommitStatuses() { placement: top ? 'top-start' : 'bottom-start', interactive: true, role: 'dialog', - theme: 'menu', + theme: 'box-with-header', }); }); } From 4996b728c4af24544db1a2e0cf4e865c6209a902 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 1 Nov 2023 17:40:23 +0100 Subject: [PATCH 25/38] document new theme --- web_src/js/modules/tippy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/modules/tippy.js b/web_src/js/modules/tippy.js index ec7ee2141f9f9..d27908962f53a 100644 --- a/web_src/js/modules/tippy.js +++ b/web_src/js/modules/tippy.js @@ -34,7 +34,7 @@ export function createTippy(target, opts = {}) { }, arrow: ``, role: 'menu', // HTML role attribute, only tooltips should use "tooltip" - theme: other.role || 'menu', // CSS theme, we support either "tooltip" or "menu" + theme: other.role || 'menu', // CSS theme, either "tooltip", "menu" or "box-with-header" plugins: [followCursor], ...other, }); From 37197698156ddf4ebb47df50b8137beb39c61c6e Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 1 Nov 2023 17:54:52 +0100 Subject: [PATCH 26/38] add comment and move rule --- web_src/css/repo.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 51017531abf41..95922b1267379 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3082,6 +3082,10 @@ tbody.commit-list { border-bottom: none !important; } +.pr-commit-status[data-toggled="false"] .commit-status-list { + max-height: 0; /* hide it for the slide transition */ +} + .pr-commit-status[data-toggled="false"] { border-bottom: none !important; } @@ -3091,10 +3095,6 @@ tbody.commit-list { border-bottom-width: 0 !important; } -.pr-commit-status[data-toggled="false"] .commit-status-list { - max-height: 0; -} - .commit-status-item { padding: 14px 10px !important; display: flex; From a91edb8f3fb59724fe028c2c89a4a47f2c95e035 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 1 Nov 2023 17:58:21 +0100 Subject: [PATCH 27/38] remove unused ShowHideButton variable --- routers/web/repo/pull.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index da10bd9fd662e..ec109ed665c4e 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -494,7 +494,6 @@ func PrepareMergedViewPullInfo(ctx *context.Context, issue *issues_model.Issue) if len(commitStatuses) != 0 { ctx.Data["LatestCommitStatuses"] = commitStatuses ctx.Data["LatestCommitStatus"] = git_model.CalcCommitStatus(commitStatuses) - ctx.Data["ShowHideButton"] = true } } @@ -557,7 +556,6 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C if len(commitStatuses) > 0 { ctx.Data["LatestCommitStatuses"] = commitStatuses ctx.Data["LatestCommitStatus"] = git_model.CalcCommitStatus(commitStatuses) - ctx.Data["ShowHideButton"] = true } compareInfo, err := baseGitRepo.GetCompareInfo(pull.BaseRepo.RepoPath(), @@ -650,7 +648,6 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C if len(commitStatuses) > 0 { ctx.Data["LatestCommitStatuses"] = commitStatuses ctx.Data["LatestCommitStatus"] = git_model.CalcCommitStatus(commitStatuses) - ctx.Data["ShowHideButton"] = true } if pb != nil && pb.EnableStatusCheck { From 94d328c781ce40f3f3cdd133086178120fe201f7 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 1 Nov 2023 18:00:02 +0100 Subject: [PATCH 28/38] update comment --- web_src/css/modules/tippy.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/modules/tippy.css b/web_src/css/modules/tippy.css index 2122652ad9146..93338cc4ef2b8 100644 --- a/web_src/css/modules/tippy.css +++ b/web_src/css/modules/tippy.css @@ -37,7 +37,7 @@ .tippy-content { position: relative; - padding: 1rem; /* if you need different padding, set data-theme=menu */ + padding: 1rem; /* if you need different padding, use different data-theme */ z-index: 1; } From ac890d5c4050404390e36d4532b7c2c6b82e30f5 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 1 Nov 2023 18:07:50 +0100 Subject: [PATCH 29/38] clean up tippy.js and remove unused form-fetch-error theme theme was removed in https://github.com/go-gitea/gitea/commit/a4a567f29f69e39d57a9fa7008d708f7fd080e58 --- web_src/css/modules/tippy.css | 63 ++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/web_src/css/modules/tippy.css b/web_src/css/modules/tippy.css index 93338cc4ef2b8..1afdeb7abd81a 100644 --- a/web_src/css/modules/tippy.css +++ b/web_src/css/modules/tippy.css @@ -18,41 +18,59 @@ font-size: 1rem; } +.tippy-content { + position: relative; + padding: 1rem; /* if you need different padding, use different data-theme */ + z-index: 1; +} + +/* tooltip theme for text tooltips */ + .tippy-box[data-theme="tooltip"] { background-color: var(--color-tooltip-bg); color: var(--color-tooltip-text); border: none; } -.tippy-box[data-theme="menu"] { - background-color: var(--color-menu); - color: var(--color-text); +.tippy-box[data-theme="tooltip"] .tippy-content { + padding: 0.5rem 1rem; } -.tippy-box[data-theme="form-fetch-error"] { - border-color: var(--color-error-border); - background-color: var(--color-error-bg); - color: var(--color-error-text); +.tippy-box[data-theme="tooltip"] .tippy-svg-arrow-inner, +.tippy-box[data-theme="tooltip"] .tippy-svg-arrow-outer { + fill: var(--color-tooltip-bg); } -.tippy-content { - position: relative; - padding: 1rem; /* if you need different padding, use different data-theme */ - z-index: 1; -} +/* menu theme for .ui.menu */ -.tippy-box[data-theme="tooltip"] .tippy-content { - padding: 0.5rem 1rem; +.tippy-box[data-theme="menu"] { + background-color: var(--color-menu); + color: var(--color-text); } .tippy-box[data-theme="menu"] .tippy-content { padding: 0; } +.tippy-box[data-theme="menu"] .tippy-svg-arrow-inner { + fill: var(--color-menu); +} + +/* box-with-header theme for .ui.attached.header and .ui.attached.segment */ + .tippy-box[data-theme="box-with-header"] .tippy-content { padding: 0; } +.tippy-box[data-theme="box-with-header"][data-placement^="top"] .tippy-svg-arrow-inner { + fill: var(--color-box-body); +} + +.tippy-box[data-theme="box-with-header"][data-placement^="bottom"] .tippy-svg-arrow-inner { + fill: var(--color-box-header); +} + + .tippy-box[data-placement^="top"] > .tippy-svg-arrow { bottom: 0; } @@ -111,20 +129,3 @@ .tippy-svg-arrow-inner { fill: var(--color-body); } - -.tippy-box[data-theme="tooltip"] .tippy-svg-arrow-inner, -.tippy-box[data-theme="tooltip"] .tippy-svg-arrow-outer { - fill: var(--color-tooltip-bg); -} - -.tippy-box[data-theme="menu"] .tippy-svg-arrow-inner { - fill: var(--color-menu); -} - -.tippy-box[data-theme="box-with-header"][data-placement^="top"] .tippy-svg-arrow-inner { - fill: var(--color-box-body); -} - -.tippy-box[data-theme="box-with-header"][data-placement^="bottom"] .tippy-svg-arrow-inner { - fill: var(--color-box-header); -} From b22407b01b69a177d230eba28cee7960050a1b27 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 2 Nov 2023 01:26:37 +0100 Subject: [PATCH 30/38] Add comment --- web_src/css/repo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 95922b1267379..a97a5f832d6ac 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3091,7 +3091,7 @@ tbody.commit-list { } .pr-commit-status[data-toggled="false"] .ui.attached.header { - transition-delay: .2s; + transition-delay: .2s; /* hide border when transition ends */ border-bottom-width: 0 !important; } From f9893fccd4bee15a2e277613ff3452e2c069cefd Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 2 Nov 2023 09:18:46 +0800 Subject: [PATCH 31/38] remove unnecessary "root" parameters for "repo/commit_statuses" --- templates/repo/branch/list.tmpl | 4 ++-- templates/repo/commit_page.tmpl | 2 +- templates/repo/commit_statuses.tmpl | 1 - templates/repo/commits_list.tmpl | 2 +- templates/repo/commits_list_small.tmpl | 2 +- templates/repo/view_list.tmpl | 2 +- templates/shared/issuelist.tmpl | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index ae3e3573cc776..cec5b6fc3e62d 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -23,7 +23,7 @@ {{if .DefaultBranchBranch.IsProtected}}{{svg "octicon-shield-lock"}}{{end}} {{.DefaultBranchBranch.DBBranch.Name}} - {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID) "root" $}} + {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}}

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink (.Repository.ComposeMetas ctx)}} · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

@@ -99,7 +99,7 @@ {{if .IsProtected}}{{svg "octicon-shield-lock"}}{{end}} {{.DBBranch.Name}} - {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID) "root" $}} + {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}}

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink ($.Repository.ComposeMetas ctx)}} · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

{{end}} diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index c0dfc6e0ad1a1..efdbb23e00ae7 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -19,7 +19,7 @@ {{end}}
-

{{RenderCommitMessage $.Context .Commit.Message $.RepoLink ($.Repository.ComposeMetas ctx)}}{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses "root" $}}

+

{{RenderCommitMessage $.Context .Commit.Message $.RepoLink ($.Repository.ComposeMetas ctx)}}{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses}}

{{if not $.PageIsWiki}} {{end}} diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index cdb893f51f265..77f1684245178 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -66,7 +66,7 @@ {{if IsMultilineCommitMessage .Message}} {{end}} - {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}} + {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}} {{if IsMultilineCommitMessage .Message}}
{{RenderCommitBody $.Context .Message $commitRepoLink ($.Repository.ComposeMetas ctx)}}
{{end}} diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl index 5b715a71d4eed..63eb5945bc2f7 100644 --- a/templates/repo/commits_list_small.tmpl +++ b/templates/repo/commits_list_small.tmpl @@ -14,7 +14,7 @@ {{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}} - {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $.root}} + {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}} {{$class := "ui sha label"}} {{if .Signature}} {{$class = (print $class " isSigned")}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 7e60f27291ee7..836c633ced668 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -24,7 +24,7 @@ {{template "repo/shabox_badge" dict "root" $ "verification" .LatestCommitVerification}} {{end}}
- {{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses "root" $}} + {{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses}} {{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}} {{RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $.RepoLink $commitLink ($.Repository.ComposeMetas ctx)}} {{if IsMultilineCommitMessage .LatestCommit.Message}} diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index 4214a03dcbb2c..e0d2e102e5ef7 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -16,7 +16,7 @@ {{RenderEmoji $.Context .Title | RenderCodeBlock}} {{if .IsPull}} {{if (index $.CommitStatuses .PullRequest.ID)}} - {{template "repo/commit_statuses" dict "Status" (index $.CommitLastStatus .PullRequest.ID) "Statuses" (index $.CommitStatuses .PullRequest.ID) "root" $}} + {{template "repo/commit_statuses" dict "Status" (index $.CommitLastStatus .PullRequest.ID) "Statuses" (index $.CommitStatuses .PullRequest.ID)}} {{end}} {{end}} From 0025ea96baec807c35d1201db3eb241ec20d97e8 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 2 Nov 2023 09:38:36 +0800 Subject: [PATCH 32/38] better tippy width calc --- web_src/css/modules/tippy.css | 2 +- web_src/css/repo.css | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/web_src/css/modules/tippy.css b/web_src/css/modules/tippy.css index 1afdeb7abd81a..ecc588c6f3936 100644 --- a/web_src/css/modules/tippy.css +++ b/web_src/css/modules/tippy.css @@ -6,7 +6,7 @@ } [data-tippy-root] { - max-width: calc(100vw - 10px); + max-width: calc(100vw - 32px); } .tippy-box { diff --git a/web_src/css/repo.css b/web_src/css/repo.css index a97a5f832d6ac..6ad03749a4d4a 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3140,10 +3140,6 @@ tbody.commit-list { padding-right: 0.5em; /* To match the alignment with the "required" label */ } -.tippy-commit-status { - max-width: calc(100vw - 16px); -} - .tippy-commit-status .ui.attached.header { border-top: 0 !important; } From 95062f16790b2f9e45c09eddd1d0730a8d4425e8 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 2 Nov 2023 11:21:21 +0800 Subject: [PATCH 33/38] fix --- templates/repo/commit_statuses.tmpl | 8 ++--- templates/repo/issue/view_content/pull.tmpl | 3 ++ templates/repo/pulls/status.tmpl | 14 ++++----- web_src/css/repo.css | 33 ++++----------------- web_src/js/features/repo-issue-pr-status.js | 17 +++++------ 5 files changed, 26 insertions(+), 49 deletions(-) diff --git a/templates/repo/commit_statuses.tmpl b/templates/repo/commit_statuses.tmpl index ebcc6da6cc980..ec2be6c38d5af 100644 --- a/templates/repo/commit_statuses.tmpl +++ b/templates/repo/commit_statuses.tmpl @@ -8,11 +8,7 @@ {{template "repo/commit_status" .Status}} {{end}} -
- {{template "repo/pulls/status" (dict - "CommitStatuses" .Statuses - "CommitStatus" .Status - "IsPopup" true - )}} +
+ {{template "repo/pulls/status" (dict "CommitStatuses" .Statuses "CommitStatus" .Status)}}
{{end}} diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index baabef1c2fa8d..2b5776ea03a52 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -20,11 +20,14 @@ {{- else if .Issue.PullRequest.CanAutoMerge}}green {{- else}}red{{end}}">{{svg "octicon-git-merge" 40}}
+
{{template "repo/pulls/status" (dict "CommitStatus" .LatestCommitStatus "CommitStatuses" .LatestCommitStatuses + "ShowHideChecks" true "is_context_required" .is_context_required )}} +
{{$showGeneralMergeForm := false}}
{{if .Issue.PullRequest.HasMerged}} diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl index 487bc265426a8..2b1c7ca594ece 100644 --- a/templates/repo/pulls/status.tmpl +++ b/templates/repo/pulls/status.tmpl @@ -2,13 +2,13 @@ Template Attributes: * CommitStatus: summary of all commit status state * CommitStatuses: all commit status elements -* IsPopup: whether this template is in a popup +* ShowHideChecks: whether use a button to show/hide the checks * is_context_required: Used in pull request commit status check table */}} {{if .CommitStatus}} -
-
+
+
{{if eq .CommitStatus.State "pending"}} {{ctx.Locale.Tr "repo.pulls.status_checking"}} {{else if eq .CommitStatus.State "success"}} @@ -23,9 +23,9 @@ Template Attributes: {{ctx.Locale.Tr "repo.pulls.status_checking"}} {{end}} - {{if not .IsPopup}} + {{if .ShowHideChecks}}
- @@ -33,9 +33,9 @@ Template Attributes: {{end}}
-
+
{{range .CommitStatuses}} -
+
{{template "repo/commit_status" .}} {{.Context}} {{.Description}}
diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 6ad03749a4d4a..ac18f33bc42de 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3074,25 +3074,15 @@ tbody.commit-list { } } +.commit-status-header { + border: none !important; /* reset the default ".ui.attached.header" styles, to use the outer border */ + margin: 0 !important; +} + .commit-status-list { - padding: 0 !important; max-height: 195px; /* fit exactly 4 items */ overflow-x: hidden; transition: max-height .2s; - border-bottom: none !important; -} - -.pr-commit-status[data-toggled="false"] .commit-status-list { - max-height: 0; /* hide it for the slide transition */ -} - -.pr-commit-status[data-toggled="false"] { - border-bottom: none !important; -} - -.pr-commit-status[data-toggled="false"] .ui.attached.header { - transition-delay: .2s; /* hide border when transition ends */ - border-bottom-width: 0 !important; } .commit-status-item { @@ -3100,14 +3090,7 @@ tbody.commit-list { display: flex; gap: 8px; align-items: center; -} - -.commit-status-item:first-child { - border-top: none !important; -} - -.commit-status-item:last-child { - border-bottom: none !important; + border-top: 1px solid var(--color-secondary); } .commit-status-item .commit-status { @@ -3140,10 +3123,6 @@ tbody.commit-list { padding-right: 0.5em; /* To match the alignment with the "required" label */ } -.tippy-commit-status .ui.attached.header { - border-top: 0 !important; -} - .search-fullname { color: var(--color-text-light-2); } diff --git a/web_src/js/features/repo-issue-pr-status.js b/web_src/js/features/repo-issue-pr-status.js index d759ed5d858ad..27073bea5e65c 100644 --- a/web_src/js/features/repo-issue-pr-status.js +++ b/web_src/js/features/repo-issue-pr-status.js @@ -1,11 +1,10 @@ export function initRepoPullRequestCommitStatus() { - const btn = document.querySelector('.hide-all-checks'); - if (!btn) return; - - btn.addEventListener('click', () => { - const prCommitStatus = document.querySelector('.pr-commit-status'); - const toggled = prCommitStatus.getAttribute('data-toggled') === 'true'; - btn.textContent = btn.getAttribute(toggled ? 'data-hide-all' : 'data-show-all'); - prCommitStatus.setAttribute('data-toggled', String(!toggled)); - }); + for (const btn of document.querySelectorAll('.commit-status-hide-checks')) { + btn.addEventListener('click', () => { + const panel = btn.closest('.commit-status-panel'); + const list = panel.querySelector('.commit-status-list'); + list.style.maxHeight = list.style.maxHeight ? '' : '0px'; + btn.textContent = btn.getAttribute(list.style.maxHeight ? 'data-show-all' : 'data-hide-all'); + }); + } } From ee19a339c8f1fbcd39f9ee24a97367f276e045ab Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 2 Nov 2023 11:30:10 +0800 Subject: [PATCH 34/38] avoid scrollbar flicker when show/hide the checks --- web_src/js/features/repo-issue-pr-status.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web_src/js/features/repo-issue-pr-status.js b/web_src/js/features/repo-issue-pr-status.js index 27073bea5e65c..30106157061a6 100644 --- a/web_src/js/features/repo-issue-pr-status.js +++ b/web_src/js/features/repo-issue-pr-status.js @@ -1,10 +1,12 @@ export function initRepoPullRequestCommitStatus() { for (const btn of document.querySelectorAll('.commit-status-hide-checks')) { + const panel = btn.closest('.commit-status-panel'); + const list = panel.querySelector('.commit-status-list'); btn.addEventListener('click', () => { - const panel = btn.closest('.commit-status-panel'); - const list = panel.querySelector('.commit-status-list'); - list.style.maxHeight = list.style.maxHeight ? '' : '0px'; + list.style.maxHeight = list.style.maxHeight ? '' : '0px'; // toggle + list.style.overflow = 'hidden'; // hide scrollbar when hiding btn.textContent = btn.getAttribute(list.style.maxHeight ? 'data-show-all' : 'data-hide-all'); }); + list.addEventListener('animationend', () => list.style.overflow = ''); } } From 4e02ba001eaeb9167c3de773f1239d274fd30364 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 2 Nov 2023 07:52:45 +0000 Subject: [PATCH 35/38] fix lint --- web_src/css/modules/tippy.css | 1 - 1 file changed, 1 deletion(-) diff --git a/web_src/css/modules/tippy.css b/web_src/css/modules/tippy.css index ecc588c6f3936..0d77b937495c6 100644 --- a/web_src/css/modules/tippy.css +++ b/web_src/css/modules/tippy.css @@ -70,7 +70,6 @@ fill: var(--color-box-header); } - .tippy-box[data-placement^="top"] > .tippy-svg-arrow { bottom: 0; } From a5f59538a76c1691b4e913dcaa065fcf0eed3ed5 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 2 Nov 2023 19:45:23 +0800 Subject: [PATCH 36/38] fix --- templates/repo/pulls/status.tmpl | 2 +- web_src/css/repo.css | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl index 2b1c7ca594ece..ae508b8fa4fa2 100644 --- a/templates/repo/pulls/status.tmpl +++ b/templates/repo/pulls/status.tmpl @@ -37,7 +37,7 @@ Template Attributes: {{range .CommitStatuses}}
{{template "repo/commit_status" .}} - {{.Context}} {{.Description}} +
{{.Context}} {{.Description}}
{{if $.is_context_required}} {{if (call $.is_context_required .Context)}}
{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}
{{end}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index ac18f33bc42de..e4995d42298b6 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3098,11 +3098,8 @@ tbody.commit-list { } .commit-status-item .status-context { - display: flex; + color: var(--color-text); flex: 1; - justify-content: space-between; - gap: 8px; - max-width: calc(100% - 26px); } .commit-status-item .status-details { From 5b8a73513252b5b978a87741ced8ecdfb1581017 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 2 Nov 2023 14:14:15 +0100 Subject: [PATCH 37/38] add background color to box-with-header theme --- web_src/css/modules/tippy.css | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/css/modules/tippy.css b/web_src/css/modules/tippy.css index 0d77b937495c6..175940b8fe9e3 100644 --- a/web_src/css/modules/tippy.css +++ b/web_src/css/modules/tippy.css @@ -59,6 +59,7 @@ /* box-with-header theme for .ui.attached.header and .ui.attached.segment */ .tippy-box[data-theme="box-with-header"] .tippy-content { + background: var(--color-box-body); padding: 0; } From 222faecfbde809da59c7f9b6687ec6675d7fd071 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 2 Nov 2023 14:17:23 +0100 Subject: [PATCH 38/38] update comment --- web_src/css/modules/tippy.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/modules/tippy.css b/web_src/css/modules/tippy.css index 175940b8fe9e3..45feab757477a 100644 --- a/web_src/css/modules/tippy.css +++ b/web_src/css/modules/tippy.css @@ -56,7 +56,7 @@ fill: var(--color-menu); } -/* box-with-header theme for .ui.attached.header and .ui.attached.segment */ +/* box-with-header theme to look like .ui.attached.segment. can contain .ui.attached.header */ .tippy-box[data-theme="box-with-header"] .tippy-content { background: var(--color-box-body);