Skip to content

Commit 6e01685

Browse files
CopilotTylerLeonhardt
authored andcommitted
Remove disabled "No accounts requested yet..." menu item from accounts menu (microsoft#251511)
* Initial plan for issue * Remove disabled 'No accounts requested yet...' menu item Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com> * Clean up empty _registerHandlers method after removing placeholder menu item Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com> * Fix TypeScript compilation errors by removing unused imports and properties Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
1 parent c805036 commit 6e01685

File tree

1 file changed

+3
-40
lines changed

1 file changed

+3
-40
lines changed

src/vs/workbench/contrib/authentication/browser/authentication.contribution.ts

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

6-
import { Disposable, IDisposable } from '../../../../base/common/lifecycle.js';
6+
import { Disposable } from '../../../../base/common/lifecycle.js';
77
import { localize } from '../../../../nls.js';
8-
import { MenuId, MenuRegistry, registerAction2 } from '../../../../platform/actions/common/actions.js';
8+
import { registerAction2 } from '../../../../platform/actions/common/actions.js';
99
import { CommandsRegistry } from '../../../../platform/commands/common/commands.js';
10-
import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';
1110
import { IExtensionManifest } from '../../../../platform/extensions/common/extensions.js';
1211
import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js';
1312
import { Registry } from '../../../../platform/registry/common/platform.js';
1413
import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from '../../../common/contributions.js';
1514
import { SignOutOfAccountAction } from './actions/signOutOfAccountAction.js';
16-
import { IAuthenticationService } from '../../../services/authentication/common/authentication.js';
1715
import { IBrowserWorkbenchEnvironmentService } from '../../../services/environment/browser/environmentService.js';
1816
import { Extensions, IExtensionFeatureTableRenderer, IExtensionFeaturesRegistry, IRenderedData, IRowData, ITableData } from '../../../services/extensionManagement/common/extensionFeatures.js';
1917
import { ManageTrustedExtensionsForAccountAction } from './actions/manageTrustedExtensionsForAccountAction.js';
@@ -80,44 +78,14 @@ const extensionFeature = Registry.as<IExtensionFeaturesRegistry>(Extensions.Exte
8078
class AuthenticationContribution extends Disposable implements IWorkbenchContribution {
8179
static ID = 'workbench.contrib.authentication';
8280

83-
private _placeholderMenuItem: IDisposable | undefined = MenuRegistry.appendMenuItem(MenuId.AccountsContext, {
84-
command: {
85-
id: 'noAuthenticationProviders',
86-
title: localize('authentication.Placeholder', "No accounts requested yet..."),
87-
precondition: ContextKeyExpr.false()
88-
},
89-
});
90-
91-
constructor(@IAuthenticationService private readonly _authenticationService: IAuthenticationService) {
81+
constructor() {
9282
super();
9383
this._register(codeExchangeProxyCommand);
9484
this._register(extensionFeature);
9585

96-
// Clear the placeholder menu item if there are already providers registered.
97-
if (_authenticationService.getProviderIds().length) {
98-
this._clearPlaceholderMenuItem();
99-
}
100-
this._registerHandlers();
10186
this._registerActions();
10287
}
10388

104-
private _registerHandlers(): void {
105-
this._register(this._authenticationService.onDidRegisterAuthenticationProvider(_e => {
106-
this._clearPlaceholderMenuItem();
107-
}));
108-
this._register(this._authenticationService.onDidUnregisterAuthenticationProvider(_e => {
109-
if (!this._authenticationService.getProviderIds().length) {
110-
this._placeholderMenuItem = MenuRegistry.appendMenuItem(MenuId.AccountsContext, {
111-
command: {
112-
id: 'noAuthenticationProviders',
113-
title: localize('loading', "Loading..."),
114-
precondition: ContextKeyExpr.false()
115-
}
116-
});
117-
}
118-
}));
119-
}
120-
12189
private _registerActions(): void {
12290
this._register(registerAction2(SignOutOfAccountAction));
12391
this._register(registerAction2(ManageTrustedExtensionsForAccountAction));
@@ -126,11 +94,6 @@ class AuthenticationContribution extends Disposable implements IWorkbenchContrib
12694
this._register(registerAction2(ManageAccountPreferencesForMcpServerAction));
12795
this._register(registerAction2(RemoveDynamicAuthenticationProvidersAction));
12896
}
129-
130-
private _clearPlaceholderMenuItem(): void {
131-
this._placeholderMenuItem?.dispose();
132-
this._placeholderMenuItem = undefined;
133-
}
13497
}
13598

13699
class AuthenticationUsageContribution implements IWorkbenchContribution {

0 commit comments

Comments
 (0)