Skip to content

Commit 92f231e

Browse files
authored
Merge pull request #209 from Microsoft/misolori/ux-polish
Improve styling for reviews, comments, and blockquotes
2 parents dd7f2d1 + cca5f59 commit 92f231e

File tree

2 files changed

+55
-17
lines changed

2 files changed

+55
-17
lines changed

preview-src/index.css

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6+
:root {
7+
--border-color: var(--vscode-notifications-border);
8+
}
9+
610
.title {
711
display: flex;
812
align-items: flex-start;
913
margin-top: 20px;
10-
border-bottom: 1px solid var(--vscode-tab-inactiveBackground);
14+
border-bottom: 1px solid var(--border-color);
1115
}
1216

1317
#title:empty {
@@ -85,7 +89,7 @@ body .comment-container:last-child .comment {
8589
display: block;
8690
width: 2px;
8791
content: "";
88-
background-color: var(--vscode-tab-inactiveBackground);
92+
background-color: var(--border-color);
8993
} */
9094

9195
body .review-comment .review-comment-header {
@@ -186,7 +190,7 @@ body button.checkedOut svg {
186190
align-items: center;
187191
margin-top: 8px;
188192
padding-bottom: 16px;
189-
border-bottom: 1px solid var(--vscode-tab-inactiveBackground);
193+
border-bottom: 1px solid var(--border-color);
190194
}
191195

192196
.subtitle .avatar {
@@ -249,11 +253,11 @@ body .overview-title button {
249253
.comment-container {
250254
position: relative;
251255
padding: 20px 0;
252-
border-top: 1px solid var(--vscode-tab-inactiveBackground);
256+
border-top: 1px solid var(--border-color);
253257
}
254258

255259
.comment-container:last-of-type {
256-
border-bottom: 1px solid var(--vscode-tab-inactiveBackground);
260+
border-bottom: 1px solid var(--border-color);
257261
}
258262

259263
.comment-container[data-type="commit"] {
@@ -265,6 +269,25 @@ body .overview-title button {
265269
border-top: none;
266270
}
267271

272+
.comment-body div[data-type="review-comment"] {
273+
padding: 0 20px;
274+
border-right: 1px solid var(--vscode-notifications-background);
275+
border-left: 1px solid var(--vscode-notifications-background);
276+
border-bottom: 1px solid var(--vscode-notifications-background);
277+
}
278+
279+
.comment-body div[data-type="review-comment"] .comment-container {
280+
padding: 12px 0;
281+
}
282+
283+
.comment-body div[data-type="review-comment"] .comment-container:last-child {
284+
border-bottom: none;
285+
}
286+
287+
.comment-body div[data-type="review-comment"] .comment-container:last-child .comment {
288+
padding-bottom: 0;
289+
}
290+
268291
body .comment-form {
269292
padding: 20px 0 10px;
270293
}
@@ -318,11 +341,30 @@ body .comment-form .form-actions button {
318341
content: "No description provided."
319342
}
320343

344+
blockquote {
345+
display: block;
346+
flex-direction: column;
347+
margin: 8px 0;
348+
padding: 8px 12px;
349+
border-left-width: 5px;
350+
border-left-style: solid;
351+
}
352+
353+
blockquote p {
354+
margin: 8px 0;
355+
}
356+
357+
blockquote p:first-child {
358+
margin-top: 0;
359+
}
360+
361+
blockquote p:last-child {
362+
margin-bottom: 0;
363+
}
321364

322365
.comment-body img {
323366
max-width: 100%;
324367
max-height: 100%;
325-
margin-top: 8px;
326368
display: block;
327369
}
328370

@@ -389,13 +431,6 @@ body .comment-form .form-actions button {
389431
border-top: 1px solid;
390432
}
391433

392-
.comment-body blockquote {
393-
margin: 0 7px 0 5px;
394-
padding: 0 16px 0 10px;
395-
border-left-width: 5px;
396-
border-left-style: solid;
397-
}
398-
399434
.comment-body code {
400435
font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback";
401436
}
@@ -463,12 +498,16 @@ body .comment-form .form-actions button {
463498
}
464499

465500
.diff {
466-
margin: 8px 0;
501+
margin: 40px 0 0px;
467502
border: 1px solid var(--vscode-notifications-background) !important;
468503
}
469504

505+
.diff:first-of-type {
506+
margin-top: 8px;
507+
}
508+
470509
.diff .diffHeader {
471-
padding: 2px 12px;
510+
padding: 6px 12px;
472511
line-height: 1.5;
473512
border-bottom: solid 1px var(--vscode-notifications-background);
474513
background-color: var(--vscode-editorGroupHeader-tabsBackground);

preview-src/pullRequestOverviewRenderer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,11 @@ export function renderReview(timelineEvent: ReviewEvent): string {
331331

332332
body += `
333333
${diffView}
334-
<div>${ comments && comments.length ? comments.map(comment => renderComment(comment)).join('') : ''}</div>
334+
<div data-type="review-comment">${ comments && comments.length ? comments.map(comment => renderComment(comment)).join('') : ''}</div>
335335
`;
336336
}
337337
}
338338

339-
340339
return `<div class="comment-container" data-type="review">
341340
342341
<div class="review-comment" role="treeitem">

0 commit comments

Comments
 (0)