Skip to content

Commit 30a7838

Browse files
Show outdated comments in files changed tab (#24936) (#25428)
Backport #24936 If enabled show a clickable label in the comment. A click on the label opens the Conversation tab with the comment focussed - there you're able to view the old diff (or original diff the comment was created on). **Screenshots** ![image](https://github.com/go-gitea/gitea/assets/1135157/63ab9571-a9ee-4900-9f02-94ab0095f9e7) ![image](https://github.com/go-gitea/gitea/assets/1135157/78f7c225-8d76-46f5-acfd-9b8aab988a6c) When resolved and outdated: ![image](https://github.com/go-gitea/gitea/assets/1135157/6ece9ebd-c792-4aa5-9c35-628694e9d093) Option to enable/disable this (stored in user settings - default is disabled): ![image](https://github.com/go-gitea/gitea/assets/1135157/ed99dfe4-76dc-4c12-bd96-e7e62da50ab5) ![image](https://github.com/go-gitea/gitea/assets/1135157/e837a052-e92e-4a28-906d-9db5bacf93a6) fixes #24913 Co-authored-by: silverwind <me@silverwind.io>
1 parent cb3173a commit 30a7838

File tree

18 files changed

+115
-38
lines changed

18 files changed

+115
-38
lines changed

models/issues/comment_code.go

+10-8
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import (
1818
type CodeComments map[string]map[int64][]*Comment
1919

2020
// FetchCodeComments will return a 2d-map: ["Path"]["Line"] = Comments at line
21-
func FetchCodeComments(ctx context.Context, issue *Issue, currentUser *user_model.User) (CodeComments, error) {
22-
return fetchCodeCommentsByReview(ctx, issue, currentUser, nil)
21+
func FetchCodeComments(ctx context.Context, issue *Issue, currentUser *user_model.User, showOutdatedComments bool) (CodeComments, error) {
22+
return fetchCodeCommentsByReview(ctx, issue, currentUser, nil, showOutdatedComments)
2323
}
2424

25-
func fetchCodeCommentsByReview(ctx context.Context, issue *Issue, currentUser *user_model.User, review *Review) (CodeComments, error) {
25+
func fetchCodeCommentsByReview(ctx context.Context, issue *Issue, currentUser *user_model.User, review *Review, showOutdatedComments bool) (CodeComments, error) {
2626
pathToLineToComment := make(CodeComments)
2727
if review == nil {
2828
review = &Review{ID: 0}
@@ -33,7 +33,7 @@ func fetchCodeCommentsByReview(ctx context.Context, issue *Issue, currentUser *u
3333
ReviewID: review.ID,
3434
}
3535

36-
comments, err := findCodeComments(ctx, opts, issue, currentUser, review)
36+
comments, err := findCodeComments(ctx, opts, issue, currentUser, review, showOutdatedComments)
3737
if err != nil {
3838
return nil, err
3939
}
@@ -47,15 +47,17 @@ func fetchCodeCommentsByReview(ctx context.Context, issue *Issue, currentUser *u
4747
return pathToLineToComment, nil
4848
}
4949

50-
func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issue, currentUser *user_model.User, review *Review) ([]*Comment, error) {
50+
func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issue, currentUser *user_model.User, review *Review, showOutdatedComments bool) ([]*Comment, error) {
5151
var comments CommentList
5252
if review == nil {
5353
review = &Review{ID: 0}
5454
}
5555
conds := opts.ToConds()
56-
if review.ID == 0 {
56+
57+
if !showOutdatedComments && review.ID == 0 {
5758
conds = conds.And(builder.Eq{"invalidated": false})
5859
}
60+
5961
e := db.GetEngine(ctx)
6062
if err := e.Where(conds).
6163
Asc("comment.created_unix").
@@ -118,12 +120,12 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu
118120
}
119121

120122
// FetchCodeCommentsByLine fetches the code comments for a given treePath and line number
121-
func FetchCodeCommentsByLine(ctx context.Context, issue *Issue, currentUser *user_model.User, treePath string, line int64) ([]*Comment, error) {
123+
func FetchCodeCommentsByLine(ctx context.Context, issue *Issue, currentUser *user_model.User, treePath string, line int64, showOutdatedComments bool) ([]*Comment, error) {
122124
opts := FindCommentsOptions{
123125
Type: CommentTypeCode,
124126
IssueID: issue.ID,
125127
TreePath: treePath,
126128
Line: line,
127129
}
128-
return findCodeComments(ctx, opts, issue, currentUser, nil)
130+
return findCodeComments(ctx, opts, issue, currentUser, nil, showOutdatedComments)
129131
}

models/issues/comment_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ func TestFetchCodeComments(t *testing.T) {
5050

5151
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 2})
5252
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1})
53-
res, err := issues_model.FetchCodeComments(db.DefaultContext, issue, user)
53+
res, err := issues_model.FetchCodeComments(db.DefaultContext, issue, user, false)
5454
assert.NoError(t, err)
5555
assert.Contains(t, res, "README.md")
5656
assert.Contains(t, res["README.md"], int64(4))
5757
assert.Len(t, res["README.md"][4], 1)
5858
assert.Equal(t, int64(4), res["README.md"][4][0].ID)
5959

6060
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
61-
res, err = issues_model.FetchCodeComments(db.DefaultContext, issue, user2)
61+
res, err = issues_model.FetchCodeComments(db.DefaultContext, issue, user2, false)
6262
assert.NoError(t, err)
6363
assert.Len(t, res, 1)
6464
}

models/issues/review.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func (r *Review) LoadCodeComments(ctx context.Context) (err error) {
141141
if err = r.loadIssue(ctx); err != nil {
142142
return
143143
}
144-
r.CodeComments, err = fetchCodeCommentsByReview(ctx, r.Issue, nil, r)
144+
r.CodeComments, err = fetchCodeCommentsByReview(ctx, r.Issue, nil, r, false)
145145
return err
146146
}
147147

models/user/setting_keys.go

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const (
88
SettingsKeyHiddenCommentTypes = "issue.hidden_comment_types"
99
// SettingsKeyDiffWhitespaceBehavior is the setting key for whitespace behavior of diff
1010
SettingsKeyDiffWhitespaceBehavior = "diff.whitespace_behaviour"
11+
// SettingsKeyShowOutdatedComments is the setting key wether or not to show outdated comments in PRs
12+
SettingsKeyShowOutdatedComments = "comment_code.show_outdated"
1113
// UserActivityPubPrivPem is user's private key
1214
UserActivityPubPrivPem = "activitypub.priv_pem"
1315
// UserActivityPubPubPem is user's public key

options/locale/locale_en-US.ini

+3
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,9 @@ issues.review.pending.tooltip = This comment is not currently visible to other u
16061606
issues.review.review = Review
16071607
issues.review.reviewers = Reviewers
16081608
issues.review.outdated = Outdated
1609+
issues.review.outdated_description = Content has changed since this comment was made
1610+
issues.review.option.show_outdated_comments = Show outdated comments
1611+
issues.review.option.hide_outdated_comments = Hide outdated comments
16091612
issues.review.show_outdated = Show outdated
16101613
issues.review.hide_outdated = Hide outdated
16111614
issues.review.show_resolved = Show resolved

routers/web/repo/middlewares.go

+25
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package repo
55

66
import (
77
"fmt"
8+
"strconv"
89

910
system_model "code.gitea.io/gitea/models/system"
1011
user_model "code.gitea.io/gitea/models/user"
@@ -88,3 +89,27 @@ func SetWhitespaceBehavior(ctx *context.Context) {
8889
ctx.Data["WhitespaceBehavior"] = whitespaceBehavior
8990
}
9091
}
92+
93+
// SetShowOutdatedComments set the show outdated comments option as context variable
94+
func SetShowOutdatedComments(ctx *context.Context) {
95+
showOutdatedCommentsValue := ctx.FormString("show-outdated")
96+
// var showOutdatedCommentsValue string
97+
98+
if showOutdatedCommentsValue != "true" && showOutdatedCommentsValue != "false" {
99+
// invalid or no value for this form string -> use default or stored user setting
100+
if ctx.IsSigned {
101+
showOutdatedCommentsValue, _ = user_model.GetUserSetting(ctx.Doer.ID, user_model.SettingsKeyShowOutdatedComments, "false")
102+
} else {
103+
// not logged in user -> use the default value
104+
showOutdatedCommentsValue = "false"
105+
}
106+
} else {
107+
// valid value -> update user setting if user is logged in
108+
if ctx.IsSigned {
109+
_ = user_model.SetUserSetting(ctx.Doer.ID, user_model.SettingsKeyShowOutdatedComments, showOutdatedCommentsValue)
110+
}
111+
}
112+
113+
showOutdatedComments, _ := strconv.ParseBool(showOutdatedCommentsValue)
114+
ctx.Data["ShowOutdatedComments"] = showOutdatedComments
115+
}

routers/web/repo/pull.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ func ViewPullFiles(ctx *context.Context) {
762762
"numberOfViewedFiles": diff.NumViewedFiles,
763763
}
764764

765-
if err = diff.LoadComments(ctx, issue, ctx.Doer); err != nil {
765+
if err = diff.LoadComments(ctx, issue, ctx.Doer, ctx.Data["ShowOutdatedComments"].(bool)); err != nil {
766766
ctx.ServerError("LoadComments", err)
767767
return
768768
}

routers/web/repo/pull_review.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func UpdateResolveConversation(ctx *context.Context) {
159159
}
160160

161161
func renderConversation(ctx *context.Context, comment *issues_model.Comment) {
162-
comments, err := issues_model.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.Doer, comment.TreePath, comment.Line)
162+
comments, err := issues_model.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.Doer, comment.TreePath, comment.Line, ctx.Data["ShowOutdatedComments"].(bool))
163163
if err != nil {
164164
ctx.ServerError("FetchCodeCommentsByLine", err)
165165
return

routers/web/web.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ func registerRoutes(m *web.Route) {
10291029
m.Post("/request_review", reqRepoIssuesOrPullsReader, repo.UpdatePullReviewRequest)
10301030
m.Post("/dismiss_review", reqRepoAdmin, web.Bind(forms.DismissReviewForm{}), repo.DismissReview)
10311031
m.Post("/status", reqRepoIssuesOrPullsWriter, repo.UpdateIssueStatus)
1032-
m.Post("/resolve_conversation", reqRepoIssuesOrPullsReader, repo.UpdateResolveConversation)
1032+
m.Post("/resolve_conversation", reqRepoIssuesOrPullsReader, repo.SetShowOutdatedComments, repo.UpdateResolveConversation)
10331033
m.Post("/attachments", repo.UploadIssueAttachment)
10341034
m.Post("/attachments/remove", repo.DeleteAttachment)
10351035
m.Delete("/unpin/{index}", reqRepoAdmin, repo.IssueUnpin)
@@ -1277,10 +1277,10 @@ func registerRoutes(m *web.Route) {
12771277
m.Post("/set_allow_maintainer_edit", web.Bind(forms.UpdateAllowEditsForm{}), repo.SetAllowEdits)
12781278
m.Post("/cleanup", context.RepoMustNotBeArchived(), context.RepoRef(), repo.CleanUpPullRequest)
12791279
m.Group("/files", func() {
1280-
m.Get("", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.ViewPullFiles)
1280+
m.Get("", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFiles)
12811281
m.Group("/reviews", func() {
12821282
m.Get("/new_comment", repo.RenderNewCodeCommentForm)
1283-
m.Post("/comments", web.Bind(forms.CodeCommentForm{}), repo.CreateCodeComment)
1283+
m.Post("/comments", web.Bind(forms.CodeCommentForm{}), repo.SetShowOutdatedComments, repo.CreateCodeComment)
12841284
m.Post("/submit", web.Bind(forms.SubmitReviewForm{}), repo.SubmitReview)
12851285
}, context.RepoMustNotBeArchived())
12861286
})

services/gitdiff/gitdiff.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,8 @@ type Diff struct {
450450
}
451451

452452
// LoadComments loads comments into each line
453-
func (diff *Diff) LoadComments(ctx context.Context, issue *issues_model.Issue, currentUser *user_model.User) error {
454-
allComments, err := issues_model.FetchCodeComments(ctx, issue, currentUser)
453+
func (diff *Diff) LoadComments(ctx context.Context, issue *issues_model.Issue, currentUser *user_model.User, showOutdatedComments bool) error {
454+
allComments, err := issues_model.FetchCodeComments(ctx, issue, currentUser, showOutdatedComments)
455455
if err != nil {
456456
return err
457457
}

services/gitdiff/gitdiff_test.go

+12-2
Original file line numberDiff line numberDiff line change
@@ -594,16 +594,26 @@ func setupDefaultDiff() *Diff {
594594
}
595595
}
596596

597-
func TestDiff_LoadComments(t *testing.T) {
597+
func TestDiff_LoadCommentsNoOutdated(t *testing.T) {
598598
assert.NoError(t, unittest.PrepareTestDatabase())
599599

600600
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 2})
601601
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1})
602602
diff := setupDefaultDiff()
603-
assert.NoError(t, diff.LoadComments(db.DefaultContext, issue, user))
603+
assert.NoError(t, diff.LoadComments(db.DefaultContext, issue, user, false))
604604
assert.Len(t, diff.Files[0].Sections[0].Lines[0].Comments, 2)
605605
}
606606

607+
func TestDiff_LoadCommentsWithOutdated(t *testing.T) {
608+
assert.NoError(t, unittest.PrepareTestDatabase())
609+
610+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 2})
611+
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1})
612+
diff := setupDefaultDiff()
613+
assert.NoError(t, diff.LoadComments(db.DefaultContext, issue, user, true))
614+
assert.Len(t, diff.Files[0].Sections[0].Lines[0].Comments, 3)
615+
}
616+
607617
func TestDiffLine_CanComment(t *testing.T) {
608618
assert.False(t, (&DiffLine{Type: DiffLineSection}).CanComment())
609619
assert.False(t, (&DiffLine{Type: DiffLineAdd, Comments: []*issues_model.Comment{{Content: "bla"}}}).CanComment())

templates/repo/diff/comments.tmpl

+6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
{{end}}
3232
</div>
3333
<div class="comment-header-right actions gt-df gt-ac">
34+
{{if .Invalidated}}
35+
{{$referenceUrl := printf "%s#%s" $.root.Issue.Link .HashTag}}
36+
<a href="{{AppSubUrl}}{{$referenceUrl}}" class="ui label basic small" data-tooltip-content="{{$.root.locale.Tr "repo.issues.review.outdated_description"}}">
37+
{{$.root.locale.Tr "repo.issues.review.outdated"}}
38+
</a>
39+
{{end}}
3440
{{if and .Review}}
3541
{{if eq .Review.Type 0}}
3642
<div class="ui label basic small yellow pending-label" data-tooltip-content="{{$.root.locale.Tr "repo.issues.review.pending.tooltip" ($.root.locale.Tr "repo.diff.review") ($.root.locale.Tr "repo.diff.review.approve") ($.root.locale.Tr "repo.diff.review.comment") ($.root.locale.Tr "repo.diff.review.reject")}}">

templates/repo/diff/conversation.tmpl

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
{{$resolved := (index .comments 0).IsResolved}}
2+
{{$invalid := (index .comments 0).Invalidated}}
23
{{$resolveDoer := (index .comments 0).ResolveDoer}}
34
{{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}}
5+
{{$referenceUrl := printf "%s#%s" $.Issue.Link (index .comments 0).HashTag}}
46
<div class="conversation-holder" data-path="{{(index .comments 0).TreePath}}" data-side="{{if lt (index .comments 0).Line 0}}left{{else}}right{{end}}" data-idx="{{(index .comments 0).UnsignedLine}}">
57
{{if $resolved}}
68
<div class="ui attached header resolved-placeholder gt-df gt-ac gt-sb">
7-
<div class="ui grey text">
9+
<div class="ui grey text gt-df gt-ac gt-fw gt-gap-2">
810
{{svg "octicon-check" 16 "icon gt-mr-2"}}
911
<b>{{$resolveDoer.Name}}</b> {{$.locale.Tr "repo.issues.review.resolved_by"}}
12+
{{if $invalid}}
13+
<!--
14+
We only handle the case $resolved=true and $invalid=true in this template because if the comment is not resolved it has the outdated label in the comments area (not the header above).
15+
The case $resolved=false and $invalid=true is handled in repo/diff/comments.tmpl
16+
-->
17+
<a href="{{AppSubUrl}}{{$referenceUrl}}" class="ui label basic small gt-ml-3" data-tooltip-content="{{$.locale.Tr "repo.issues.review.outdated_description"}}">
18+
{{$.locale.Tr "repo.issues.review.outdated"}}
19+
</a>
20+
{{end}}
1021
</div>
11-
<div>
22+
<div class="gt-df gt-ac gt-gap-3">
1223
<button id="show-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="ui tiny labeled button show-outdated gt-df gt-ac">
1324
{{svg "octicon-unfold" 16 "gt-mr-3"}}
1425
{{$.locale.Tr "repo.issues.review.show_resolved"}}

templates/repo/diff/options_dropdown.tmpl

+15
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,20 @@
1414
{{end}}
1515
<a id="expand-files-btn" class="item">{{.locale.Tr "repo.pulls.expand_files"}}</a>
1616
<a id="collapse-files-btn"class="item">{{.locale.Tr "repo.pulls.collapse_files"}}</a>
17+
{{if .Issue.Index}}
18+
{{if .ShowOutdatedComments}}
19+
<a class="item" href="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated=false">
20+
<label class="gt-pointer-events-none">
21+
{{.locale.Tr "repo.issues.review.option.hide_outdated_comments"}}
22+
</label>
23+
</a>
24+
{{else}}
25+
<a class="item" href="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated=true">
26+
<label class="gt-pointer-events-none">
27+
{{.locale.Tr "repo.issues.review.option.show_outdated_comments"}}
28+
</label>
29+
</a>
30+
{{end}}
31+
{{end}}
1732
</div>
1833
</div>
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
<div class="ui dropdown tiny basic button" data-tooltip-content="{{.locale.Tr "repo.diff.whitespace_button"}}">
22
{{svg "gitea-whitespace"}}
33
<div class="menu">
4-
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=show-all">
4+
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=show-all&show-outdated={{$.ShowOutdatedComments}}">
55
<label class="gt-pointer-events-none">
66
<input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "show-all"}} checked{{end}}>
77
{{.locale.Tr "repo.diff.whitespace_show_everything"}}
88
</label>
99
</a>
10-
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-all">
10+
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-all&show-outdated={{$.ShowOutdatedComments}}">
1111
<label class="gt-pointer-events-none">
1212
<input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-all"}} checked{{end}}>
1313
{{.locale.Tr "repo.diff.whitespace_ignore_all_whitespace"}}
1414
<label>
1515
</a>
16-
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-change">
16+
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-change&show-outdated={{$.ShowOutdatedComments}}">
1717
<label class="gt-pointer-events-none">
1818
<input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-change"}} checked{{end}}>
1919
{{.locale.Tr "repo.diff.whitespace_ignore_amount_changes"}}
2020
</label>
2121
</a>
22-
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-eol">
22+
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-eol&show-outdated={{$.ShowOutdatedComments}}">
2323
<label class="gt-pointer-events-none">
2424
<input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-eol"}} checked{{end}}>
2525
{{.locale.Tr "repo.diff.whitespace_ignore_at_eol"}}
2626
</label>
2727
</a>
2828
</div>
2929
</div>
30-
<a class="ui tiny basic button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}&whitespace={{$.WhitespaceBehavior}}" data-tooltip-content="{{if .IsSplitStyle}}{{.locale.Tr "repo.diff.show_unified_view"}}{{else}}{{.locale.Tr "repo.diff.show_split_view"}}{{end}}">{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}}</a>
30+
<a class="ui tiny basic button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-tooltip-content="{{if .IsSplitStyle}}{{.locale.Tr "repo.diff.show_unified_view"}}{{else}}{{.locale.Tr "repo.diff.show_split_view"}}{{end}}">{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}}</a>

templates/repo/issue/view_content/comments.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@
488488
<div class="gt-df gt-ac">
489489
<a href="{{(index $comms 0).CodeCommentLink}}" class="file-comment gt-ml-3 gt-word-break">{{$filename}}</a>
490490
{{if $invalid}}
491-
<span class="ui label basic small gt-ml-3">
491+
<span class="ui label basic small gt-ml-3" data-tooltip-content="{{$.locale.Tr "repo.issues.review.outdated_description"}}">
492492
{{$.locale.Tr "repo.issues.review.outdated"}}
493493
</span>
494494
{{end}}

web_src/css/repo.css

+12-9
Original file line numberDiff line numberDiff line change
@@ -1702,6 +1702,10 @@
17021702
.repository .diff-box .resolved-placeholder {
17031703
display: flex;
17041704
align-items: center;
1705+
font-size: 14px !important;
1706+
height: 36px;
1707+
padding-top: 0;
1708+
padding-bottom: 0;
17051709
}
17061710

17071711
.repository .diff-box .resolved-placeholder .button {
@@ -1728,10 +1732,6 @@
17281732
text-align: center;
17291733
}
17301734

1731-
.repository .diff-file-box .code-diff {
1732-
font-size: 12px;
1733-
}
1734-
17351735
.repository .diff-file-box .code-diff td {
17361736
padding: 0 0 0 10px !important;
17371737
border-top: 0;
@@ -2500,14 +2500,17 @@
25002500
left: 7px;
25012501
}
25022502

2503-
.comment-header .actions a {
2504-
margin-right: 0 !important;
2503+
.comment-header .actions a:not(.label) {
25052504
padding: 0.5rem !important;
25062505
}
25072506

2508-
.comment-header-left > * + *,
2509-
.comment-header-right > * + * {
2510-
margin-left: 0.25rem;
2507+
.comment-header .actions .label {
2508+
margin: 0 !important;
2509+
}
2510+
2511+
.comment-header-left,
2512+
.comment-header-right {
2513+
gap: 4px;
25112514
}
25122515

25132516
.comment-body {

web_src/css/review.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
}
133133

134134
.comment-code-cloud .attached.header {
135-
padding: 0.1rem 1rem;
135+
padding: 1px 8px 1px 12px;
136136
}
137137

138138
.comment-code-cloud .attached.header .text {

0 commit comments

Comments
 (0)