Skip to content

Commit 513807b

Browse files
author
Benjamin Pasero
committed
web - improve window indicator
1 parent 0ffdb5a commit 513807b

2 files changed

Lines changed: 11 additions & 25 deletions

File tree

resources/web/code-web.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const BUILTIN_MARKETPLACE_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'built
2727
const WEB_DEV_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'builtInWebDevExtensions');
2828
const WEB_MAIN = path.join(APP_ROOT, 'src', 'vs', 'code', 'browser', 'workbench', 'workbench-dev.html');
2929

30-
const WEB_PLAYGROUND_VERSION = '0.0.4';
30+
const WEB_PLAYGROUND_VERSION = '0.0.5';
3131

3232
const args = minimist(process.argv, {
3333
boolean: [

src/vs/code/browser/workbench/workbench.ts

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { IWorkbenchConstructionOptions, create, ICredentialsProvider, IURLCallbackProvider, IWorkspaceProvider, IWorkspace, IWindowIndicator, ICommand, IHomeIndicator, IProductQualityChangeHandler } from 'vs/workbench/workbench.web.api';
7-
import product from 'vs/platform/product/common/product';
6+
import { IWorkbenchConstructionOptions, create, ICredentialsProvider, IURLCallbackProvider, IWorkspaceProvider, IWorkspace, IWindowIndicator, IHomeIndicator, IProductQualityChangeHandler } from 'vs/workbench/workbench.web.api';
87
import { URI, UriComponents } from 'vs/base/common/uri';
98
import { Event, Emitter } from 'vs/base/common/event';
109
import { generateUuid } from 'vs/base/common/uuid';
@@ -302,8 +301,6 @@ class WindowIndicator implements IWindowIndicator {
302301
readonly tooltip: string;
303302
readonly command: string | undefined;
304303

305-
readonly commandImpl: ICommand | undefined = undefined;
306-
307304
constructor(workspace: IWorkspace) {
308305
let repositoryOwner: string | undefined = undefined;
309306
let repositoryName: string | undefined = undefined;
@@ -321,20 +318,16 @@ class WindowIndicator implements IWindowIndicator {
321318
}
322319
}
323320

321+
// Repo
324322
if (repositoryName && repositoryOwner) {
325-
this.label = localize('openInDesktopLabel', "$(remote) Open in Desktop");
326-
this.tooltip = localize('openInDesktopTooltip', "Open in Desktop");
327-
this.command = '_web.openInDesktop';
328-
this.commandImpl = {
329-
id: this.command,
330-
handler: () => {
331-
const protocol = product.quality === 'stable' ? 'vscode' : 'vscode-insiders';
332-
window.open(`${protocol}://vscode.git/clone?url=${encodeURIComponent(`https://github.com/${repositoryOwner}/${repositoryName}.git`)}`);
333-
}
334-
};
335-
} else {
336-
this.label = localize('playgroundLabel', "Web Playground");
337-
this.tooltip = this.label;
323+
this.label = localize('playgroundLabelRepository', "$(remote) VS Code Web Playground: {0}/{1}", repositoryOwner, repositoryName);
324+
this.tooltip = localize('playgroundRepositoryTooltip', "VS Code Web Playground: {0}/{1}", repositoryOwner, repositoryName);
325+
}
326+
327+
// No Repo
328+
else {
329+
this.label = localize('playgroundLabel', "$(remote) VS Code Web Playground");
330+
this.tooltip = localize('playgroundTooltip', "VS Code Web Playground");
338331
}
339332
}
340333
}
@@ -416,16 +409,10 @@ class WindowIndicator implements IWindowIndicator {
416409
title: localize('home', "Home")
417410
};
418411

419-
// Commands
420-
const commands: ICommand[] = [];
421-
422412
// Window indicator (unless connected to a remote)
423413
let windowIndicator: WindowIndicator | undefined = undefined;
424414
if (!workspaceProvider.hasRemote()) {
425415
windowIndicator = new WindowIndicator(workspace);
426-
if (windowIndicator.commandImpl) {
427-
commands.push(windowIndicator.commandImpl);
428-
}
429416
}
430417

431418
// Product Quality Change Handler
@@ -447,7 +434,6 @@ class WindowIndicator implements IWindowIndicator {
447434
create(document.body, {
448435
...config,
449436
homeIndicator,
450-
commands,
451437
windowIndicator,
452438
productQualityChangeHandler,
453439
workspaceProvider,

0 commit comments

Comments
 (0)