Skip to content

Commit ea285c2

Browse files
chore: fix the extra comment icon at the end and change the icon pointer
1 parent 7d0c8e3 commit ea285c2

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

routers/web/repo/compare.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ func ExcerptBlob(ctx *context.Context) {
957957
}
958958
lineCommits := allComments[filePath]
959959
for _, line := range section.Lines {
960-
if line.SectionInfo != nil {
960+
if line.SectionInfo != nil && line.SectionInfo.RightHunkSize > 0 {
961961
start := int64(line.SectionInfo.LastRightIdx + 1)
962962
end := int64(line.SectionInfo.RightIdx - 1)
963963
for start <= end {

services/gitdiff/gitdiff.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ func (diff *Diff) LoadComments(ctx context.Context, issue *issues_model.Issue, c
482482
if lineCommits, ok := allComments[file.Name]; ok {
483483
for _, section := range file.Sections {
484484
for _, line := range section.Lines {
485-
if line.SectionInfo != nil {
485+
if line.SectionInfo != nil && line.SectionInfo.RightHunkSize > 0 {
486486
start := int64(line.SectionInfo.LastRightIdx + 1)
487487
end := int64(line.SectionInfo.RightIdx - 1)
488488
for start <= end {

templates/repo/diff/blob_excerpt.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="lines-comment">
99
<div>
1010
{{if $line.SectionInfo.HasComments}}
11-
<button>
11+
<button class="section-comment-icon">
1212
{{svg "octicon-comment-discussion"}}
1313
</button>
1414
{{end}}
@@ -81,7 +81,7 @@
8181
<div class="lines-comment">
8282
<div>
8383
{{if $line.SectionInfo.HasComments}}
84-
<button>
84+
<button class="section-comment-icon">
8585
{{svg "octicon-comment-discussion"}}
8686
</button>
8787
{{end}}

templates/repo/diff/section_split.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<div class="lines-comment">
2323
<div>
2424
{{if $line.SectionInfo.HasComments}}
25-
<button>
25+
<button class="section-comment-icon">
2626
{{svg "octicon-comment-discussion"}}
2727
</button>
2828
{{end}}

templates/repo/diff/section_unified.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<div class="lines-comment">
1919
<div>
2020
{{if $line.SectionInfo.HasComments}}
21-
<button>
21+
<button class="section-comment-icon">
2222
{{svg "octicon-comment-discussion"}}
2323
</button>
2424
{{end}}

web_src/css/base.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,10 @@ overflow-menu .ui.label {
11481148
gap: 1px;
11491149
}
11501150

1151+
.section-comment-icon {
1152+
cursor: default;
1153+
}
1154+
11511155
.lines-commit .blame-info .blame-data .blame-message {
11521156
flex-grow: 2;
11531157
overflow: hidden;

0 commit comments

Comments
 (0)