@@ -11,6 +11,7 @@ import Logger from '../../common/logger';
1111import { FILE_LIST_LAYOUT , PR_SETTINGS_NAMESPACE , SHOW_PULL_REQUEST_NUMBER_IN_TREE } from '../../common/settingKeys' ;
1212import { createPRNodeUri , DataUri , fromPRUri , Schemes } from '../../common/uri' ;
1313import { FolderRepositoryManager } from '../../github/folderRepositoryManager' ;
14+ import { CopilotWorkingStatus } from '../../github/githubRepository' ;
1415import { NotificationProvider } from '../../github/notifications' ;
1516import { IResolvedPullRequestModel , PullRequestModel } from '../../github/pullRequestModel' ;
1617import { InMemFileChangeModel , RemoteFileChangeModel } from '../fileChangeModel' ;
@@ -259,6 +260,23 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2
259260 } ) ;
260261 }
261262
263+ private async _getIcon ( ) : Promise < vscode . Uri | vscode . ThemeIcon > {
264+ const copilotWorkingStatus = await this . pullRequestModel . githubRepository . copilotWorkingStatus ( this . pullRequestModel ) ;
265+ switch ( copilotWorkingStatus ) {
266+ case CopilotWorkingStatus . InProgress :
267+ return new vscode . ThemeIcon ( 'copilot-in-progress' ) ;
268+ case CopilotWorkingStatus . Done :
269+ return new vscode . ThemeIcon ( 'copilot-success' ) ;
270+ case CopilotWorkingStatus . Error :
271+ return new vscode . ThemeIcon ( 'copilot-error' ) ;
272+ case CopilotWorkingStatus . NotCopilotIssue :
273+ default :
274+ return ( await DataUri . avatarCirclesAsImageDataUris ( this . _folderReposManager . context , [ this . pullRequestModel . author ] , 16 , 16 ) ) [ 0 ]
275+ ?? new vscode . ThemeIcon ( 'github' ) ;
276+
277+ }
278+ }
279+
262280 async getTreeItem ( ) : Promise < vscode . TreeItem > {
263281 const currentBranchIsForThisPR = this . pullRequestModel . equals ( this . _folderReposManager . activePullRequest ) ;
264282
@@ -298,8 +316,7 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2
298316 ( currentBranchIsForThisPR ? ':active' : ':nonactive' ) +
299317 ( hasNotification ? ':notification' : '' ) +
300318 ( ( ( this . pullRequestModel . item . isRemoteHeadDeleted && ! this . _isLocal ) || ! this . _folderReposManager . isPullRequestAssociatedWithOpenRepository ( this . pullRequestModel ) ) ? '' : ':hasHeadRef' ) ,
301- iconPath : ( await DataUri . avatarCirclesAsImageDataUris ( this . _folderReposManager . context , [ this . pullRequestModel . author ] , 16 , 16 ) ) [ 0 ]
302- ?? new vscode . ThemeIcon ( 'github' ) ,
319+ iconPath : await this . _getIcon ( ) ,
303320 accessibilityInformation : {
304321 label : `${ isDraft ? 'Draft ' : '' } Pull request number ${ formattedPRNumber } : ${ title } by ${ login } `
305322 } ,
0 commit comments