@codingame/monaco-vscode-update-service-override 34.1.1 → 35.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/assignment/common/assignment.d.ts +11 -2
- package/vscode/src/vs/platform/assignment/common/assignment.js +7 -1
- package/vscode/src/vs/platform/update/common/update.config.contribution.js +24 -21
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownSettingRenderer.js +14 -14
- package/vscode/src/vs/workbench/contrib/update/browser/postUpdateWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/update/browser/releaseNotesEditor.js +3 -3
- package/vscode/src/vs/workbench/contrib/update/browser/update.contribution.js +17 -17
- package/vscode/src/vs/workbench/contrib/update/browser/update.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/update/browser/update.js +47 -26
- package/vscode/src/vs/workbench/contrib/update/browser/updateTitleBarEntry.d.ts +1 -4
- package/vscode/src/vs/workbench/contrib/update/browser/updateTitleBarEntry.js +36 -44
- package/vscode/src/vs/workbench/contrib/update/browser/updateTooltip.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/update/browser/updateTooltip.js +51 -44
- package/vscode/src/vs/workbench/contrib/update/common/updateUtils.js +8 -8
|
@@ -53,7 +53,7 @@ async function openLatestReleaseNotesInBrowser(accessor) {
|
|
|
53
53
|
await openerService.open(uri);
|
|
54
54
|
} else {
|
|
55
55
|
throw ( new Error(( localize(
|
|
56
|
-
|
|
56
|
+
16311,
|
|
57
57
|
"This version of {0} does not have release notes online",
|
|
58
58
|
productService.nameLong
|
|
59
59
|
))));
|
|
@@ -76,7 +76,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
76
76
|
group,
|
|
77
77
|
command: {
|
|
78
78
|
id: "update.check",
|
|
79
|
-
title: ( localize(
|
|
79
|
+
title: ( localize(16312, "Check for Updates..."))
|
|
80
80
|
},
|
|
81
81
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle))
|
|
82
82
|
});
|
|
@@ -84,7 +84,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
84
84
|
group,
|
|
85
85
|
command: {
|
|
86
86
|
id: "update.checking",
|
|
87
|
-
title: ( localize(
|
|
87
|
+
title: ( localize(16313, "Checking for Updates...")),
|
|
88
88
|
precondition: ( ContextKeyExpr.false())
|
|
89
89
|
},
|
|
90
90
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.CheckingForUpdates))
|
|
@@ -93,7 +93,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
93
93
|
group,
|
|
94
94
|
command: {
|
|
95
95
|
id: "update.downloadNow",
|
|
96
|
-
title: ( localize(
|
|
96
|
+
title: ( localize(16314, "Download Update (1)"))
|
|
97
97
|
},
|
|
98
98
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.AvailableForDownload))
|
|
99
99
|
});
|
|
@@ -101,7 +101,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
101
101
|
group,
|
|
102
102
|
command: {
|
|
103
103
|
id: "update.downloading",
|
|
104
|
-
title: ( localize(
|
|
104
|
+
title: ( localize(16315, "Downloading Update...")),
|
|
105
105
|
precondition: ( ContextKeyExpr.false())
|
|
106
106
|
},
|
|
107
107
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Downloading))
|
|
@@ -110,7 +110,7 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
110
110
|
group,
|
|
111
111
|
command: {
|
|
112
112
|
id: "update.install",
|
|
113
|
-
title: ( localize(
|
|
113
|
+
title: ( localize(16316, "Install Update... (1)"))
|
|
114
114
|
},
|
|
115
115
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Downloaded))
|
|
116
116
|
});
|
|
@@ -118,17 +118,26 @@ function appendUpdateMenuItems(menuId, group) {
|
|
|
118
118
|
group,
|
|
119
119
|
command: {
|
|
120
120
|
id: "update.updating",
|
|
121
|
-
title: ( localize(
|
|
121
|
+
title: ( localize(16317, "Installing Update...")),
|
|
122
122
|
precondition: ( ContextKeyExpr.false())
|
|
123
123
|
},
|
|
124
124
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Updating))
|
|
125
125
|
});
|
|
126
|
+
MenuRegistry.appendMenuItem(menuId, {
|
|
127
|
+
group,
|
|
128
|
+
command: {
|
|
129
|
+
id: "update.cancelling",
|
|
130
|
+
title: ( localize(16318, "Cancelling Update...")),
|
|
131
|
+
precondition: ( ContextKeyExpr.false())
|
|
132
|
+
},
|
|
133
|
+
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Cancelling))
|
|
134
|
+
});
|
|
126
135
|
MenuRegistry.appendMenuItem(menuId, {
|
|
127
136
|
group,
|
|
128
137
|
order: 2,
|
|
129
138
|
command: {
|
|
130
139
|
id: "update.restart",
|
|
131
|
-
title: ( localize(
|
|
140
|
+
title: ( localize(16319, "Restart to Update (1)"))
|
|
132
141
|
},
|
|
133
142
|
when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Ready))
|
|
134
143
|
});
|
|
@@ -170,12 +179,12 @@ let ProductContribution = class ProductContribution {
|
|
|
170
179
|
if (shouldShowReleaseNotes && !shouldShowPostInstallInfo && !environmentService.skipReleaseNotes && releaseNotesUrl && lastVersion && currentVersion && isMajorMinorUpdate(lastVersion, currentVersion)) {
|
|
171
180
|
showReleaseNotesInEditor(instantiationService, productService.version, false).then(undefined, () => {
|
|
172
181
|
notificationService.prompt(Severity.Info, ( localize(
|
|
173
|
-
|
|
182
|
+
16320,
|
|
174
183
|
"Welcome to {0} v{1}! Would you like to read the Release Notes?",
|
|
175
184
|
productService.nameLong,
|
|
176
185
|
productService.version
|
|
177
186
|
)), [{
|
|
178
|
-
label: ( localize(
|
|
187
|
+
label: ( localize(16321, "Release Notes")),
|
|
179
188
|
run: () => {
|
|
180
189
|
const uri = ( URI.parse(releaseNotesUrl));
|
|
181
190
|
openerService.open(uri);
|
|
@@ -199,16 +208,20 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
199
208
|
constructor(
|
|
200
209
|
storageService,
|
|
201
210
|
instantiationService,
|
|
211
|
+
dialogService,
|
|
202
212
|
updateService,
|
|
203
213
|
activityService,
|
|
204
214
|
contextKeyService,
|
|
205
|
-
productService
|
|
215
|
+
productService,
|
|
216
|
+
hostService
|
|
206
217
|
) {
|
|
207
218
|
super();
|
|
208
219
|
this.instantiationService = instantiationService;
|
|
220
|
+
this.dialogService = dialogService;
|
|
209
221
|
this.updateService = updateService;
|
|
210
222
|
this.activityService = activityService;
|
|
211
223
|
this.productService = productService;
|
|
224
|
+
this.hostService = hostService;
|
|
212
225
|
this.badgeDisposable = this._register(( new MutableDisposable()));
|
|
213
226
|
this.state = updateService.state;
|
|
214
227
|
this.updateStateContextKey = CONTEXT_UPDATE_STATE.bindTo(contextKeyService);
|
|
@@ -226,6 +239,11 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
226
239
|
async onUpdateStateChange(state) {
|
|
227
240
|
this.updateStateContextKey.set(state.type);
|
|
228
241
|
switch (state.type) {
|
|
242
|
+
case StateType.Idle:
|
|
243
|
+
if (state.notAvailable && !state.error && (await this.hostService.hadLastFocus())) {
|
|
244
|
+
this.dialogService.info(( localize(16322, "There are currently no updates available.")));
|
|
245
|
+
}
|
|
246
|
+
break;
|
|
229
247
|
case StateType.Ready:
|
|
230
248
|
{
|
|
231
249
|
const productVersion = state.update.productVersion;
|
|
@@ -241,13 +259,15 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
241
259
|
}
|
|
242
260
|
let badge = undefined;
|
|
243
261
|
if (state.type === StateType.AvailableForDownload || state.type === StateType.Downloaded || state.type === StateType.Ready) {
|
|
244
|
-
badge = ( new NumberBadge(1, () => ( localize(
|
|
262
|
+
badge = ( new NumberBadge(1, () => ( localize(16323, "New {0} update available.", this.productService.nameShort))));
|
|
245
263
|
} else if (state.type === StateType.CheckingForUpdates) {
|
|
246
|
-
badge = ( new ProgressBadge(() => ( localize(
|
|
264
|
+
badge = ( new ProgressBadge(() => ( localize(16324, "Checking for {0} updates...", this.productService.nameShort))));
|
|
247
265
|
} else if (state.type === StateType.Downloading || state.type === StateType.Overwriting) {
|
|
248
|
-
badge = ( new ProgressBadge(() => ( localize(
|
|
266
|
+
badge = ( new ProgressBadge(() => ( localize(16325, "Downloading {0} update...", this.productService.nameShort))));
|
|
249
267
|
} else if (state.type === StateType.Updating) {
|
|
250
|
-
badge = ( new ProgressBadge(() => ( localize(
|
|
268
|
+
badge = ( new ProgressBadge(() => ( localize(16326, "Updating {0}...", this.productService.nameShort))));
|
|
269
|
+
} else if (state.type === StateType.Cancelling) {
|
|
270
|
+
badge = ( new ProgressBadge(() => ( localize(16327, "Cancelling {0} update...", this.productService.nameShort))));
|
|
251
271
|
}
|
|
252
272
|
this.badgeDisposable.clear();
|
|
253
273
|
if (badge) {
|
|
@@ -264,6 +284,7 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
264
284
|
CommandsRegistry.registerCommand("update.downloading", () => {});
|
|
265
285
|
CommandsRegistry.registerCommand("update.install", () => this.updateService.applyUpdate());
|
|
266
286
|
CommandsRegistry.registerCommand("update.updating", () => {});
|
|
287
|
+
CommandsRegistry.registerCommand("update.cancelling", () => {});
|
|
267
288
|
CommandsRegistry.registerCommand("update.restart", () => this.updateService.quitAndInstall());
|
|
268
289
|
CommandsRegistry.registerCommand("_update.state", () => {
|
|
269
290
|
return this.state;
|
|
@@ -284,14 +305,14 @@ let UpdateContribution = class UpdateContribution extends Disposable {
|
|
|
284
305
|
order: 1,
|
|
285
306
|
command: {
|
|
286
307
|
id: "update.showUpdateReleaseNotes",
|
|
287
|
-
title: ( localize(
|
|
308
|
+
title: ( localize(16328, "Show Update Release Notes"))
|
|
288
309
|
},
|
|
289
310
|
when: ( ContextKeyExpr.and(( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Ready)), MAJOR_MINOR_UPDATE_AVAILABLE))
|
|
290
311
|
});
|
|
291
312
|
}
|
|
292
313
|
}
|
|
293
314
|
};
|
|
294
|
-
UpdateContribution = ( __decorate([( __param(0, IStorageService)), ( __param(1, IInstantiationService)), ( __param(2,
|
|
315
|
+
UpdateContribution = ( __decorate([( __param(0, IStorageService)), ( __param(1, IInstantiationService)), ( __param(2, IDialogService)), ( __param(3, IUpdateService)), ( __param(4, IActivityService)), ( __param(5, IContextKeyService)), ( __param(6, IProductService)), ( __param(7, IHostService))], UpdateContribution));
|
|
295
316
|
let SwitchProductQualityContribution = class SwitchProductQualityContribution extends Disposable {
|
|
296
317
|
constructor(productService, environmentService) {
|
|
297
318
|
super();
|
|
@@ -310,7 +331,7 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
|
|
|
310
331
|
constructor() {
|
|
311
332
|
super({
|
|
312
333
|
id: commandId,
|
|
313
|
-
title: isSwitchingToInsiders ? ( localize(
|
|
334
|
+
title: isSwitchingToInsiders ? ( localize(16329, "Switch to Insiders Version...")) : ( localize(16330, "Switch to Stable Version...")),
|
|
314
335
|
precondition: IsWebContext,
|
|
315
336
|
menu: {
|
|
316
337
|
id: MenuId.GlobalActivity,
|
|
@@ -348,15 +369,15 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
|
|
|
348
369
|
}
|
|
349
370
|
const res = await dialogService.confirm({
|
|
350
371
|
type: "info",
|
|
351
|
-
message: ( localize(
|
|
372
|
+
message: ( localize(16331, "Changing the version requires a reload to take effect")),
|
|
352
373
|
detail: newQuality === "insider" ? ( localize(
|
|
353
|
-
|
|
374
|
+
16332,
|
|
354
375
|
"Press the reload button to switch to the Insiders version of VS Code."
|
|
355
376
|
)) : ( localize(
|
|
356
|
-
|
|
377
|
+
16333,
|
|
357
378
|
"Press the reload button to switch to the Stable version of VS Code."
|
|
358
379
|
)),
|
|
359
|
-
primaryButton: ( localize(
|
|
380
|
+
primaryButton: ( localize(16334, "&&Reload"))
|
|
360
381
|
});
|
|
361
382
|
if (res.confirmed) {
|
|
362
383
|
const promises = [];
|
|
@@ -386,18 +407,18 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
|
|
|
386
407
|
} = await dialogService.prompt({
|
|
387
408
|
type: Severity.Info,
|
|
388
409
|
message: ( localize(
|
|
389
|
-
|
|
410
|
+
16335,
|
|
390
411
|
"Choose the settings sync service to use after changing the version"
|
|
391
412
|
)),
|
|
392
413
|
detail: ( localize(
|
|
393
|
-
|
|
414
|
+
16336,
|
|
394
415
|
"The Insiders version of VS Code will synchronize your settings, keybindings, extensions, snippets and UI State using separate insiders settings sync service by default."
|
|
395
416
|
)),
|
|
396
417
|
buttons: [{
|
|
397
|
-
label: ( localize(
|
|
418
|
+
label: ( localize(16337, "&&Insiders")),
|
|
398
419
|
run: () => "insiders"
|
|
399
420
|
}, {
|
|
400
|
-
label: ( localize(
|
|
421
|
+
label: ( localize(16338, "&&Stable (current)")),
|
|
401
422
|
run: () => "stable"
|
|
402
423
|
}],
|
|
403
424
|
cancelButton: true
|
|
@@ -5,9 +5,9 @@ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/l
|
|
|
5
5
|
import { IActionViewItemService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/actionViewItemService.service";
|
|
6
6
|
import { IMenuItem, MenuId } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
|
|
7
7
|
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
8
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
8
9
|
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
9
10
|
import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
|
|
10
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
11
11
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
12
12
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
13
13
|
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
@@ -21,7 +21,6 @@ export declare function registerUpdateTitleBarMenuPlacement(menuId: MenuId, item
|
|
|
21
21
|
* Displays update status and actions in the title bar.
|
|
22
22
|
*/
|
|
23
23
|
export declare class UpdateTitleBarContribution extends Disposable implements IWorkbenchContribution {
|
|
24
|
-
private readonly chatService;
|
|
25
24
|
private readonly configurationService;
|
|
26
25
|
private readonly hostService;
|
|
27
26
|
private readonly storageService;
|
|
@@ -30,11 +29,9 @@ export declare class UpdateTitleBarContribution extends Disposable implements IW
|
|
|
30
29
|
private state;
|
|
31
30
|
private entry;
|
|
32
31
|
private tooltipVisible;
|
|
33
|
-
private readonly pendingShow;
|
|
34
32
|
constructor(actionViewItemService: IActionViewItemService, chatService: IChatService, configurationService: IConfigurationService, contextKeyService: IContextKeyService, hostService: IHostService, instantiationService: IInstantiationService, storageService: IStorageService, updateService: IUpdateService);
|
|
35
33
|
private createEntry;
|
|
36
34
|
private onStateChange;
|
|
37
|
-
private setContextWhenChatIdle;
|
|
38
35
|
}
|
|
39
36
|
/**
|
|
40
37
|
* Custom action view item for the update indicator in the title bar.
|
|
@@ -3,17 +3,17 @@ import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
|
3
3
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
4
|
import { append, $, scheduleAtNextAnimationFrame, getWindow, clearNode } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
5
5
|
import { BaseActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionViewItems';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
6
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
8
8
|
import { isWeb } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
9
9
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
10
10
|
import { IActionViewItemService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/actionViewItemService.service';
|
|
11
11
|
import { registerAction2, Action2, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
12
12
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
13
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
13
14
|
import { RawContextKey, ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
14
15
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
15
16
|
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
16
|
-
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
17
17
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
18
18
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
19
19
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
@@ -24,14 +24,14 @@ import { InEditorZenModeContext } from '@codingame/monaco-vscode-api/vscode/vs/w
|
|
|
24
24
|
import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
|
|
25
25
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
26
26
|
import { computeProgressPercent } from '../common/updateUtils.js';
|
|
27
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
28
27
|
import * as updateTitleBarEntry from './media/updateTitleBarEntry.css';
|
|
29
28
|
import { UpdateTooltip } from './updateTooltip.js';
|
|
30
|
-
import {
|
|
29
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
31
30
|
|
|
32
31
|
registerCss(updateTitleBarEntry);
|
|
33
32
|
const UPDATE_TITLE_BAR_ACTION_ID = "workbench.actions.updateIndicator";
|
|
34
33
|
const UPDATE_TITLE_BAR_CONTEXT = ( new RawContextKey("updateTitleBar", false));
|
|
34
|
+
const UPDATE_TITLE_BAR_CHAT_IN_PROGRESS_CONTEXT = ( new RawContextKey("updateTitleBarChatRequestInProgress", false));
|
|
35
35
|
const DISABLED_REMINDER_LAST_SHOWN_KEY = "update/disabledReminderLastShown";
|
|
36
36
|
const DISABLED_REMINDER_PERIOD = 30 * 24 * 60 * 60 * 1000;
|
|
37
37
|
const UPDATE_TITLE_BAR_SETTING = "update.titleBar";
|
|
@@ -41,18 +41,19 @@ const DETAILED_STATES = [
|
|
|
41
41
|
StateType.CheckingForUpdates,
|
|
42
42
|
StateType.Downloading,
|
|
43
43
|
StateType.Updating,
|
|
44
|
-
StateType.Overwriting
|
|
44
|
+
StateType.Overwriting,
|
|
45
|
+
StateType.Cancelling
|
|
45
46
|
];
|
|
46
47
|
registerAction2(class UpdateIndicatorTitleBarAction extends Action2 {
|
|
47
48
|
constructor() {
|
|
48
49
|
super({
|
|
49
50
|
id: UPDATE_TITLE_BAR_ACTION_ID,
|
|
50
|
-
title: ( localize(
|
|
51
|
+
title: ( localize(16339, "Update")),
|
|
51
52
|
f1: false,
|
|
52
53
|
menu: [{
|
|
53
54
|
id: MenuId.TitleBarAdjacentCenter,
|
|
54
55
|
order: 0,
|
|
55
|
-
when: ( ContextKeyExpr.and(UPDATE_TITLE_BAR_CONTEXT, ( InEditorZenModeContext.negate()), ContextKeyExpr.not("inDebugMode")))
|
|
56
|
+
when: ( ContextKeyExpr.and(UPDATE_TITLE_BAR_CONTEXT, ( InEditorZenModeContext.negate()), ContextKeyExpr.not("inDebugMode"), ( UPDATE_TITLE_BAR_CHAT_IN_PROGRESS_CONTEXT.negate())))
|
|
56
57
|
}]
|
|
57
58
|
});
|
|
58
59
|
}
|
|
@@ -70,17 +71,19 @@ let UpdateTitleBarContribution = class UpdateTitleBarContribution extends Dispos
|
|
|
70
71
|
updateService
|
|
71
72
|
) {
|
|
72
73
|
super();
|
|
73
|
-
this.chatService = chatService;
|
|
74
74
|
this.configurationService = configurationService;
|
|
75
75
|
this.hostService = hostService;
|
|
76
76
|
this.storageService = storageService;
|
|
77
77
|
this.tooltipVisible = false;
|
|
78
|
-
this.pendingShow = this._register(( new MutableDisposable()));
|
|
79
78
|
if (isWeb) {
|
|
80
79
|
return;
|
|
81
80
|
}
|
|
82
81
|
this.context = UPDATE_TITLE_BAR_CONTEXT.bindTo(contextKeyService);
|
|
83
82
|
this.tooltip = this._register(instantiationService.createInstance(UpdateTooltip));
|
|
83
|
+
const chatInProgressContext = UPDATE_TITLE_BAR_CHAT_IN_PROGRESS_CONTEXT.bindTo(contextKeyService);
|
|
84
|
+
this._register(autorun(reader => {
|
|
85
|
+
chatInProgressContext.set(chatService.requestInProgressObs.read(reader));
|
|
86
|
+
}));
|
|
84
87
|
this.state = updateService.state;
|
|
85
88
|
this._register(updateService.onStateChange(state => {
|
|
86
89
|
this.state = state;
|
|
@@ -111,21 +114,17 @@ let UpdateTitleBarContribution = class UpdateTitleBarContribution extends Dispos
|
|
|
111
114
|
return this.entry;
|
|
112
115
|
}
|
|
113
116
|
async onStateChange(startup = false) {
|
|
114
|
-
this.pendingShow.clear();
|
|
115
117
|
if (this.configurationService.getValue(UPDATE_TITLE_BAR_SETTING) === false) {
|
|
116
118
|
this.context.set(false);
|
|
117
119
|
return;
|
|
118
120
|
}
|
|
119
|
-
if (ACTIONABLE_STATES.includes(this.state.type)) {
|
|
120
|
-
await this.setContextWhenChatIdle(true);
|
|
121
|
-
} else {
|
|
122
|
-
this.context.set(false);
|
|
123
|
-
}
|
|
124
121
|
if (this.tooltipVisible || !(await this.hostService.hadLastFocus())) {
|
|
122
|
+
this.context.set(ACTIONABLE_STATES.includes(this.state.type));
|
|
125
123
|
this.tooltip.renderState(this.state);
|
|
126
124
|
return;
|
|
127
125
|
}
|
|
128
126
|
this.tooltip.renderState(this.state);
|
|
127
|
+
let context = ACTIONABLE_STATES.includes(this.state.type);
|
|
129
128
|
let showTooltip = false;
|
|
130
129
|
switch (this.state.type) {
|
|
131
130
|
case StateType.Disabled:
|
|
@@ -143,15 +142,21 @@ let UpdateTitleBarContribution = class UpdateTitleBarContribution extends Dispos
|
|
|
143
142
|
case StateType.Downloading:
|
|
144
143
|
case StateType.Updating:
|
|
145
144
|
case StateType.Overwriting:
|
|
146
|
-
|
|
145
|
+
context = this.state.explicit;
|
|
146
|
+
break;
|
|
147
|
+
case StateType.Cancelling:
|
|
148
|
+
context = true;
|
|
147
149
|
break;
|
|
148
150
|
case StateType.Restarting:
|
|
149
|
-
|
|
151
|
+
context = true;
|
|
150
152
|
break;
|
|
151
153
|
}
|
|
152
154
|
if (showTooltip) {
|
|
153
155
|
this.tooltipVisible = true;
|
|
154
|
-
|
|
156
|
+
context = true;
|
|
157
|
+
}
|
|
158
|
+
this.context.set(context);
|
|
159
|
+
if (showTooltip) {
|
|
155
160
|
this.entry?.showTooltip();
|
|
156
161
|
if (this.state.type === StateType.Disabled) {
|
|
157
162
|
this.storageService.store(
|
|
@@ -163,23 +168,6 @@ let UpdateTitleBarContribution = class UpdateTitleBarContribution extends Dispos
|
|
|
163
168
|
}
|
|
164
169
|
}
|
|
165
170
|
}
|
|
166
|
-
async setContextWhenChatIdle(value) {
|
|
167
|
-
if (!this.chatService.requestInProgressObs.get()) {
|
|
168
|
-
this.context.set(value);
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
const cts = ( new CancellationTokenSource());
|
|
172
|
-
this.pendingShow.value = toDisposable(() => cts.dispose(true));
|
|
173
|
-
try {
|
|
174
|
-
await waitForState(
|
|
175
|
-
this.chatService.requestInProgressObs,
|
|
176
|
-
inProgress => !inProgress,
|
|
177
|
-
undefined,
|
|
178
|
-
cts.token
|
|
179
|
-
);
|
|
180
|
-
this.context.set(value);
|
|
181
|
-
} catch {}
|
|
182
|
-
}
|
|
183
171
|
};
|
|
184
172
|
UpdateTitleBarContribution = ( __decorate([( __param(0, IActionViewItemService)), ( __param(1, IChatService)), ( __param(2, IConfigurationService)), ( __param(3, IContextKeyService)), ( __param(4, IHostService)), ( __param(5, IInstantiationService)), ( __param(6, IStorageService)), ( __param(7, IUpdateService))], UpdateTitleBarContribution));
|
|
185
173
|
let UpdateTitleBarEntry = class UpdateTitleBarEntry extends BaseActionViewItem {
|
|
@@ -273,43 +261,47 @@ let UpdateTitleBarEntry = class UpdateTitleBarEntry extends BaseActionViewItem {
|
|
|
273
261
|
const label = append(this.content, $(".indicator-label"));
|
|
274
262
|
switch (state.type) {
|
|
275
263
|
case StateType.Disabled:
|
|
276
|
-
label.textContent = ( localize(
|
|
264
|
+
label.textContent = ( localize(16340, "Update"));
|
|
277
265
|
this.content.classList.add("update-disabled");
|
|
278
266
|
break;
|
|
279
267
|
case StateType.CheckingForUpdates:
|
|
280
|
-
label.textContent = ( localize(
|
|
268
|
+
label.textContent = ( localize(16341, "Checking..."));
|
|
281
269
|
this.renderProgressState(this.content);
|
|
282
270
|
break;
|
|
283
271
|
case StateType.Overwriting:
|
|
284
|
-
label.textContent = ( localize(
|
|
272
|
+
label.textContent = ( localize(16342, "Updating..."));
|
|
285
273
|
this.renderProgressState(this.content);
|
|
286
274
|
break;
|
|
287
275
|
case StateType.AvailableForDownload:
|
|
288
276
|
case StateType.Downloaded:
|
|
289
277
|
case StateType.Ready:
|
|
290
|
-
label.textContent = ( localize(
|
|
278
|
+
label.textContent = ( localize(16340, "Update"));
|
|
291
279
|
this.content.classList.add("prominent");
|
|
292
280
|
break;
|
|
293
281
|
case StateType.Downloading:
|
|
294
|
-
label.textContent = ( localize(
|
|
282
|
+
label.textContent = ( localize(16343, "Downloading..."));
|
|
295
283
|
this.renderProgressState(
|
|
296
284
|
this.content,
|
|
297
285
|
computeProgressPercent(state.downloadedBytes, state.totalBytes)
|
|
298
286
|
);
|
|
299
287
|
break;
|
|
300
288
|
case StateType.Updating:
|
|
301
|
-
label.textContent = ( localize(
|
|
289
|
+
label.textContent = ( localize(16344, "Installing..."));
|
|
302
290
|
this.renderProgressState(
|
|
303
291
|
this.content,
|
|
304
292
|
computeProgressPercent(state.currentProgress, state.maxProgress)
|
|
305
293
|
);
|
|
306
294
|
break;
|
|
307
295
|
case StateType.Restarting:
|
|
308
|
-
label.textContent = ( localize(
|
|
296
|
+
label.textContent = ( localize(16345, "Restarting..."));
|
|
297
|
+
this.renderProgressState(this.content);
|
|
298
|
+
break;
|
|
299
|
+
case StateType.Cancelling:
|
|
300
|
+
label.textContent = ( localize(16346, "Cancelling..."));
|
|
309
301
|
this.renderProgressState(this.content);
|
|
310
302
|
break;
|
|
311
303
|
default:
|
|
312
|
-
label.textContent = ( localize(
|
|
304
|
+
label.textContent = ( localize(16340, "Update"));
|
|
313
305
|
break;
|
|
314
306
|
}
|
|
315
307
|
}
|