From 7cc47da78cef9648a7c930fd68e7436be8f78e57 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sun, 13 Jul 2025 22:52:35 +0800 Subject: [PATCH] Refactor view issue & comment list styles (#35061) Fix #35060 --- templates/repo/commits_list_small.tmpl | 2 +- templates/repo/diff/comments.tmpl | 14 +- templates/repo/editor/commit_form.tmpl | 2 +- templates/repo/issue/new_form.tmpl | 4 +- templates/repo/issue/view_content.tmpl | 4 +- .../repo/issue/view_content/comments.tmpl | 104 +++++----- .../issue/view_content/pull_merge_box.tmpl | 2 +- templates/repo/issue/view_title.tmpl | 2 +- templates/shared/user/avatarlink.tmpl | 2 +- tests/integration/pull_create_test.go | 4 +- tests/integration/timetracking_test.go | 4 +- web_src/css/base.css | 6 +- web_src/css/modules/comment.css | 4 - web_src/css/repo.css | 196 +++--------------- 14 files changed, 110 insertions(+), 240 deletions(-) diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl index ee94ad7e58..0470d1e9f5 100644 --- a/templates/repo/commits_list_small.tmpl +++ b/templates/repo/commits_list_small.tmpl @@ -22,7 +22,7 @@ {{end}} - + {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}} {{template "repo/commit_sign_badge" dict "Commit" . "CommitBaseLink" $commitBaseLink "CommitSignVerification" .Verification}} diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index aa483ec669..22829fbf8a 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -2,13 +2,15 @@ {{$createdStr:= DateUtils.TimeSince .CreatedUnix}}
- {{if .OriginalAuthor}} - {{ctx.AvatarUtils.Avatar nil}} - {{else}} - {{template "shared/user/avatarlink" dict "user" .Poster}} - {{end}} +
+ {{if .OriginalAuthor}} + {{ctx.AvatarUtils.Avatar nil}} + {{else}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{end}} +
-
+
{{if .OriginalAuthor}} diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl index 7067614444..3e4482f9e2 100644 --- a/templates/repo/editor/commit_form.tmpl +++ b/templates/repo/editor/commit_form.tmpl @@ -1,6 +1,6 @@
{{ctx.AvatarUtils.Avatar .SignedUser 40 "commit-avatar"}} -
+

{{- if .CommitFormOptions.WillSign}} {{svg "octicon-lock" 24}} {{ctx.Locale.Tr "repo.editor.commit_signed_changes"}} diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index 9413200870..b63cbcfc0d 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -4,8 +4,8 @@
- {{ctx.AvatarUtils.Avatar .SignedUser 40}} -
+
{{ctx.AvatarUtils.Avatar .SignedUser 40}}
+
{{end}}
-
+
{{if .Issue.OriginalAuthor}} @@ -78,7 +78,7 @@ {{ctx.AvatarUtils.Avatar .SignedUser 40}}
-
+
{{template "repo/issue/comment_tab" .}} {{.CsrfTokenHtml}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 2bf8837dd5..089cdf2ccd 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -26,14 +26,14 @@ {{end}}
-
+
{{if .OriginalAuthor}} {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{.OriginalAuthor}} - + {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}} {{if $.Repository.OriginalURL}} @@ -45,7 +45,7 @@ {{ctx.AvatarUtils.Avatar .Poster 24}} {{end}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}} @@ -85,7 +85,7 @@ {{if not .OriginalAuthor}} {{template "shared/user/avatarlink" dict "user" .Poster}} {{end}} - + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} {{if .Issue.IsPull}} {{ctx.Locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr}} @@ -100,7 +100,7 @@ {{if not .OriginalAuthor}} {{template "shared/user/avatarlink" dict "user" .Poster}} {{end}} - + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} {{if .Issue.IsPull}} {{ctx.Locale.Tr "repo.pulls.closed_at" .EventTag $createdStr}} @@ -115,7 +115,7 @@ {{if not .OriginalAuthor}} {{template "shared/user/avatarlink" dict "user" .Poster}} {{end}} - + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} {{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}} {{if eq $.Issue.PullRequest.Status 3}} @@ -143,28 +143,28 @@ {{svg "octicon-bookmark"}} {{template "shared/user/avatarlink" dict "user" .Poster}} {{if eq .RefAction 3}}{{end}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr $refTr .EventTag $createdStr (.RefCommentLink ctx) $refFrom}} {{if eq .RefAction 3}}{{end}}
{{else if eq .Type 4}}
{{svg "octicon-bookmark"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr}}
{{svg "octicon-git-commit"}} {{/* the content is a link like message title (from CreateRefComment) */}} - {{.Content | SanitizeHTML}} + {{.Content | SanitizeHTML}}
{{else if eq .Type 7}} @@ -172,7 +172,7 @@
{{svg "octicon-tag"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if and .AddedLabels (not .RemovedLabels)}} {{ctx.Locale.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (ctx.RenderUtils.RenderLabels .AddedLabels $.RepoLink .Issue) $createdStr}} @@ -188,7 +188,7 @@
{{svg "octicon-milestone"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.change_milestone_at" .OldMilestone.Name .Milestone.Name $createdStr}}{{else}}{{ctx.Locale.Tr "repo.issues.remove_milestone_at" .OldMilestone.Name $createdStr}}{{end}}{{else if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.add_milestone_at" .Milestone.Name $createdStr}}{{end}} @@ -198,7 +198,7 @@ {{svg "octicon-person"}} {{if .RemovedAssignee}} {{template "shared/user/avatarlink" dict "user" .Assignee}} - + {{template "shared/user/authorlink" .Assignee}} {{if eq .Poster.ID .Assignee.ID}} {{ctx.Locale.Tr "repo.issues.remove_self_assignment" $createdStr}} @@ -208,7 +208,7 @@ {{else}} {{template "shared/user/avatarlink" dict "user" .Assignee}} - + {{template "shared/user/authorlink" .Assignee}} {{if eq .Poster.ID .AssigneeID}} {{ctx.Locale.Tr "repo.issues.self_assign_at" $createdStr}} @@ -222,7 +222,7 @@
{{svg "octicon-pencil"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr "repo.issues.change_title_at" (.OldTitle|ctx.RenderUtils.RenderEmoji) (.NewTitle|ctx.RenderUtils.RenderEmoji) $createdStr}} @@ -231,7 +231,7 @@
{{svg "octicon-git-branch"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$oldRef := HTMLFormat `%s` .OldRef}} {{ctx.Locale.Tr "repo.issues.delete_branch_at" $oldRef $createdStr}} @@ -241,7 +241,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr "repo.issues.start_tracking_history" $createdStr}} @@ -250,7 +250,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$timeStr := .RenderedContent}} {{/* compatibility with time comments made before v1.21 */}} {{if not $timeStr}}{{$timeStr = .Content|Sec2Hour}}{{end}} @@ -262,7 +262,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$timeStr := .RenderedContent}} {{/* compatibility with time comments made before v1.21 */}} {{if not $timeStr}}{{$timeStr = .Content|Sec2Hour}}{{end}} @@ -274,7 +274,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr "repo.issues.cancel_tracking_history" $createdStr}} @@ -283,7 +283,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$dueDate := DateUtils.AbsoluteLong (.Content|DateUtils.ParseLegacy)}} {{ctx.Locale.Tr "repo.issues.due_date_added" $dueDate $createdStr}} @@ -293,7 +293,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$parsedDeadline := StringUtils.Split .Content "|"}} {{if eq (len $parsedDeadline) 2}} @@ -307,7 +307,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$dueDate := DateUtils.AbsoluteLong (.Content|DateUtils.ParseLegacy)}} {{ctx.Locale.Tr "repo.issues.due_date_remove" $dueDate $createdStr}} @@ -317,14 +317,14 @@
{{svg "octicon-package-dependents"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr "repo.issues.dependency.added_dependency" $createdStr}} {{if .DependentIssue}}
{{svg "octicon-plus"}} - + {{if eq .DependentIssue.RepoID .Issue.RepoID}} #{{.DependentIssue.Index}} {{.DependentIssue.Title}} @@ -340,14 +340,14 @@
{{svg "octicon-package-dependents"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr "repo.issues.dependency.removed_dependency" $createdStr}} {{if .DependentIssue}}
{{svg "octicon-trash"}} - + {{if eq .DependentIssue.RepoID .Issue.RepoID}} #{{.DependentIssue.Index}} {{.DependentIssue.Title}} @@ -375,7 +375,7 @@ {{if .Review}}{{svg (printf "octicon-%s" .Review.Type.Icon)}}{{end}} - + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} {{if eq $reviewType 1}} {{ctx.Locale.Tr "repo.issues.review.approve" $createdStr}} @@ -394,20 +394,20 @@ {{if or .Content .Attachments}}
-
+
{{if gt .Poster.ID 0}} {{ctx.AvatarUtils.Avatar .Poster 24}} {{end}} - + {{if .OriginalAuthor}} {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{.OriginalAuthor}} - {{if $.Repository.OriginalURL}} + {{if $.Repository.OriginalURL}} ({{ctx.Locale.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname}}){{end}} {{else}} {{template "shared/user/authorlink" .Poster}} @@ -461,12 +461,12 @@ {{svg "octicon-lock"}} {{template "shared/user/avatarlink" dict "user" .Poster}} {{if .Content}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr "repo.issues.lock_with_reason" .Content $createdStr}} {{else}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr "repo.issues.lock_no_reason" $createdStr}} @@ -476,7 +476,7 @@
{{svg "octicon-key"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr "repo.issues.unlock_comment" $createdStr}} @@ -487,7 +487,7 @@ {{if not .OriginalAuthor}} {{template "shared/user/avatarlink" dict "user" .Poster}} {{end}} - + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} {{ctx.Locale.Tr "repo.pulls.change_target_branch_at" .OldRef .NewRef $createdStr}} @@ -496,7 +496,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{ctx.Locale.Tr "repo.issues.del_time_history" $createdStr}} @@ -505,9 +505,9 @@ {{svg "octicon-clock"}} {{if .RenderedContent}} {{/* compatibility with time comments made before v1.21 */}} - {{.RenderedContent}} + {{.RenderedContent}} {{else}} - - {{.Content|Sec2Hour}} + - {{.Content|Sec2Hour}} {{end}}
@@ -515,7 +515,7 @@
{{svg "octicon-eye"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if (gt .AssigneeID 0)}} {{if .RemovedAssignee}} @@ -548,7 +548,7 @@ {{end}}
{{svg "octicon-repo-push"}} - + {{template "shared/user/authorlink" .Poster}} {{if .IsForcePush}} {{ctx.Locale.Tr "repo.issues.force_push_codes" $.Issue.PullRequest.HeadBranch (ShortSha .OldCommit) ($.Issue.Repo.CommitLink .OldCommit) (ShortSha .NewCommit) ($.Issue.Repo.CommitLink .NewCommit) $createdStr}} @@ -557,9 +557,7 @@ {{end}} {{if and .IsForcePush $.Issue.PullRequest.BaseRepo.Name}} - - {{ctx.Locale.Tr "repo.issues.force_push_compare"}} - + {{ctx.Locale.Tr "repo.issues.force_push_compare"}} {{end}}
{{if not .IsForcePush}} @@ -569,7 +567,7 @@
{{svg "octicon-project"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$oldProjectDisplayHtml := "Unknown Project"}} {{if .OldProject}} @@ -601,7 +599,7 @@
{{svg "octicon-project"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$newProjectDisplay := .CommentMetaData.ProjectTitle}} {{if .Project}} @@ -616,10 +614,10 @@
- + {{ctx.AvatarUtils.Avatar .Poster 40}} {{svg "octicon-x" 16}} - + {{template "shared/user/authorlink" .Poster}} {{$reviewerName := ""}} {{if .Review}} @@ -635,13 +633,13 @@ {{if .Content}}
-
+
{{if gt .Poster.ID 0}} {{ctx.AvatarUtils.Avatar .Poster 24}} {{end}} - + {{ctx.Locale.Tr "action.review_dismissed_reason"}}
@@ -662,7 +660,7 @@
{{svg "octicon-git-branch"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if and .OldRef .NewRef}} {{ctx.Locale.Tr "repo.issues.change_ref_at" .OldRef .NewRef $createdStr}} @@ -676,7 +674,7 @@ {{else if or (eq .Type 34) (eq .Type 35)}}
{{svg "octicon-git-merge" 16}} - + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} {{if eq .Type 34}}{{ctx.Locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr}} {{else}}{{ctx.Locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr}}{{end}} @@ -686,7 +684,7 @@
{{svg "octicon-pin" 16}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if eq .Type 36}}{{ctx.Locale.Tr "repo.issues.pin_comment" $createdStr}} {{else}}{{ctx.Locale.Tr "repo.issues.unpin_comment" $createdStr}}{{end}} @@ -696,7 +694,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" dict "user" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$timeStr := .Content|TimeEstimateString}} {{if $timeStr}} diff --git a/templates/repo/issue/view_content/pull_merge_box.tmpl b/templates/repo/issue/view_content/pull_merge_box.tmpl index 46bcd3b8b3..113bfb732e 100644 --- a/templates/repo/issue/view_content/pull_merge_box.tmpl +++ b/templates/repo/issue/view_content/pull_merge_box.tmpl @@ -38,7 +38,7 @@
{{end}} {{$showGeneralMergeForm := false}} -
+
{{if .Issue.PullRequest.HasMerged}} {{if .IsPullBranchDeletable}}
diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index b8f28dfd9b..103fa5de53 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -12,7 +12,7 @@
{{$canEditIssueTitle := and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
-

+

{{ctx.RenderUtils.RenderIssueTitle .Issue.Title $.Repository}} #{{.Issue.Index}}

diff --git a/templates/shared/user/avatarlink.tmpl b/templates/shared/user/avatarlink.tmpl index 5e3ed7a68c..5d56fef430 100644 --- a/templates/shared/user/avatarlink.tmpl +++ b/templates/shared/user/avatarlink.tmpl @@ -1 +1 @@ -{{ctx.AvatarUtils.Avatar .user}} +{{ctx.AvatarUtils.Avatar .user}} diff --git a/tests/integration/pull_create_test.go b/tests/integration/pull_create_test.go index 179c84e673..44ef501961 100644 --- a/tests/integration/pull_create_test.go +++ b/tests/integration/pull_create_test.go @@ -163,10 +163,10 @@ func TestPullCreate_TitleEscape(t *testing.T) { req = NewRequest(t, "GET", url) resp = session.MakeRequest(t, req, http.StatusOK) htmlDoc = NewHTMLParser(t, resp.Body) - titleHTML, err := htmlDoc.doc.Find(".comment-list .timeline-item.event .text b").First().Html() + titleHTML, err := htmlDoc.doc.Find(".comment-list .timeline-item.event .comment-text-line b").First().Html() assert.NoError(t, err) assert.Equal(t, "<i>XSS PR</i>", titleHTML) - titleHTML, err = htmlDoc.doc.Find(".comment-list .timeline-item.event .text b").Next().Html() + titleHTML, err = htmlDoc.doc.Find(".comment-list .timeline-item.event .comment-text-line b").Next().Html() assert.NoError(t, err) assert.Equal(t, "<u>XSS PR</u>", titleHTML) }) diff --git a/tests/integration/timetracking_test.go b/tests/integration/timetracking_test.go index 4e8109be96..ebe084ccdc 100644 --- a/tests/integration/timetracking_test.go +++ b/tests/integration/timetracking_test.go @@ -56,7 +56,7 @@ func testViewTimetrackingControls(t *testing.T, session *TestSession, user, repo resp = session.MakeRequest(t, req, http.StatusOK) htmlDoc = NewHTMLParser(t, resp.Body) - events := htmlDoc.doc.Find(".event > span.text") + events := htmlDoc.doc.Find(".event > .comment-text-line") assert.Contains(t, events.Last().Text(), "started working") AssertHTMLElement(t, htmlDoc, ".issue-stop-time", true) @@ -74,7 +74,7 @@ func testViewTimetrackingControls(t *testing.T, session *TestSession, user, repo resp = session.MakeRequest(t, req, http.StatusOK) htmlDoc = NewHTMLParser(t, resp.Body) - events = htmlDoc.doc.Find(".event > span.text") + events = htmlDoc.doc.Find(".event > .comment-text-line") assert.Contains(t, events.Last().Text(), "worked for ") } else { session.MakeRequest(t, reqStart, http.StatusNotFound) diff --git a/web_src/css/base.css b/web_src/css/base.css index b415a70cb8..3b819e91bc 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -38,7 +38,7 @@ --font-size-label: 12px; /* font size of individual labels */ --gap-inline: 0.25rem; /* gap for inline texts and elements, for example: the spaces for sentence with labels, button text, etc */ - --gap-block: 0.25rem; /* gap for element blocks, for example: spaces between buttons, menu image & title, header icon & title etc */ + --gap-block: 0.5rem; /* gap for element blocks, for example: spaces between buttons, menu image & title, header icon & title etc */ } @media (min-width: 768px) and (max-width: 1200px) { @@ -1069,7 +1069,9 @@ table th[data-sortt-desc] .svg { .btn, .ui.ui.button, .ui.ui.dropdown, -.flex-text-inline { +.flex-text-inline, +.flex-text-inline > a, +.flex-text-inline > span { display: inline-flex; align-items: center; gap: var(--gap-inline); diff --git a/web_src/css/modules/comment.css b/web_src/css/modules/comment.css index 9947b15b9a..1e235a248f 100644 --- a/web_src/css/modules/comment.css +++ b/web_src/css/modules/comment.css @@ -56,10 +56,6 @@ min-width: 0; } -.ui.comments .comment > .avatar ~ .content { - margin-left: 12px; -} - .ui.comments .comment .author { font-size: 1em; font-weight: var(--font-weight-medium); diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 8729212f10..0b50d1d1d7 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -238,8 +238,8 @@ td .commit-summary { border-radius: var(--border-radius); } -.repository.file.editor .commit-form-wrapper .commit-form::before, -.repository.file.editor .commit-form-wrapper .commit-form::after { +.avatar-content-left-arrow::before, +.avatar-content-left-arrow::after { right: 100%; top: 20px; border: solid transparent; @@ -250,18 +250,24 @@ td .commit-summary { pointer-events: none; } -.repository.file.editor .commit-form-wrapper .commit-form::before { +.avatar-content-left-arrow::before { border-right-color: var(--color-secondary); border-width: 9px; margin-top: -9px; } -.repository.file.editor .commit-form-wrapper .commit-form::after { +.avatar-content-left-arrow::after { border-right-color: var(--color-box-body); border-width: 8px; margin-top: -8px; } +@media (max-width: 767.98px) { + .avatar-content-left-arrow::before, + .avatar-content-left-arrow::after { + display: none; + } +} .repository.file.editor .commit-form-wrapper .commit-form .quick-pull-choice .branch-name { display: inline-block; padding: 2px 4px; @@ -294,30 +300,6 @@ td .commit-summary { min-width: 100px; } -.repository.new.issue .comment.form .content::before, -.repository.new.issue .comment.form .content::after { - right: 100%; - top: 20px; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} - -.repository.new.issue .comment.form .content::before { - border-right-color: var(--color-secondary); - border-width: 9px; - margin-top: -9px; -} - -.repository.new.issue .comment.form .content::after { - border-right-color: var(--color-box-body); - border-width: 8px; - margin-top: -8px; -} - .repository.new.issue .comment.form .content .markup { font-size: 14px; } @@ -326,21 +308,6 @@ td .commit-summary { display: inline-block; } -@media (max-width: 767.98px) { - .comment.form .issue-content-left .avatar { - display: none; - } - .comment.form .issue-content-left .content { - margin-left: 0 !important; - } - .comment.form .issue-content-left .content::before, - .comment.form .issue-content-left .content::after, - .comment.form .content .form::before, - .comment.form .content .form::after { - display: none; - } -} - /* issue title & meta & edit */ .issue-title-header { width: 100%; @@ -365,7 +332,6 @@ td .commit-summary { .repository.view.issue .issue-title { display: flex; - align-items: center; gap: 0.5em; margin-bottom: 8px; min-height: 40px; /* avoid layout shift on edit */ @@ -379,6 +345,15 @@ td .commit-summary { line-height: 40px; margin: 0; padding-right: 0.25rem; + overflow-wrap: anywhere; +} + +.repository.view.issue .issue-title#issue-title-display .issue-title-buttons { + margin-top: 4px; /* the title's height is 40px, fine tune to align the buttons */ +} + +.repository.view.issue .issue-title#issue-title-editor { + padding-top: 4px; } @media (max-width: 767.98px) { @@ -535,6 +510,7 @@ td .commit-summary { background-color: var(--color-timeline); border-radius: var(--border-radius-full); display: flex; + flex-shrink: 0; float: left; margin-left: -33px; margin-right: 8px; @@ -562,9 +538,18 @@ td .commit-summary { margin-left: -16px; } -.repository.view.issue .comment-list .timeline-item.event > .text { +.repository.view.issue .comment-list .timeline-item .comment-text-line { line-height: 32px; vertical-align: middle; + color: var(--color-text-light); +} + +.repository.view.issue .comment-list .timeline-item .comment-text-line a { + color: inherit; +} + +.repository.view.issue .comment-list .timeline-item .avatar-with-link + .comment-text-line { + margin-left: 0.25em; } .repository.view.issue .comment-list .timeline-item.commits-list { @@ -578,15 +563,11 @@ td .commit-summary { margin-top: 4px; } -.repository.view.issue .comment-list .timeline-item .comparebox { - line-height: 32px; +.repository.view.issue .comment-list .timeline-item .comment-text-label { vertical-align: middle; -} - -.repository.view.issue .comment-list .timeline-item .comparebox .compare.label { - font-size: 1rem; - margin: 0; border: 1px solid var(--color-light-border); + height: 26px; + margin: 4px 0; /* because this label is beside the comment line, which has "line-height: 34px" */ } @media (max-width: 767.98px) { @@ -650,30 +631,6 @@ td .commit-summary { width: calc(100% + 2rem); } -.repository.view.issue .comment-list .comment .merge-section.no-header::before, -.repository.view.issue .comment-list .comment .merge-section.no-header::after { - right: 100%; - top: 20px; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} - -.repository.view.issue .comment-list .comment .merge-section.no-header::before { - border-right-color: var(--color-secondary); - border-width: 9px; - margin-top: -9px; -} - -.repository.view.issue .comment-list .comment .merge-section.no-header::after { - border-right-color: var(--color-box-body); - border-width: 8px; - margin-top: -8px; -} - .merge-section-info code { border: 1px solid var(--color-light-border); border-radius: var(--border-radius); @@ -717,19 +674,10 @@ td .commit-summary { padding: 0 !important; } -.repository.view.issue .comment-list .code-comment .comment-header::after, -.repository.view.issue .comment-list .code-comment .comment-header::before { - display: none; -} - .repository.view.issue .comment-list .code-comment .comment-content { margin-left: 24px; } -.repository.view.issue .comment-list .comment > .avatar { - margin-top: 6px; -} - .repository.view.issue .comment-list .comment-code-cloud button.comment-form-reply { margin: 0; } @@ -761,30 +709,6 @@ td .commit-summary { clear: none; } -.repository .comment.form .content .segment::before, -.repository .comment.form .content .segment::after { - right: 100%; - top: 20px; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} - -.repository .comment.form .content .segment::before { - border-right-color: var(--color-secondary); - border-width: 9px; - margin-top: -9px; -} - -.repository .comment.form .content .segment::after { - border-right-color: var(--color-box-body); - border-width: 8px; - margin-top: -8px; -} - .repository.new.milestone textarea { height: 200px; } @@ -807,30 +731,6 @@ td .commit-summary { text-align: center; } -.repository.compare.pull .comment.form .content::before, -.repository.compare.pull .comment.form .content::after { - right: 100%; - top: 20px; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} - -.repository.compare.pull .comment.form .content::before { - border-right-color: var(--color-secondary); - border-width: 9px; - margin-top: -9px; -} - -.repository.compare.pull .comment.form .content::after { - border-right-color: var(--color-box-body); - border-width: 8px; - margin-top: -8px; -} - .repository.compare.pull .markup { font-size: 14px; } @@ -1431,30 +1331,6 @@ td .commit-summary { gap: 0.25em; } -.comment-header::before, -.comment-header::after { - right: 100%; - top: 20px; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} - -.comment-header::before { - border-right-color: var(--color-secondary); - border-width: 9px; - margin-top: -9px; -} - -.comment-header::after { - border-right-color: var(--color-box-header); - border-width: 8px; - margin-top: -8px; -} - .comment-header.arrow-top::before, .comment-header.arrow-top::after { transform: rotate(90deg); @@ -1629,7 +1505,7 @@ tbody.commit-list { overflow-wrap: anywhere; } -.content-history-detail-dialog .header .avatar { +.content-history-detail-dialog .header .ui.avatar { position: relative; top: -2px; } @@ -1978,10 +1854,6 @@ tbody.commit-list { .repository.view.issue .comment-list .timeline .comment-header { padding-left: 4px; } - .repository.view.issue .comment-list .timeline .comment-header::before, - .repository.view.issue .comment-list .timeline .comment-header::after { - content: unset; - } /* Don't show the general avatar, we show the inline avatar on mobile. * And don't show the role labels, there's no place for that. */ .repository.view.issue .comment-list .timeline .timeline-avatar,