Skip to content

Commit 753d67d

Browse files
dmitrivMSCopilot
andauthored
Bring back update.titleBar setting, hide Update indicator while debugging (#313549)
Co-authored-by: Copilot <copilot@github.com>
1 parent 5330efe commit 753d67d

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

src/vs/platform/update/common/update.config.contribution.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ configurationRegistry.registerConfiguration({
8484
scope: ConfigurationScope.APPLICATION,
8585
description: localize('showPostInstallInfo', "Show a post-install update tooltip in the title bar instead of opening the release notes editor."),
8686
tags: ['usesOnlineServices']
87+
},
88+
'update.titleBar': {
89+
type: 'boolean',
90+
default: true,
91+
scope: ConfigurationScope.APPLICATION,
92+
description: localize('updateTitleBar', "Show the update indicator in the title bar."),
93+
included: !isWeb
8794
}
8895
}
8996
});

src/vs/workbench/contrib/update/browser/updateTitleBarEntry.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { Action2, MenuId, registerAction2 } from '../../../../platform/actions/c
1616
import { ICommandService } from '../../../../platform/commands/common/commands.js';
1717
import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
1818
import { IHoverService } from '../../../../platform/hover/browser/hover.js';
19+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
1920
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
2021
import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js';
2122
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
@@ -35,6 +36,8 @@ const UPDATE_TITLE_BAR_CONTEXT = new RawContextKey<boolean>('updateTitleBar', fa
3536
const DISABLED_REMINDER_LAST_SHOWN_KEY = 'update/disabledReminderLastShown';
3637
const DISABLED_REMINDER_PERIOD = 30 * 24 * 60 * 60 * 1000; // 30 days
3738

39+
const UPDATE_TITLE_BAR_SETTING = 'update.titleBar';
40+
3841
const ACTIONABLE_STATES: readonly StateType[] = [StateType.AvailableForDownload, StateType.Downloaded, StateType.Ready];
3942
const DETAILED_STATES: readonly StateType[] = [...ACTIONABLE_STATES, StateType.CheckingForUpdates, StateType.Downloading, StateType.Updating, StateType.Overwriting];
4043

@@ -47,7 +50,7 @@ registerAction2(class UpdateIndicatorTitleBarAction extends Action2 {
4750
menu: [{
4851
id: MenuId.TitleBarAdjacentCenter,
4952
order: 0,
50-
when: ContextKeyExpr.and(UPDATE_TITLE_BAR_CONTEXT, InEditorZenModeContext.negate()),
53+
when: ContextKeyExpr.and(UPDATE_TITLE_BAR_CONTEXT, InEditorZenModeContext.negate(), ContextKeyExpr.not('inDebugMode')),
5154
}]
5255
});
5356
}
@@ -69,6 +72,7 @@ export class UpdateTitleBarContribution extends Disposable implements IWorkbench
6972
constructor(
7073
@IActionViewItemService actionViewItemService: IActionViewItemService,
7174
@IChatService private readonly chatService: IChatService,
75+
@IConfigurationService private readonly configurationService: IConfigurationService,
7276
@IContextKeyService contextKeyService: IContextKeyService,
7377
@IHostService private readonly hostService: IHostService,
7478
@IInstantiationService instantiationService: IInstantiationService,
@@ -90,6 +94,12 @@ export class UpdateTitleBarContribution extends Disposable implements IWorkbench
9094
this.onStateChange();
9195
}));
9296

97+
this._register(this.configurationService.onDidChangeConfiguration(e => {
98+
if (e.affectsConfiguration(UPDATE_TITLE_BAR_SETTING)) {
99+
this.onStateChange();
100+
}
101+
}));
102+
93103
this._register(actionViewItemService.register(
94104
MenuId.TitleBarAdjacentCenter,
95105
UPDATE_TITLE_BAR_ACTION_ID,
@@ -112,6 +122,12 @@ export class UpdateTitleBarContribution extends Disposable implements IWorkbench
112122

113123
private async onStateChange(startup = false) {
114124
this.pendingShow.clear();
125+
126+
if (this.configurationService.getValue<boolean>(UPDATE_TITLE_BAR_SETTING) === false) {
127+
this.context.set(false);
128+
return;
129+
}
130+
115131
if (ACTIONABLE_STATES.includes(this.state.type)) {
116132
await this.setContextWhenChatIdle(true);
117133
} else {

0 commit comments

Comments
 (0)