@@ -89,11 +89,13 @@ export class RemoteFileChangeNode extends TreeNode implements vscode.TreeItem {
89
89
) {
90
90
super ( ) ;
91
91
const viewed = this . pullRequest . fileChangeViewedState [ fileName ] ?? ViewedState . UNVIEWED ;
92
- this . contextValue = `filechange:${ GitChangeType [ status ] } :${
93
- viewed === ViewedState . VIEWED ? 'viewed' : 'unviewed'
94
- } `;
92
+ this . contextValue = `filechange:${ GitChangeType [ status ] } :${ viewed === ViewedState . VIEWED ? 'viewed' : 'unviewed'
93
+ } `;
95
94
this . label = path . basename ( fileName ) ;
96
- this . description = path . relative ( '.' , path . dirname ( fileName ) ) ;
95
+ this . description = vscode . workspace . asRelativePath ( path . dirname ( fileName ) , false ) ;
96
+ if ( this . description === '.' ) {
97
+ this . description = '' ;
98
+ }
97
99
this . iconPath = vscode . ThemeIcon . File ;
98
100
this . resourceUri = toResourceUri ( vscode . Uri . parse ( this . blobUrl ) , pullRequest . number , fileName , status ) ;
99
101
this . updateViewed ( viewed ) ;
@@ -120,9 +122,8 @@ export class RemoteFileChangeNode extends TreeNode implements vscode.TreeItem {
120
122
}
121
123
122
124
this . _viewed = viewed ;
123
- this . contextValue = `filechange:${ GitChangeType [ this . status ] } :${
124
- viewed === ViewedState . VIEWED ? 'viewed' : 'unviewed'
125
- } `;
125
+ this . contextValue = `filechange:${ GitChangeType [ this . status ] } :${ viewed === ViewedState . VIEWED ? 'viewed' : 'unviewed'
126
+ } `;
126
127
FileViewedDecorationProvider . updateFileViewedState (
127
128
this . resourceUri ,
128
129
this . pullRequest . number ,
@@ -169,11 +170,13 @@ export class FileChangeNode extends TreeNode implements vscode.TreeItem {
169
170
) {
170
171
super ( ) ;
171
172
const viewed = this . pullRequest . fileChangeViewedState [ fileName ] ?? ViewedState . UNVIEWED ;
172
- this . contextValue = `filechange:${ GitChangeType [ status ] } :${
173
- viewed === ViewedState . VIEWED ? 'viewed' : 'unviewed'
174
- } `;
173
+ this . contextValue = `filechange:${ GitChangeType [ status ] } :${ viewed === ViewedState . VIEWED ? 'viewed' : 'unviewed'
174
+ } `;
175
175
this . label = path . basename ( fileName ) ;
176
- this . description = path . relative ( '.' , path . dirname ( fileName ) ) ;
176
+ this . description = vscode . workspace . asRelativePath ( path . dirname ( fileName ) , false ) ;
177
+ if ( this . description === '.' ) {
178
+ this . description = '' ;
179
+ }
177
180
this . iconPath = vscode . ThemeIcon . File ;
178
181
this . opts = {
179
182
preserveFocus : true ,
@@ -212,9 +215,8 @@ export class FileChangeNode extends TreeNode implements vscode.TreeItem {
212
215
}
213
216
214
217
this . _viewed = viewed ;
215
- this . contextValue = `filechange:${ GitChangeType [ this . status ] } :${
216
- viewed === ViewedState . VIEWED ? 'viewed' : 'unviewed'
217
- } `;
218
+ this . contextValue = `filechange:${ GitChangeType [ this . status ] } :${ viewed === ViewedState . VIEWED ? 'viewed' : 'unviewed'
219
+ } `;
218
220
FileViewedDecorationProvider . updateFileViewedState (
219
221
this . resourceUri ,
220
222
this . pullRequest . number ,
0 commit comments