@@ -60,6 +60,11 @@ public partial class AgentViewModel : ObservableObject, IModelUpdateable<AgentVi
60
60
private const string DefaultDashboardUrl = "https://coder.com" ;
61
61
private const int MaxAppsPerRow = 6 ;
62
62
63
+ // These are fake UUIDs, for UI purposes only. Display apps don't exist on
64
+ // the backend as real app resources and therefore don't have an ID.
65
+ private static readonly Uuid VscodeAppUuid = new ( "819828b1-5213-4c3d-855e-1b74db6ddd19" ) ;
66
+ private static readonly Uuid VscodeInsidersAppUuid = new ( "becf1e10-5101-4940-a853-59af86468069" ) ;
67
+
63
68
private readonly ILogger < AgentViewModel > _logger ;
64
69
private readonly ICoderApiClientFactory _coderApiClientFactory ;
65
70
private readonly ICredentialManager _credentialManager ;
@@ -274,6 +279,32 @@ private void ContinueFetchApps(Task<WorkspaceAgent> task)
274
279
apps . Add ( _agentAppViewModelFactory . Create ( uuid , app . DisplayName , app . Url , iconUrl ) ) ;
275
280
}
276
281
282
+ foreach ( var displayApp in workspaceAgent . DisplayApps )
283
+ {
284
+ if ( displayApp is not WorkspaceAgent . DisplayAppVscode and not WorkspaceAgent . DisplayAppVscodeInsiders )
285
+ continue ;
286
+
287
+ var id = VscodeAppUuid ;
288
+ var displayName = "VS Code" ;
289
+ var icon = "/icon/code.svg" ;
290
+ var scheme = "vscode" ;
291
+ if ( displayApp is WorkspaceAgent . DisplayAppVscodeInsiders )
292
+ {
293
+ id = VscodeInsidersAppUuid ;
294
+ displayName = "VS Code Insiders" ;
295
+ icon = "/icon/code-insiders.svg" ;
296
+ scheme = "vscode-insiders" ;
297
+ }
298
+
299
+ var appUri = $ "{ scheme } ://vscode-remote/ssh-remote+{ FullHostname } /{ workspaceAgent . ExpandedDirectory } ";
300
+
301
+ // Icon parse failures are not fatal, we will just use the fallback
302
+ // icon.
303
+ _ = Uri . TryCreate ( DashboardBaseUrl , icon , out var iconUrl ) ;
304
+
305
+ apps . Add ( _agentAppViewModelFactory . Create ( id , displayName , appUri , iconUrl ) ) ;
306
+ }
307
+
277
308
// Sort by name.
278
309
ModelUpdate . ApplyLists ( Apps , apps , ( a , b ) => string . Compare ( a . Name , b . Name , StringComparison . Ordinal ) ) ;
279
310
}
0 commit comments