Skip to content

Commit 34911a2

Browse files
authored
Edited user and workspace tab to only display the name for accessibility microsoft#184530 (microsoft#184627)
1 parent 2e335d2 commit 34911a2

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import { ThemeIcon } from 'vs/base/common/themables';
3333
import { isWorkspaceFolder, IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace';
3434
import { settingsEditIcon, settingsScopeDropDownIcon } from 'vs/workbench/contrib/preferences/browser/preferencesIcons';
3535
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
36-
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
3736
import { ILanguageService } from 'vs/editor/common/languages/language';
3837
import { CONTEXT_SETTINGS_EDITOR_IN_USER_TAB } from 'vs/workbench/contrib/preferences/common/preferences';
3938

@@ -52,7 +51,6 @@ export class FolderSettingsActionViewItem extends BaseActionViewItem {
5251
action: IAction,
5352
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
5453
@IContextMenuService private readonly contextMenuService: IContextMenuService,
55-
@IPreferencesService private readonly preferencesService: IPreferencesService,
5654
) {
5755
super(null, action);
5856
const workspace = this.contextService.getWorkspace();
@@ -142,14 +140,14 @@ export class FolderSettingsActionViewItem extends BaseActionViewItem {
142140
}
143141
}
144142

145-
private async update(): Promise<void> {
143+
private update(): void {
146144
let total = 0;
147145
this._folderSettingCounts.forEach(n => total += n);
148146

149147
const workspace = this.contextService.getWorkspace();
150148
if (this._folder) {
151149
this.labelElement.textContent = this._folder.name;
152-
this.anchorElement.title = (await this.preferencesService.getEditableSettingsURI(ConfigurationTarget.WORKSPACE_FOLDER, this._folder.uri))?.fsPath || '';
150+
this.anchorElement.title = this._folder.name;
153151
const detailsText = this.labelWithCount(this._action.label, total);
154152
this.detailsElement.textContent = detailsText;
155153
this.dropDownElement.classList.toggle('hide', workspace.folders.length === 1 || !this._action.checked);
@@ -233,7 +231,6 @@ export class SettingsTargetsWidget extends Widget {
233231
@IInstantiationService private readonly instantiationService: IInstantiationService,
234232
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
235233
@ILabelService private readonly labelService: ILabelService,
236-
@IPreferencesService private readonly preferencesService: IPreferencesService,
237234
@ILanguageService private readonly languageService: ILanguageService,
238235
@IContextKeyService contextKeyService: IContextKeyService,
239236
) {
@@ -265,15 +262,12 @@ export class SettingsTargetsWidget extends Widget {
265262
}));
266263

267264
this.userLocalSettings = new Action('userSettings', '', '.settings-tab', true, () => this.updateTarget(ConfigurationTarget.USER_LOCAL));
268-
this.preferencesService.getEditableSettingsURI(ConfigurationTarget.USER_LOCAL).then(uri => {
269-
// Don't wait to create UI on resolving remote
270-
this.userLocalSettings.tooltip = uri?.fsPath ?? '';
271-
});
265+
this.userLocalSettings.tooltip = localize('userSettings', "User");
272266

273267
this.userRemoteSettings = new Action('userSettingsRemote', '', '.settings-tab', true, () => this.updateTarget(ConfigurationTarget.USER_REMOTE));
274-
this.preferencesService.getEditableSettingsURI(ConfigurationTarget.USER_REMOTE).then(uri => {
275-
this.userRemoteSettings.tooltip = uri?.fsPath ?? '';
276-
});
268+
const remoteAuthority = this.environmentService.remoteAuthority;
269+
const hostLabel = remoteAuthority && this.labelService.getHostLabel(Schemas.vscodeRemote, remoteAuthority);
270+
this.userRemoteSettings.tooltip = localize('userSettingsRemote', "Remote") + (hostLabel ? ` [${hostLabel}]` : '');
277271

278272
this.workspaceSettings = new Action('workspaceSettings', '', '.settings-tab', false, () => this.updateTarget(ConfigurationTarget.WORKSPACE));
279273

@@ -368,7 +362,7 @@ export class SettingsTargetsWidget extends Widget {
368362
this.workspaceSettings.enabled = this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY;
369363
this.folderSettings.action.enabled = this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE && this.contextService.getWorkspace().folders.length > 0;
370364

371-
this.workspaceSettings.tooltip = (await this.preferencesService.getEditableSettingsURI(ConfigurationTarget.WORKSPACE))?.fsPath || '';
365+
this.workspaceSettings.tooltip = localize('workspaceSettings', "Workspace");
372366
}
373367
}
374368

0 commit comments

Comments
 (0)