diff --git a/styles/components/issues/issue_conversation.ts b/styles/components/issues/issue_conversation.ts
index 76c70bad..d4ef4465 100644
--- a/styles/components/issues/issue_conversation.ts
+++ b/styles/components/issues/issue_conversation.ts
@@ -604,6 +604,75 @@ export default css`
& .comment .markup p {
line-height: inherit;
}
+ /* A commit with a body: GitHub's small "…" pill right after the message, not a full button by the hash. */
+ & .comment-list .timeline-item.commits-list .singular-commit {
+ min-height: 36px;
+ & > .badge.badge-commit {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ & > svg {
+ width: 16px;
+ height: 16px;
+ padding: 0;
+ }
+ }
+ /* GitHub sets the first commit of a push apart: a taller row and its icon in a filled circle. */
+ &:first-child {
+ min-height: 64px;
+ /* An unfolded body stays right under the title, inside the row's padding. */
+ &:has(+ .commit-body:not(.tw-hidden)) {
+ min-height: 48px;
+ padding-top: 16px;
+ }
+ & > .badge.badge-commit {
+ box-sizing: border-box;
+ width: 32px;
+ height: 32px !important;
+ /* Forgejo's -33px offset for its 34px badge, kept centred on the timeline line. */
+ margin: 0 9px 0 -32px;
+ border: 2px solid ${themeVars.color.body};
+ border-radius: 50%;
+ background: ${themeVars.github.control.bgColor.rest};
+ }
+ }
+ /* Forgejo's utilities are !important. */
+ & > .gt-ellipsis.tw-flex-1 {
+ flex: 0 1 auto !important;
+ }
+ & > .shabox {
+ margin-left: auto;
+ }
+ & > .ellipsis-button.ui.button {
+ flex: none;
+ min-width: 0;
+ min-height: 0;
+ height: 12px;
+ margin: 0 0 0 5px;
+ padding: 0 5px;
+ border: 0;
+ border-radius: 1px;
+ background: color-mix(in srgb, ${themeVars.github.bgColor.neutral.emphasis} 20%, transparent);
+ box-shadow: none;
+ color: ${themeVars.color.text.self};
+ font-size: 12px;
+ font-weight: 600;
+ line-height: 6px;
+ &:hover {
+ background: ${themeVars.github.control.transparent.bgColor.active};
+ }
+ }
+ }
+ /* The unfolded body: muted 12px monospace under the avatar. */
+ & .comment-list .timeline-item.commits-list > .commit-body {
+ margin: 0 0 8px 9px !important;
+ color: ${themeVars.color.text.light.num1};
+ font-size: 12px;
+ line-height: 18px;
+ }
+ & .comment-list .timeline-item.commits-list > .singular-commit:first-child + .commit-body {
+ margin-bottom: 16px !important;
+ }
/* Commits listed in the timeline: a plain, muted seven-character hash. */
& .comment-list .timeline-item.commits-list .shabox .sha.label {
min-height: 0;
diff --git a/styles/components/issues/pull_review.ts b/styles/components/issues/pull_review.ts
index 364a18d2..b906fe8a 100644
--- a/styles/components/issues/pull_review.ts
+++ b/styles/components/issues/pull_review.ts
@@ -452,10 +452,14 @@ export default css`
flex: 1 1 200px;
min-width: 0;
}
+ /* GitHub centres a row's button on a one-line title and tops it with a two-line one. */
& > .ui.button {
flex: none;
align-self: center;
}
+ &:has(> div > p) > .ui.button {
+ align-self: flex-start;
+ }
& h3 {
margin: 0;
font-size: 16px;
@@ -470,17 +474,33 @@ export default css`
line-height: 21px;
}
}
- /* Merged and closed: the same title and muted sentence, with "Delete branch" beside them. */
+ /* Merged and closed: the same title and muted sentence, with "Delete branch" beside them, level with the title. */
+ & > .item.item-section:has(.merge-section-info) {
+ align-items: flex-start;
+ }
& > .item.item-section > div > h3 {
margin: 0 !important;
font-size: 16px;
font-weight: 600;
line-height: 24px;
}
+ & > .item p:empty {
+ display: none;
+ }
& > .item.item-section .merge-section-info {
color: ${themeVars.color.text.light.num1};
font-size: 14px;
line-height: 21px;
+ /* The branch name: GitHub's blue branch chip. */
+ & code {
+ padding: 2px 6px;
+ border: 0;
+ border-radius: 6px;
+ background: ${themeVars.github.bgColor.accent.muted};
+ color: ${themeVars.github.fgColor.accent};
+ font-size: 12px;
+ line-height: 18px;
+ }
}
& > .item.pull-merge-status > svg {
background: ${themeVars.github.bgColor.success.emphasis};
@@ -534,6 +554,11 @@ export default css`
min-width: 0;
}
/* The counts per state: an icon and a number each, labelled with Forgejo's name for the state. */
+ /* GitHub's sentence of counts where the theme has it in the reader's language, else the icons with numbers. */
+ & .pull-merge-checks-counts:empty,
+ & .pull-merge-checks-counts:not(:empty) + .pull-merge-checks-icons {
+ display: none;
+ }
& .pull-merge-checks-counts {
display: flex;
flex-wrap: wrap;
@@ -550,9 +575,9 @@ export default css`
}
& .pull-merge-checks-ring {
flex: none;
- width: 28px;
- height: 28px;
- margin: 2px;
+ width: 32px;
+ height: 32px;
+ margin: 0;
border-radius: 50%;
background: conic-gradient(
${themeVars.github.fgColor.success} 0 var(--checks-passing),
@@ -584,6 +609,8 @@ export default css`
transform: rotate(-90deg);
}
& > .commit-status-list {
+ /* GitHub scrolls the checks past 300px. */
+ max-height: 300px;
overflow: hidden auto;
padding: 8px 0;
border-top: 1px solid var(--merge-section-divider);
@@ -593,13 +620,55 @@ export default css`
border-top: 0;
}
}
+ /* GitHub's rows have no rules between them and 16px icons. */
+ /* A group of checks in one state, folded by its heading, as GitHub's "1 failing check". */
+ & .pull-merge-check-group > summary {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ height: 28px;
+ padding: 0 8px;
+ border-radius: ${otherThemeVars.border.radius};
+ color: ${themeVars.color.text.light.num1};
+ font-size: 12px;
+ font-weight: 500;
+ line-height: 18px;
+ list-style: none;
+ cursor: pointer;
+ &::-webkit-details-marker {
+ display: none;
+ }
+ &:hover {
+ background: ${themeVars.github.control.transparent.bgColor.hover};
+ }
+ & > svg {
+ transition: transform 0.15s ease;
+ }
+ }
+ & .pull-merge-check-group:not([open]) > summary > svg {
+ transform: rotate(-90deg);
+ }
& .commit-status-item {
display: flex;
align-items: center;
gap: 8px;
+ height: auto;
min-height: 37px;
margin: 0 8px;
- padding: 2px 8px;
+ padding: 2px 6px;
+ border: 0;
+ /* GitHub rules off the checks within one group. */
+ & + .commit-status-item {
+ border-top: 1px solid ${themeVars.color.light.border};
+ border-radius: 0;
+ }
+ & > .commit-status.icon {
+ flex: none;
+ width: 16px;
+ min-width: 16px;
+ height: 16px;
+ margin: 0;
+ }
border-radius: ${otherThemeVars.border.radius};
&:hover {
background: ${themeVars.github.control.transparent.bgColor.hover};
@@ -612,6 +681,10 @@ export default css`
margin-left: 4px;
font-size: 12px;
}
+ /* GitHub sets a status's description off with a dash. */
+ & .status-context > span:not(:empty)::before {
+ content: "— ";
+ }
& .status-details a {
color: ${themeVars.color.text.light.num1};
font-size: 12px;
@@ -636,6 +709,16 @@ export default css`
& summary {
${mergeInstructionsLink}
}
+ /* GitHub's "You can also merge this with the command line." before the link, muted and not underlined. */
+ & summary > .pull-merge-cli-hint {
+ display: inline-block;
+ margin-right: 4px;
+ color: ${themeVars.color.text.light.num1};
+ text-decoration: none;
+ &:empty {
+ display: none;
+ }
+ }
& .ui.button {
${mergeButton}
margin: 0;
@@ -667,6 +750,13 @@ export default css`
padding: 0;
justify-content: center;
}
+ /* GitHub's merge button is only its label. */
+ & .merge-button > .ui.button:not(.dropdown, .icon) {
+ padding-inline: 12px;
+ & > svg {
+ display: none;
+ }
+ }
/* The expanded form takes the whole row: title, message, then the buttons. */
& > #pull-request-merge-form:has(form .field) {
flex: 0 0 100%;
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl
index 8cd1be9a..7d04ba37 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull.tmpl
@@ -35,6 +35,7 @@
"CommitStatuses" .LatestCommitStatuses
"MissingRequiredChecks" .MissingRequiredChecks
"is_context_required" .is_context_required
+ "Conflicted" .IsPullFilesConflicted
)}}
{{end}}
@@ -48,7 +49,7 @@
{{ctx.Locale.Tr "repo.pulls.merged_success"}}
- {{ctx.Locale.Tr "repo.pulls.merged_info_text" (HTMLFormat "%s" .HeadTarget)}}
+ {{template "theme/phrase" dict "Key" "pulls.merged.description" "Branch" (HTMLFormat "%s" .HeadTarget) "Fallback" (ctx.Locale.Tr "repo.pulls.merged_info_text" (HTMLFormat "%s" .HeadTarget))}}
@@ -60,10 +61,14 @@
{{else if .Issue.IsClosed}}
-
{{ctx.Locale.Tr "repo.pulls.closed"}}
+ {{/* GitHub names a closed pull request's branch while it can still be deleted. */}}
+ {{$branchLeft := and .IsPullBranchDeletable (not .IsPullRequestBroken)}}
+
{{if $branchLeft}}{{template "theme/phrase" dict "Key" "pulls.closed.title" "Fallback" (ctx.Locale.Tr "repo.pulls.closed")}}{{else}}{{ctx.Locale.Tr "repo.pulls.closed"}}{{end}}
{{if .IsPullRequestBroken}}
{{ctx.Locale.Tr "repo.pulls.cant_reopen_deleted_branch"}}
+ {{else if $branchLeft}}
+ {{template "theme/phrase" dict "Key" "pulls.closed.description" "Branch" (HTMLFormat "
%s" .HeadTarget) "Fallback" (ctx.Locale.Tr "repo.pulls.reopen_to_merge")}}
{{else}}
{{ctx.Locale.Tr "repo.pulls.reopen_to_merge"}}
{{end}}
@@ -80,8 +85,8 @@
{{svg "octicon-alert-fill"}}
-
{{ctx.Locale.Tr "repo.pulls.files_conflicted"}}
-
{{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_helper"}}
+
{{template "theme/phrase" dict "Key" "pulls.merge.conflict_title" "Fallback" (ctx.Locale.Tr "repo.pulls.files_conflicted")}}
+
{{template "theme/phrase" dict "Key" "pulls.merge.conflict_description" "Fallback" (ctx.Locale.Tr "repo.pulls.cannot_auto_merge_helper")}}
{{range .ConflictedFiles}}
{{svg "octicon-file"}}{{.}}
@@ -102,7 +107,8 @@
{{svg "octicon-git-pull-request-draft"}}
-
{{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
+
{{template "theme/phrase" dict "Key" "pulls.merge.draft_title" "Fallback" (ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress")}}
+
{{template "theme/phrase" dict "Key" "pulls.merge.draft_description" "Fallback" (ctx.Locale.Tr "repo.pulls.no_merge_wip")}}
{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
{{ctx.Locale.Tr "repo.pulls.remove_prefix" .WorkInProgressPrefix}}
@@ -417,8 +423,8 @@
{{else if and $showMergeInstructions .AllowMerge (not .IsPullRequestBroken) (or .IsPullWorkInProgress .IsPullFilesConflicted)}}
{{/* GitHub keeps the merge button in place, disabled, until the draft or the conflict is resolved. */}}
-
-
{{svg "octicon-git-merge"}}{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}
+
+ {{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}
{{svg "octicon-triangle-down" 14}}
{{template "repo/issue/view_content/pull_merge_instruction" dict "PullRequest" .Issue.PullRequest "ShowMergeInstructions" .ShowMergeInstructions "AutodetectManualMerge" .AutodetectManualMerge "DefaultMergeMessage" .DefaultMergeMessage "DefaultMergeBody" .DefaultMergeBody "IsPullFilesConflicted" .IsPullFilesConflicted "NoDivider" true}}
diff --git a/templates/repo/issue/view_content/pull_merge_check_icon.tmpl b/templates/repo/issue/view_content/pull_merge_check_icon.tmpl
new file mode 100644
index 00000000..b9ad07e8
--- /dev/null
+++ b/templates/repo/issue/view_content/pull_merge_check_icon.tmpl
@@ -0,0 +1,12 @@
+{{/* A check's state in the merge box, as GitHub draws it there: failing checks get a filled circle. */}}
+{{if or (eq .State "failure") (eq .State "error")}}
+ {{svg "octicon-x-circle-fill" 16 "commit-status icon text red"}}
+{{else if eq .State "warning"}}
+ {{svg "octicon-alert-fill" 16 "commit-status icon text yellow"}}
+{{else if eq .State "pending"}}
+ {{svg "octicon-dot-fill" 16 "commit-status icon text yellow"}}
+{{else if eq .State "skipped"}}
+ {{svg "octicon-skip" 16 "commit-status icon text grey"}}
+{{else}}
+ {{svg "octicon-check" 16 "commit-status icon text green"}}
+{{end}}
diff --git a/templates/repo/issue/view_content/pull_merge_check_row.tmpl b/templates/repo/issue/view_content/pull_merge_check_row.tmpl
new file mode 100644
index 00000000..c3854c62
--- /dev/null
+++ b/templates/repo/issue/view_content/pull_merge_check_row.tmpl
@@ -0,0 +1,11 @@
+{{/* One check in the merge box: its state, name and description, and whether branch protection requires it. Takes Status and is_context_required. */}}
+
+ {{template "repo/issue/view_content/pull_merge_check_icon" .Status}}
+
{{.Status.Context}} {{.Status.Description}}
+
+
diff --git a/templates/repo/issue/view_content/pull_merge_checks.tmpl b/templates/repo/issue/view_content/pull_merge_checks.tmpl
index 8b82e026..97c4368a 100644
--- a/templates/repo/issue/view_content/pull_merge_checks.tmpl
+++ b/templates/repo/issue/view_content/pull_merge_checks.tmpl
@@ -2,14 +2,16 @@
The checks section of the merge box, as GitHub draws it: a status ring, a title naming the
overall result, the counts beneath it and a chevron that folds the list. Passing checks start
folded. Forgejo's own script toggles the list through .commit-status-hide-checks.
-All words come from Forgejo's translations; the counts are icons with numbers, labelled with
-Forgejo's names for each state.
+GitHub's wording comes from the theme's phrases (locales/); a language without them keeps
+Forgejo's: its overall result, the counts as icons with numbers, and each group named by
+Forgejo's word for the state.
Template Attributes:
* CommitStatus: summary of all commit status state
* CommitStatuses: all commit status elements
* MissingRequiredChecks: commit check contexts that are required by branch protection but not present
* is_context_required: whether a context is required by branch protection
+* Conflicted: whether the branch has conflicts, which GitHub's title names
*/}}
{{$failing := 0}}{{$pending := 0}}{{$passing := 0}}{{$skipped := 0}}
{{range .CommitStatuses}}
@@ -32,15 +34,21 @@ Template Attributes:
{{end}}
-
- {{- if eq $state "success"}}{{ctx.Locale.Tr "repo.pulls.status_checks_success"}}
- {{- else if eq $state "pending"}}{{ctx.Locale.Tr "repo.pulls.status_checking"}}
- {{- else if eq $state "skipped"}}{{ctx.Locale.Tr "pulls.status_checks.skipped"}}
- {{- else if eq $state "warning"}}{{ctx.Locale.Tr "repo.pulls.status_checks_warning"}}
- {{- else if eq $state "error"}}{{ctx.Locale.Tr "repo.pulls.status_checks_error"}}
- {{- else}}{{ctx.Locale.Tr "repo.pulls.status_checks_failure"}}{{end -}}
-
+ {{$forgejoTitle := ctx.Locale.Tr "repo.pulls.status_checks_failure"}}
+ {{if eq $state "success"}}{{$forgejoTitle = ctx.Locale.Tr "repo.pulls.status_checks_success"}}
+ {{else if eq $state "pending"}}{{$forgejoTitle = ctx.Locale.Tr "repo.pulls.status_checking"}}
+ {{else if eq $state "skipped"}}{{$forgejoTitle = ctx.Locale.Tr "pulls.status_checks.skipped"}}
+ {{else if eq $state "warning"}}{{$forgejoTitle = ctx.Locale.Tr "repo.pulls.status_checks_warning"}}
+ {{else if eq $state "error"}}{{$forgejoTitle = ctx.Locale.Tr "repo.pulls.status_checks_error"}}{{end}}
+ {{$titleKey := "pulls.checks.title_failure"}}
+ {{if and .Conflicted (ne $state "success")}}{{$titleKey = "pulls.checks.title_conflict"}}
+ {{else if or (eq $state "success") (eq $state "skipped")}}{{$titleKey = "pulls.checks.title_success"}}
+ {{else if eq $state "pending"}}{{$titleKey = "pulls.checks.title_pending"}}{{end}}
+
{{template "theme/phrase" dict "Key" $titleKey "Fallback" $forgejoTitle}}
+ {{- template "theme/phrase" dict "Key" "pulls.checks.summary" "Count" $total "Failing" $failing "Pending" $pending "Skipped" $skipped "Successful" $passing "Fallback" "" -}}
+
+
{{- if ne (print $failing) "0"}}{{svg "octicon-x" 16 "text red"}}{{$failing}} {{end}}
{{- if ne (print $pending) "0"}}{{svg "octicon-dot-fill" 16 "text yellow"}}{{$pending}} {{end}}
{{- if ne (print $skipped) "0"}}{{svg "octicon-skip" 16 "text grey"}}{{$skipped}} {{end}}
@@ -55,24 +63,45 @@ Template Attributes:
{{svg "octicon-chevron-down" 16 "pull-merge-checks-chevron"}}
- {{range .CommitStatuses}}
-
- {{template "repo/commit_status" .}}
-
{{.Context}} {{.Description}}
-
-
+ {{/* GitHub groups the checks: failing first, then those in progress, skipped and successful. */}}
+ {{if ne (print $failing) "0"}}
+
+ {{template "theme/phrase" dict "Key" "pulls.checks.group_failing" "Count" $failing "Fallback" (HTMLFormat "%s (%d)" (ctx.Locale.Tr "actions.status.failure") $failing)}}{{svg "octicon-chevron-down" 12}}
+ {{range .CommitStatuses}}{{if or (eq .State "failure") (eq .State "error") (eq .State "warning")}}
+ {{template "repo/issue/view_content/pull_merge_check_row" dict "Status" . "is_context_required" $.is_context_required}}
+ {{end}}{{end}}
+
+ {{end}}
+ {{if ne (print $pending) "0"}}
+
+ {{template "theme/phrase" dict "Key" "pulls.checks.group_pending" "Count" $pending "Fallback" (HTMLFormat "%s (%d)" (ctx.Locale.Tr "actions.status.waiting") $pending)}}{{svg "octicon-chevron-down" 12}}
+ {{range .CommitStatuses}}{{if eq .State "pending"}}
+ {{template "repo/issue/view_content/pull_merge_check_row" dict "Status" . "is_context_required" $.is_context_required}}
+ {{end}}{{end}}
+ {{range .MissingRequiredChecks}}
+
+ {{svg "octicon-dot-fill" 16 "commit-status icon text yellow"}}
+
{{.}}
+
{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}
+
+ {{end}}
+
+ {{end}}
+ {{if ne (print $skipped) "0"}}
+
+ {{template "theme/phrase" dict "Key" "pulls.checks.group_skipped" "Count" $skipped "Fallback" (HTMLFormat "%s (%d)" (ctx.Locale.Tr "actions.status.skipped") $skipped)}}{{svg "octicon-chevron-down" 12}}
+ {{range .CommitStatuses}}{{if eq .State "skipped"}}
+ {{template "repo/issue/view_content/pull_merge_check_row" dict "Status" . "is_context_required" $.is_context_required}}
+ {{end}}{{end}}
+
{{end}}
- {{range .MissingRequiredChecks}}
-
- {{svg "octicon-dot-fill" 18 "commit-status icon text yellow"}}
-
{{.}}
-
{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}
-
+ {{if ne (print $passing) "0"}}
+
+ {{template "theme/phrase" dict "Key" "pulls.checks.group_successful" "Count" $passing "Fallback" (HTMLFormat "%s (%d)" (ctx.Locale.Tr "actions.status.success") $passing)}}{{svg "octicon-chevron-down" 12}}
+ {{range .CommitStatuses}}{{if not (or (eq .State "failure") (eq .State "error") (eq .State "warning") (eq .State "pending") (eq .State "skipped"))}}
+ {{template "repo/issue/view_content/pull_merge_check_row" dict "Status" . "is_context_required" $.is_context_required}}
+ {{end}}{{end}}
+
{{end}}
diff --git a/templates/repo/issue/view_content/pull_merge_clean.tmpl b/templates/repo/issue/view_content/pull_merge_clean.tmpl
index dc31daec..1460fd49 100644
--- a/templates/repo/issue/view_content/pull_merge_clean.tmpl
+++ b/templates/repo/issue/view_content/pull_merge_clean.tmpl
@@ -2,11 +2,11 @@
{{svg "octicon-check"}}
-
{{ctx.Locale.Tr "repo.pulls.can_auto_merge_desc"}}
- {{if .WillSign}}
-
{{ctx.Locale.Tr "repo.signing.will_sign" .SigningKey}}
- {{else if .IsSigned}}
-
{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
- {{end}}
+
{{template "theme/phrase" dict "Key" "pulls.merge.clean_title" "Fallback" (ctx.Locale.Tr "repo.pulls.can_auto_merge_desc")}}
+ {{/* GitHub's sentence where the theme has it, else Forgejo's note on why the merge won't be signed; a merge that will be signed says so either way. */}}
+ {{$wontSign := ""}}
+ {{if and .IsSigned (not .WillSign)}}{{$wontSign = ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}{{end}}
+
{{template "theme/phrase" dict "Key" "pulls.merge.clean_description" "Fallback" $wontSign}}
+ {{if .WillSign}}
{{ctx.Locale.Tr "repo.signing.will_sign" .SigningKey}}
{{end}}
diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
index e493762a..3321544c 100644
--- a/templates/repo/issue/view_content/pull_merge_instruction.tmpl
+++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
@@ -1,6 +1,6 @@
{{if not .NoDivider}}
{{end}}
- {{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}}
+ {{template "theme/phrase" dict "Key" "pulls.merge.command_line_hint" "Fallback" ""}} {{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}}
{{if .IsPullFilesConflicted}}
{{$titleID := printf "manual-merge-title-%d" .PullRequest.ID}}
{{$bodyID := printf "manual-merge-body-%d" .PullRequest.ID}}