From f8e30e692cd8e804857b29713b7182e9d371365c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 17:35:51 +0000 Subject: [PATCH 1/4] Initial plan From e48b945f92b9f37f4ba71674319597a399885c25 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 17:46:42 +0000 Subject: [PATCH 2/4] Fix avatar display in tree views for GitHub Enterprise - Add enterprise detection in PR tree views - Use github ThemeIcon placeholder for enterprise instead of fetching avatars - Update pullRequestNode, issuesView, commitNode, and repositoryChangesNode Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/issues/issuesView.ts | 13 +++++++++---- src/view/treeNodes/commitNode.ts | 9 +++++++-- src/view/treeNodes/pullRequestNode.ts | 8 ++++++++ src/view/treeNodes/repositoryChangesNode.ts | 7 ++++++- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/issues/issuesView.ts b/src/issues/issuesView.ts index 9d172d9c05..cec1c09b07 100644 --- a/src/issues/issuesView.ts +++ b/src/issues/issuesView.ts @@ -101,10 +101,15 @@ export class IssuesTreeData } if (avatarUser) { - treeItem.iconPath = (await DataUri.avatarCirclesAsImageDataUris(this.context, [avatarUser], 16, 16))[0] ?? - (element.isOpen - ? new vscode.ThemeIcon('issues', new vscode.ThemeColor('issues.open')) - : new vscode.ThemeIcon('issue-closed', new vscode.ThemeColor('github.issues.closed'))); + // For enterprise, use placeholder icon instead of trying to fetch avatar + if (element.githubRepository.remote.isEnterprise) { + treeItem.iconPath = new vscode.ThemeIcon('github'); + } else { + treeItem.iconPath = (await DataUri.avatarCirclesAsImageDataUris(this.context, [avatarUser], 16, 16))[0] ?? + (element.isOpen + ? new vscode.ThemeIcon('issues', new vscode.ThemeColor('issues.open')) + : new vscode.ThemeIcon('issue-closed', new vscode.ThemeColor('github.issues.closed'))); + } } else { // Use GitHub codicon when assignee setting is selected but no assignees exist treeItem.iconPath = new vscode.ThemeIcon('github'); diff --git a/src/view/treeNodes/commitNode.ts b/src/view/treeNodes/commitNode.ts index 6c4a4e202e..ea63bba0e8 100644 --- a/src/view/treeNodes/commitNode.ts +++ b/src/view/treeNodes/commitNode.ts @@ -40,8 +40,13 @@ export class CommitNode extends TreeNode implements vscode.TreeItem { async getTreeItem(): Promise { if (this.commit.author) { - const author: IAccount = { id: this.commit.author.node_id, login: this.commit.author.login, url: this.commit.author.url, avatarUrl: this.commit.author.avatar_url, accountType: this.commit.author.type as AccountType }; - this.iconPath = (await DataUri.avatarCirclesAsImageDataUris(this.pullRequestManager.context, [author], 16, 16))[0]; + // For enterprise, use placeholder icon instead of trying to fetch avatar + if (this.pullRequest.githubRepository.remote.isEnterprise) { + this.iconPath = new vscode.ThemeIcon('github'); + } else { + const author: IAccount = { id: this.commit.author.node_id, login: this.commit.author.login, url: this.commit.author.url, avatarUrl: this.commit.author.avatar_url, accountType: this.commit.author.type as AccountType }; + this.iconPath = (await DataUri.avatarCirclesAsImageDataUris(this.pullRequestManager.context, [author], 16, 16))[0]; + } } return this; } diff --git a/src/view/treeNodes/pullRequestNode.ts b/src/view/treeNodes/pullRequestNode.ts index 58176edf8b..65110bceb4 100644 --- a/src/view/treeNodes/pullRequestNode.ts +++ b/src/view/treeNodes/pullRequestNode.ts @@ -274,6 +274,10 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2 const copilotWorkingStatus = await this.pullRequestModel.copilotWorkingStatus(); const theme = this._folderReposManager.themeWatcher.themeData; if (copilotWorkingStatus === CopilotWorkingStatus.NotCopilotIssue) { + // For enterprise, use placeholder icon instead of trying to fetch avatar + if (this.pullRequestModel.githubRepository.remote.isEnterprise) { + return new vscode.ThemeIcon('github'); + } return (await DataUri.avatarCirclesAsImageDataUris(this._folderReposManager.context, [this.pullRequestModel.author], 16, 16))[0] ?? new vscode.ThemeIcon('github'); } @@ -294,6 +298,10 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2 dark: DataUri.copilotErrorAsImageDataURI(getIconForeground(theme, 'dark'), getListErrorForeground(theme, 'dark')) }; default: + // For enterprise, use placeholder icon instead of trying to fetch avatar + if (this.pullRequestModel.githubRepository.remote.isEnterprise) { + return new vscode.ThemeIcon('github'); + } return (await DataUri.avatarCirclesAsImageDataUris(this._folderReposManager.context, [this.pullRequestModel.author], 16, 16))[0] ?? new vscode.ThemeIcon('github'); } diff --git a/src/view/treeNodes/repositoryChangesNode.ts b/src/view/treeNodes/repositoryChangesNode.ts index 1baaeff188..efc0acb51e 100644 --- a/src/view/treeNodes/repositoryChangesNode.ts +++ b/src/view/treeNodes/repositoryChangesNode.ts @@ -111,7 +111,12 @@ export class RepositoryChangesNode extends TreeNode implements vscode.TreeItem { override async getTreeItem(): Promise { this.setLabel(); - this.iconPath = (await DataUri.avatarCirclesAsImageDataUris(this._pullRequestManager.context, [this.pullRequestModel.author], 16, 16))[0]; + // For enterprise, use placeholder icon instead of trying to fetch avatar + if (this.pullRequestModel.githubRepository.remote.isEnterprise) { + this.iconPath = new vscode.ThemeIcon('github'); + } else { + this.iconPath = (await DataUri.avatarCirclesAsImageDataUris(this._pullRequestManager.context, [this.pullRequestModel.author], 16, 16))[0]; + } this.description = undefined; if (this.parent.children?.length && this.parent.children.length > 1) { const allSameOwner = this.parent.children.every(child => { From a86075d62ab4b73c11695f554da4f0cf0b6c4e94 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 17:48:34 +0000 Subject: [PATCH 3/4] Fix type error in commitNode iconPath Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/view/treeNodes/commitNode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/treeNodes/commitNode.ts b/src/view/treeNodes/commitNode.ts index ea63bba0e8..616519c361 100644 --- a/src/view/treeNodes/commitNode.ts +++ b/src/view/treeNodes/commitNode.ts @@ -20,7 +20,7 @@ import { LabelOnlyNode, TreeNode, TreeNodeParent } from './treeNode'; export class CommitNode extends TreeNode implements vscode.TreeItem { public sha: string; public collapsibleState: vscode.TreeItemCollapsibleState; - public iconPath: vscode.Uri | undefined; + public iconPath: vscode.Uri | vscode.ThemeIcon | undefined; public contextValue?: string; constructor( From e369d09ba9626d0c398384047faf8064e968cd09 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 17:51:06 +0000 Subject: [PATCH 4/4] Refactor: Extract helper method to reduce code duplication in pullRequestNode Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/view/treeNodes/pullRequestNode.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/view/treeNodes/pullRequestNode.ts b/src/view/treeNodes/pullRequestNode.ts index 65110bceb4..f3a2a2440b 100644 --- a/src/view/treeNodes/pullRequestNode.ts +++ b/src/view/treeNodes/pullRequestNode.ts @@ -270,16 +270,20 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2 }); } + private async _getAuthorIcon(): Promise { + // For enterprise, use placeholder icon instead of trying to fetch avatar + if (this.pullRequestModel.githubRepository.remote.isEnterprise) { + return new vscode.ThemeIcon('github'); + } + return (await DataUri.avatarCirclesAsImageDataUris(this._folderReposManager.context, [this.pullRequestModel.author], 16, 16))[0] + ?? new vscode.ThemeIcon('github'); + } + private async _getIcon(): Promise { const copilotWorkingStatus = await this.pullRequestModel.copilotWorkingStatus(); const theme = this._folderReposManager.themeWatcher.themeData; if (copilotWorkingStatus === CopilotWorkingStatus.NotCopilotIssue) { - // For enterprise, use placeholder icon instead of trying to fetch avatar - if (this.pullRequestModel.githubRepository.remote.isEnterprise) { - return new vscode.ThemeIcon('github'); - } - return (await DataUri.avatarCirclesAsImageDataUris(this._folderReposManager.context, [this.pullRequestModel.author], 16, 16))[0] - ?? new vscode.ThemeIcon('github'); + return this._getAuthorIcon(); } switch (copilotWorkingStatus) { case CopilotWorkingStatus.InProgress: @@ -298,12 +302,7 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2 dark: DataUri.copilotErrorAsImageDataURI(getIconForeground(theme, 'dark'), getListErrorForeground(theme, 'dark')) }; default: - // For enterprise, use placeholder icon instead of trying to fetch avatar - if (this.pullRequestModel.githubRepository.remote.isEnterprise) { - return new vscode.ThemeIcon('github'); - } - return (await DataUri.avatarCirclesAsImageDataUris(this._folderReposManager.context, [this.pullRequestModel.author], 16, 16))[0] - ?? new vscode.ThemeIcon('github'); + return this._getAuthorIcon(); } }