Skip to content

Commit 6dd015a

Browse files
kolaentelunny
andauthored
fix: code review comments on mobile (#17321)
Co-authored-by: Lunny Xiao <[email protected]>
1 parent 74b6805 commit 6dd015a

File tree

3 files changed

+59
-5
lines changed

3 files changed

+59
-5
lines changed

templates/repo/issue/view_content/comments.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@
521521
</div>
522522
</div>
523523
{{end}}
524-
<div id="code-comments-{{(index $comms 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} hide{{end}} p-3">
524+
<div id="code-comments-{{(index $comms 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} hide{{end}}">
525525
<div class="ui comments mb-0">
526526
{{range $comms}}
527527
{{ $createdSubStr:= TimeSinceUnix .CreatedUnix $.Lang }}
@@ -590,7 +590,7 @@
590590
</div>
591591
{{end}}
592592
</div>
593-
<div class="df ac fw mt-3 mb-2 mx-3">
593+
<div class="code-comment-buttons df ac fw mt-3 mb-2 mx-3">
594594
<div class="f1">
595595
{{if $resolved}}
596596
<div class="ui grey text">
@@ -599,7 +599,7 @@
599599
</div>
600600
{{end}}
601601
</div>
602-
<div>
602+
<div class="code-comment-buttons-buttons">
603603
{{if and $.CanMarkConversation $isNotPending}}
604604
<button class="ui tiny basic button resolve-conversation" data-origin="timeline" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $comms 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation">
605605
{{if $resolved}}

web_src/less/_repository.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,10 @@
955955

956956
.ui.comments {
957957
max-width: 100%;
958+
959+
.avatar {
960+
margin-right: .5rem;
961+
}
958962
}
959963

960964
.comment {

web_src/less/_review.less

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,51 @@
4848
}
4949

5050
.comment-code-cloud {
51-
padding: .5rem;
52-
padding-left: 0;
51+
padding: .5rem !important;
5352
position: relative;
5453
margin: 0 auto;
5554

55+
@media @mediaSm {
56+
padding: .75rem !important;
57+
58+
.code-comment-buttons {
59+
margin: .5rem 0 .25rem !important;
60+
61+
.code-comment-buttons-buttons {
62+
width: 100%;
63+
}
64+
}
65+
}
66+
5667
.comments .comment {
5768
margin: 0;
69+
70+
@media @mediaSm {
71+
padding: 0;
72+
73+
.comment-header-right.actions .ui.basic.label {
74+
display: none;
75+
}
76+
77+
.avatar {
78+
width: auto;
79+
float: none;
80+
margin: 0 .5rem 0 0;
81+
flex-shrink: 0;
82+
83+
&.image {
84+
margin: 0 !important;
85+
}
86+
}
87+
88+
.comment-content {
89+
margin-left: 0 !important;
90+
}
91+
92+
&.code-comment {
93+
padding: 0 0 .5rem !important;
94+
}
95+
}
5896
}
5997

6098
.attached {
@@ -112,6 +150,17 @@
112150
display: block;
113151
}
114152
}
153+
154+
@media @mediaSm {
155+
.button {
156+
width: 100%;
157+
margin: 0 !important;
158+
159+
&:not(:last-child) {
160+
margin-bottom: .75rem !important;
161+
}
162+
}
163+
}
115164
}
116165

117166
.diff-file-body .comment-form {
@@ -142,6 +191,7 @@ a.blob-excerpt:hover {
142191
> .ui.segment {
143192
width: 94vw;
144193
}
194+
145195
.editor-toolbar {
146196
overflow-x: auto;
147197
}

0 commit comments

Comments
 (0)