@@ -16,6 +16,7 @@ import { Action2, MenuId, registerAction2 } from '../../../../platform/actions/c
1616import { ICommandService } from '../../../../platform/commands/common/commands.js' ;
1717import { ContextKeyExpr , IContextKey , IContextKeyService , RawContextKey } from '../../../../platform/contextkey/common/contextkey.js' ;
1818import { IHoverService } from '../../../../platform/hover/browser/hover.js' ;
19+ import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js' ;
1920import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js' ;
2021import { IStorageService , StorageScope , StorageTarget } from '../../../../platform/storage/common/storage.js' ;
2122import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js' ;
@@ -35,6 +36,8 @@ const UPDATE_TITLE_BAR_CONTEXT = new RawContextKey<boolean>('updateTitleBar', fa
3536const DISABLED_REMINDER_LAST_SHOWN_KEY = 'update/disabledReminderLastShown' ;
3637const DISABLED_REMINDER_PERIOD = 30 * 24 * 60 * 60 * 1000 ; // 30 days
3738
39+ const UPDATE_TITLE_BAR_SETTING = 'update.titleBar' ;
40+
3841const ACTIONABLE_STATES : readonly StateType [ ] = [ StateType . AvailableForDownload , StateType . Downloaded , StateType . Ready ] ;
3942const 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