Merge "Highlight the entire line in comment context for line comments"
diff --git a/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts b/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts
index ec7be4a..b576ad6 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts
+++ b/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts
@@ -318,7 +318,18 @@
}
getHighlightRange() {
- return this.comments?.[0]?.range;
+ const comment = this.comments?.[0];
+ if (!comment) return undefined;
+ if (comment.range) return comment.range;
+ if (comment.line) {
+ return {
+ start_line: comment.line,
+ start_character: 0,
+ end_line: comment.line,
+ end_character: 0,
+ };
+ }
+ return undefined;
}
_getDiffUrlForComment(