Skip to content

Commit 9d674ad

Browse files
Improve Explorer welcome view (fix microsoft#137414) (microsoft#137475)
* Improve Explorer welcome view (fix microsoft#137414) * don't duplicate noFolder welcome help in the IsWebContext case * simplify noFolderHelp when-clauses
1 parent fc86d42 commit 9d674ad

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/vs/workbench/contrib/files/browser/explorerViewlet.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,18 @@ viewsRegistry.registerViewWelcomeContent(EmptyView.ID, {
298298
order: 1
299299
});
300300

301+
viewsRegistry.registerViewWelcomeContent(EmptyView.ID, {
302+
content: localize({ key: 'noFolderButEditorsHelp', comment: ['Please do not translate the word "commmand", it is part of our internal syntax which must not change'] },
303+
"You have not yet opened a folder.\n[Open Folder](command:{0})\nOpening a folder will close all currently open editors. To keep them open, [add a folder](command:{1}) instead.", commandId, AddRootFolderAction.ID),
304+
when: ContextKeyExpr.and(ContextKeyExpr.has('editorIsOpen'), ContextKeyExpr.or(ContextKeyExpr.and(WorkbenchStateContext.notEqualsTo('workspace'), RemoteNameContext.isEqualTo('')), ContextKeyExpr.and(WorkbenchStateContext.notEqualsTo('workspace'), IsWebContext))),
305+
group: ViewContentGroups.Open,
306+
order: 1
307+
});
308+
301309
viewsRegistry.registerViewWelcomeContent(EmptyView.ID, {
302310
content: localize({ key: 'noFolderHelp', comment: ['Please do not translate the word "commmand", it is part of our internal syntax which must not change'] },
303311
"You have not yet opened a folder.\n[Open Folder](command:{0})", commandId),
304-
when: ContextKeyExpr.or(ContextKeyExpr.and(WorkbenchStateContext.notEqualsTo('workspace'), RemoteNameContext.isEqualTo('')), ContextKeyExpr.and(WorkbenchStateContext.notEqualsTo('workspace'), IsWebContext)),
312+
when: ContextKeyExpr.and(ContextKeyExpr.has('editorIsOpen')?.negate(), ContextKeyExpr.or(ContextKeyExpr.and(WorkbenchStateContext.notEqualsTo('workspace'), RemoteNameContext.isEqualTo('')), ContextKeyExpr.and(WorkbenchStateContext.notEqualsTo('workspace'), IsWebContext))),
305313
group: ViewContentGroups.Open,
306314
order: 1
307315
});

0 commit comments

Comments
 (0)