Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show remote indicator if there are installableExtensions in an empty window. #186456

Merged
merged 2 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/vs/workbench/contrib/remote/browser/remoteIndicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ interface RemoteExtensionMetadata {
supportedPlatforms?: PlatformName[];
}

export const showRemoteStartEntry = new RawContextKey<boolean>('showRemoteStartEntry', false);
export class RemoteStatusIndicator extends Disposable implements IWorkbenchContribution {

private static readonly REMOTE_ACTIONS_COMMAND_ID = 'workbench.action.remote.showMenu';
Expand Down Expand Up @@ -340,6 +341,8 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
}

this.remoteMetadataInitialized = true;
showRemoteStartEntry.bindTo(this.contextKeyService).set(true);
this.updateRemoteStatusIndicator();
}

private updateVirtualWorkspaceLocation() {
Expand Down Expand Up @@ -548,8 +551,8 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
}
}

// Show when there are commands other than the 'install additional remote extensions' command.
if (this.hasRemoteMenuCommands(true)) {
// Show when there are commands or installable remote extensions.
if (this.hasRemoteMenuCommands(true) || this.remoteExtensionMetadata.some(ext => !ext.installed && ext.isPlatformCompatible)) {
this.renderRemoteStatusIndicator(`$(remote)`, nls.localize('noHost.tooltip', "Open a Remote Window"));
return;
}
Expand All @@ -570,7 +573,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
text,
showProgress,
tooltip,
command: command ?? this.hasRemoteMenuCommands(false) ? RemoteStatusIndicator.REMOTE_ACTIONS_COMMAND_ID : undefined
command: command ?? (this.hasRemoteMenuCommands(false) || this.remoteExtensionMetadata.some(ext => !ext.installed && ext.isPlatformCompatible)) ? RemoteStatusIndicator.REMOTE_ACTIONS_COMMAND_ID : undefined
};

if (this.remoteStatusEntry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const startEntries: GettingStartedStartEntryContent = [
id: 'topLevelRemoteOpen',
title: localize('gettingStarted.topLevelRemoteOpen.title', "Connect to..."),
description: localize('gettingStarted.topLevelRemoteOpen.description', "Connect to remote development workspaces."),
when: '!isWeb',
when: '!isWeb && showRemoteStartEntry',
icon: Codicon.remote,
content: {
type: 'startEntry',
Expand Down