Skip to content

Commit a2ef072

Browse files
authored
PR shown as authored by @copilot-swe-agent (#6886)
Fixes #6881
1 parent d50751a commit a2ef072

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/github/prComment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class TemporaryComment extends CommentBase {
169169
super(parent);
170170
this.mode = vscode.CommentMode.Preview;
171171
this.originalAuthor = {
172-
name: currentUser.login,
172+
name: currentUser.specialDisplayName ?? currentUser.login,
173173
iconPath: currentUser.avatarUrl ? vscode.Uri.parse(`${currentUser.avatarUrl}&s=64`) : undefined,
174174
};
175175
this.label = isDraft ? vscode.l10n.t('Pending') : undefined;
@@ -226,7 +226,7 @@ export class GHPRComment extends CommentBase {
226226
super(parent);
227227
this.rawComment = comment;
228228
this.originalAuthor = {
229-
name: comment.user!.login,
229+
name: comment.user?.specialDisplayName ?? comment.user!.login,
230230
iconPath: comment.user && comment.user.avatarUrl ? vscode.Uri.parse(comment.user.avatarUrl) : undefined,
231231
};
232232

src/view/treeNodes/pullRequestNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2
264264

265265
const { title, number, author, isDraft, html_url } = this.pullRequestModel;
266266
const labelTitle = this.pullRequestModel.title.length > 50 ? `${this.pullRequestModel.title.substring(0, 50)}...` : this.pullRequestModel.title;
267-
const { login } = author;
267+
const login = author.specialDisplayName ?? author.login;
268268

269269
const hasNotification = this._notificationProvider.hasNotification(this.pullRequestModel);
270270

0 commit comments

Comments
 (0)