@codingame/monaco-vscode-welcome-service-override 34.1.3 → 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/index.js +6 -2
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/onboarding/browser/media/onboardingTarget.css +28 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/media/spotlight.css +147 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/onboarding.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/onboarding.contribution.js +107 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingService.d.ts +122 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingService.js +378 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/onboardingTarget.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/onboardingTarget.js +25 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightOverlay.d.ts +96 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightOverlay.js +381 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightPresentation.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightPresentation.js +205 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightTypes.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightTypes.js +5 -0
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingPresentation.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingPresentation.js +27 -0
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingRegistry.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingRegistry.js +35 -0
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingScenario.d.ts +171 -0
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingScenario.js +20 -0
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingScenarioService.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingScenarioService.js +10 -0
- package/vscode/src/vs/workbench/contrib/welcomeOnboarding/browser/onboardingVariationA.js +64 -64
- package/vscode/src/vs/workbench/contrib/welcomeOnboarding/browser/welcomeOnboarding.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcomeContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcomeExtensionPoint.js +8 -8
package/index.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
3
|
+
import { IOnboardingScenarioService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingScenarioService.service';
|
|
4
|
+
import { OnboardingScenarioService } from './vscode/src/vs/workbench/contrib/onboarding/browser/onboardingService.js';
|
|
2
5
|
import { IOnboardingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/welcomeOnboarding/common/onboardingService.service';
|
|
3
6
|
import { OnboardingVariationA } from './vscode/src/vs/workbench/contrib/welcomeOnboarding/browser/onboardingVariationA.js';
|
|
4
|
-
import
|
|
7
|
+
import './vscode/src/vs/workbench/contrib/onboarding/browser/onboarding.contribution.js';
|
|
5
8
|
import './vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution.js';
|
|
6
9
|
import './vscode/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.js';
|
|
7
10
|
import './vscode/src/vs/workbench/contrib/welcomeOnboarding/browser/welcomeOnboarding.contribution.js';
|
|
8
11
|
|
|
9
12
|
function getServiceOverride() {
|
|
10
13
|
return {
|
|
11
|
-
[IOnboardingService.toString()]: new SyncDescriptor(OnboardingVariationA, [], true)
|
|
14
|
+
[IOnboardingService.toString()]: new SyncDescriptor(OnboardingVariationA, [], true),
|
|
15
|
+
[IOnboardingScenarioService.toString()]: new SyncDescriptor(OnboardingScenarioService, [], true)
|
|
12
16
|
};
|
|
13
17
|
}
|
|
14
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-welcome-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "35.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - welcome service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "35.0.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
6
|
+
.onboarding-target-pulse {
|
|
7
|
+
animation: onboarding-target-pulse 1.4s ease-out infinite;
|
|
8
|
+
outline: var(--vscode-strokeThickness) solid var(--vscode-focusBorder);
|
|
9
|
+
outline-offset: 2px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (prefers-reduced-motion: reduce) {
|
|
13
|
+
.onboarding-target-pulse {
|
|
14
|
+
animation: none;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@keyframes onboarding-target-pulse {
|
|
19
|
+
0% {
|
|
20
|
+
box-shadow: 0 0 0 0 var(--vscode-focusBorder);
|
|
21
|
+
}
|
|
22
|
+
70% {
|
|
23
|
+
box-shadow: 0 0 0 6px transparent;
|
|
24
|
+
}
|
|
25
|
+
100% {
|
|
26
|
+
box-shadow: 0 0 0 0 transparent;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
6
|
+
/* Spotlight overlay: dim everything, cut a highlight hole, anchor a callout. */
|
|
7
|
+
|
|
8
|
+
.spotlight-overlay {
|
|
9
|
+
position: fixed;
|
|
10
|
+
inset: 0;
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
/* Above dialogs (2575) so the onboarding spotlight wins over modal chrome. */
|
|
13
|
+
z-index: 2600;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Full-screen click blocker. Transparent; swallows interaction outside the hole. */
|
|
17
|
+
.spotlight-blocker {
|
|
18
|
+
position: fixed;
|
|
19
|
+
inset: 0;
|
|
20
|
+
pointer-events: auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* The highlight hole. The huge spread box-shadow paints the dim everywhere
|
|
25
|
+
* *outside* this element, while the inset ring highlights the target. Purely
|
|
26
|
+
* visual: it never intercepts pointer events.
|
|
27
|
+
*/
|
|
28
|
+
.spotlight-hole {
|
|
29
|
+
position: fixed;
|
|
30
|
+
border-radius: var(--vscode-cornerRadius-medium);
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
/*
|
|
33
|
+
* The dim color matches the modal scrim (.monaco-dialog-modal-block.dimmed)
|
|
34
|
+
* and the native window-controls dim (windowImpl.ts dimColor, 0.5 black) so
|
|
35
|
+
* the spotlight, the dimmed app and the OS-drawn controls read as one layer.
|
|
36
|
+
*/
|
|
37
|
+
box-shadow:
|
|
38
|
+
0 0 0 9999px rgba(0, 0, 0, 0.5),
|
|
39
|
+
0 0 0 2px var(--vscode-focusBorder) inset;
|
|
40
|
+
transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.spotlight-callout-pointer {
|
|
44
|
+
position: fixed;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
width: var(--vscode-spacing-size100);
|
|
47
|
+
height: var(--vscode-spacing-size100);
|
|
48
|
+
z-index: 1;
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.spotlight-callout-pointer::after {
|
|
53
|
+
content: '';
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
background: var(--vscode-editorWidget-background);
|
|
57
|
+
border-right: var(--vscode-strokeThickness) solid var(--vscode-widget-border, transparent);
|
|
58
|
+
border-bottom: var(--vscode-strokeThickness) solid var(--vscode-widget-border, transparent);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.spotlight-callout-pointer.top::after {
|
|
62
|
+
transform: rotate(225deg);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.spotlight-callout-pointer.right::after {
|
|
66
|
+
transform: rotate(315deg);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.spotlight-callout-pointer.bottom::after {
|
|
70
|
+
transform: rotate(45deg);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.spotlight-callout-pointer.left::after {
|
|
74
|
+
transform: rotate(135deg);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.spotlight-callout {
|
|
78
|
+
position: fixed;
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
z-index: 0;
|
|
81
|
+
width: 320px;
|
|
82
|
+
max-width: calc(100vw - var(--vscode-spacing-size320));
|
|
83
|
+
padding: var(--vscode-spacing-size160);
|
|
84
|
+
background: var(--vscode-editorWidget-background);
|
|
85
|
+
color: var(--vscode-editorWidget-foreground);
|
|
86
|
+
border: var(--vscode-strokeThickness) solid var(--vscode-widget-border, transparent);
|
|
87
|
+
border-radius: var(--vscode-cornerRadius-large);
|
|
88
|
+
box-shadow: 0 2px 8px var(--vscode-widget-shadow, rgba(0, 0, 0, 0.36));
|
|
89
|
+
pointer-events: auto;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.spotlight-callout:focus,
|
|
93
|
+
.spotlight-callout:focus-visible {
|
|
94
|
+
outline: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.spotlight-callout-title {
|
|
98
|
+
margin: 0 0 var(--vscode-spacing-size80) 0;
|
|
99
|
+
font-size: var(--vscode-bodyFontSize);
|
|
100
|
+
font-weight: 600;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.spotlight-callout-description {
|
|
104
|
+
margin: 0;
|
|
105
|
+
font-size: var(--vscode-bodyFontSize);
|
|
106
|
+
line-height: 1.4;
|
|
107
|
+
color: var(--vscode-descriptionForeground);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.spotlight-callout-description p {
|
|
111
|
+
margin: 0 0 var(--vscode-spacing-size80) 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.spotlight-callout-description p:last-child {
|
|
115
|
+
margin-bottom: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.spotlight-callout-footer {
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: space-between;
|
|
122
|
+
gap: var(--vscode-spacing-size120);
|
|
123
|
+
margin-top: var(--vscode-spacing-size160);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.spotlight-callout-counter {
|
|
127
|
+
font-size: var(--vscode-bodyFontSize-small);
|
|
128
|
+
color: var(--vscode-descriptionForeground);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.spotlight-callout-actions {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-wrap: wrap;
|
|
134
|
+
gap: var(--vscode-spacing-size80);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.spotlight-callout-actions .monaco-button {
|
|
138
|
+
width: fit-content;
|
|
139
|
+
white-space: nowrap;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Respect reduced-motion: drop the animated hole transition. */
|
|
143
|
+
@media (prefers-reduced-motion: reduce) {
|
|
144
|
+
.spotlight-hole {
|
|
145
|
+
transition: none;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
|
+
import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
|
|
6
|
+
import { registerAction2, Action2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
7
|
+
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
8
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
9
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
|
+
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
11
|
+
import { workbenchConfigurationNodeBase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/configuration';
|
|
12
|
+
import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
13
|
+
import { onboardingPresentationRegistry } from '../common/onboardingPresentation.js';
|
|
14
|
+
import { onboardingScenarioRegistry } from '../common/onboardingRegistry.js';
|
|
15
|
+
import { ONBOARDING_DEVELOPER_MODE_CONFIG, ONBOARDING_ENABLED_CONFIG } from '../common/onboardingScenarioService.js';
|
|
16
|
+
import { IOnboardingScenarioService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingScenarioService.service';
|
|
17
|
+
import './onboardingService.js';
|
|
18
|
+
import { SpotlightPresentation } from './spotlight/spotlightPresentation.js';
|
|
19
|
+
|
|
20
|
+
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
21
|
+
function buildDeveloperModeConfigurationNode() {
|
|
22
|
+
const properties = {};
|
|
23
|
+
const defaultValue = {};
|
|
24
|
+
for (const id of ( onboardingScenarioRegistry.getScenarios().map(scenario => scenario.id)).sort()) {
|
|
25
|
+
properties[id] = {
|
|
26
|
+
type: "boolean",
|
|
27
|
+
default: false
|
|
28
|
+
};
|
|
29
|
+
defaultValue[id] = false;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
...workbenchConfigurationNodeBase,
|
|
33
|
+
properties: {
|
|
34
|
+
[ONBOARDING_DEVELOPER_MODE_CONFIG]: {
|
|
35
|
+
type: "object",
|
|
36
|
+
default: defaultValue,
|
|
37
|
+
properties,
|
|
38
|
+
additionalProperties: {
|
|
39
|
+
type: "boolean"
|
|
40
|
+
},
|
|
41
|
+
tags: ["experimental"],
|
|
42
|
+
description: ( localize(
|
|
43
|
+
12885,
|
|
44
|
+
"Map of onboarding scenario/tour id to whether developer mode is enabled for it. When enabled for a scenario, that onboarding tour ignores usage-based eligibility checks (such as how many sessions you have started), previously persisted shown state, and any linked experiment (so it is shown even if the experiment is not running or you are in the control group). It does not override the {0} setting. The tour is still shown at most once per window session, so reload the window to show it again.",
|
|
45
|
+
`\`#${ONBOARDING_ENABLED_CONFIG}#\``
|
|
46
|
+
))
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
let developerModeConfigurationNode = buildDeveloperModeConfigurationNode();
|
|
52
|
+
configurationRegistry.registerConfiguration({
|
|
53
|
+
...workbenchConfigurationNodeBase,
|
|
54
|
+
properties: {
|
|
55
|
+
[ONBOARDING_ENABLED_CONFIG]: {
|
|
56
|
+
type: "boolean",
|
|
57
|
+
default: true,
|
|
58
|
+
description: ( localize(
|
|
59
|
+
12886,
|
|
60
|
+
"When enabled, onboarding tours and hints may appear automatically to highlight features. Disabling this does not affect tours you start manually."
|
|
61
|
+
))
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
configurationRegistry.registerConfiguration(developerModeConfigurationNode);
|
|
66
|
+
function refreshDeveloperModeConfiguration() {
|
|
67
|
+
const next = buildDeveloperModeConfigurationNode();
|
|
68
|
+
configurationRegistry.updateConfigurations({
|
|
69
|
+
add: [next],
|
|
70
|
+
remove: [developerModeConfigurationNode]
|
|
71
|
+
});
|
|
72
|
+
developerModeConfigurationNode = next;
|
|
73
|
+
}
|
|
74
|
+
let OnboardingContribution = class OnboardingContribution extends Disposable {
|
|
75
|
+
static {
|
|
76
|
+
this.ID = "workbench.contrib.onboarding";
|
|
77
|
+
}
|
|
78
|
+
constructor(onboardingService, instantiationService) {
|
|
79
|
+
super();
|
|
80
|
+
refreshDeveloperModeConfiguration();
|
|
81
|
+
this._register(
|
|
82
|
+
onboardingScenarioRegistry.onDidChange(() => refreshDeveloperModeConfiguration())
|
|
83
|
+
);
|
|
84
|
+
const spotlight = this._register(instantiationService.createInstance(SpotlightPresentation));
|
|
85
|
+
this._register(onboardingPresentationRegistry.register(spotlight));
|
|
86
|
+
onboardingService.start();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
OnboardingContribution = ( __decorate([( __param(0, IOnboardingScenarioService)), ( __param(1, IInstantiationService))], OnboardingContribution));
|
|
90
|
+
registerWorkbenchContribution2(
|
|
91
|
+
OnboardingContribution.ID,
|
|
92
|
+
OnboardingContribution,
|
|
93
|
+
WorkbenchPhase.AfterRestored
|
|
94
|
+
);
|
|
95
|
+
registerAction2(class extends Action2 {
|
|
96
|
+
constructor() {
|
|
97
|
+
super({
|
|
98
|
+
id: "workbench.action.onboarding.resetShownState",
|
|
99
|
+
title: ( localize2(12887, "Reset Onboarding Shown State")),
|
|
100
|
+
category: Categories.Developer,
|
|
101
|
+
f1: true
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
run(accessor) {
|
|
105
|
+
accessor.get(IOnboardingScenarioService).resetAll();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
3
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
4
|
+
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
5
|
+
import { ILifecycleService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service";
|
|
6
|
+
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
7
|
+
import { IWorkbenchAssignmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/assignment/common/assignmentService.service";
|
|
8
|
+
import { IOnboardingScenario, OnboardingOutcome } from "../common/onboardingScenario.js";
|
|
9
|
+
import { IOnboardingScenarioService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/onboarding/common/onboardingScenarioService.service";
|
|
10
|
+
export declare class OnboardingScenarioService extends Disposable implements IOnboardingScenarioService {
|
|
11
|
+
private readonly storageService;
|
|
12
|
+
private readonly contextKeyService;
|
|
13
|
+
private readonly configurationService;
|
|
14
|
+
private readonly lifecycleService;
|
|
15
|
+
private readonly assignmentService;
|
|
16
|
+
private readonly telemetryService;
|
|
17
|
+
readonly _serviceBrand: undefined;
|
|
18
|
+
private static readonly MEMENTO_ID;
|
|
19
|
+
/**
|
|
20
|
+
* Storage key for the set of assignment-context identifiers whose telemetry gate has been
|
|
21
|
+
* opened (the user reached the onboarding moment). Persisted so the identifier keeps
|
|
22
|
+
* flowing across reloads/relaunches until the experiment is stopped.
|
|
23
|
+
*/
|
|
24
|
+
private static readonly OPENED_IDS_STORAGE_KEY;
|
|
25
|
+
private readonly _memento;
|
|
26
|
+
private readonly _state;
|
|
27
|
+
/** Listeners for `observable` triggers, rebuilt whenever the registry changes. */
|
|
28
|
+
private readonly _triggerListeners;
|
|
29
|
+
/** Scenario ids currently queued or running (prevents double-scheduling). */
|
|
30
|
+
private readonly _pending;
|
|
31
|
+
private readonly _queue;
|
|
32
|
+
/** Deferreds for scenarios that have been dequeued and are currently running, keyed by id. */
|
|
33
|
+
private readonly _inflight;
|
|
34
|
+
private _pumping;
|
|
35
|
+
/** Abort signal for the scenario currently running. */
|
|
36
|
+
private _activeAbort;
|
|
37
|
+
/** Resolved experiment treatment state, keyed by scenario id. */
|
|
38
|
+
private readonly _experimentStates;
|
|
39
|
+
/**
|
|
40
|
+
* Assignment-context ids whose telemetry gate is open. While an onboarding id is *not* in
|
|
41
|
+
* this set, the eagerly-registered filter excludes it from telemetry (see the prefix
|
|
42
|
+
* constant). The set is seeded from storage and grows as users reach the onboarding moment.
|
|
43
|
+
*/
|
|
44
|
+
private readonly _openedAssignmentContextIds;
|
|
45
|
+
private readonly _onDidChangeOpenedIds;
|
|
46
|
+
private _started;
|
|
47
|
+
private _stopped;
|
|
48
|
+
private readonly _shownSinceStart;
|
|
49
|
+
constructor(storageService: IStorageService, contextKeyService: IContextKeyService, configurationService: IConfigurationService, lifecycleService: ILifecycleService, assignmentService: IWorkbenchAssignmentService, telemetryService: ITelemetryService);
|
|
50
|
+
private _stop;
|
|
51
|
+
start(): void;
|
|
52
|
+
getScenarios(): readonly IOnboardingScenario[];
|
|
53
|
+
runScenario(id: string): Promise<OnboardingOutcome>;
|
|
54
|
+
hasBeenShown(id: string): boolean;
|
|
55
|
+
reset(id: string): void;
|
|
56
|
+
resetAll(): void;
|
|
57
|
+
/**
|
|
58
|
+
* The master switch for *automatic* onboarding. When `onboarding.enabled` is
|
|
59
|
+
* explicitly `false`, no scenario ever runs automatically (developer mode does
|
|
60
|
+
* NOT override this — see {@link _evaluate}). Any other value (including unset)
|
|
61
|
+
* is treated as enabled. On-demand {@link runScenario} is intentionally exempt
|
|
62
|
+
* from this switch.
|
|
63
|
+
*/
|
|
64
|
+
private get _enabled();
|
|
65
|
+
private _isDeveloperMode;
|
|
66
|
+
/**
|
|
67
|
+
* Re-evaluate every scenario and enqueue any that are eligible to run
|
|
68
|
+
* automatically. Idempotent: already shown / queued scenarios are skipped.
|
|
69
|
+
*
|
|
70
|
+
* The automatic eligibility rules are:
|
|
71
|
+
* 1. If `onboarding.enabled` is `false`, nothing runs automatically — this
|
|
72
|
+
* method returns immediately, and developer mode does NOT override it.
|
|
73
|
+
* 2. If a scenario declares an `experiment`, it only runs when the experiment
|
|
74
|
+
* is active AND the user is in the treatment arm (see below) — OR when
|
|
75
|
+
* developer mode is enabled for that scenario, which bypasses the experiment
|
|
76
|
+
* gate so the tour can be previewed locally.
|
|
77
|
+
* 3. If a scenario has no `experiment`, it runs for every user that meets its
|
|
78
|
+
* `when`/trigger criteria (the typical state once an experiment has graduated
|
|
79
|
+
* and the tour is rolled out to everyone).
|
|
80
|
+
*
|
|
81
|
+
* For an experiment-active scenario, reaching eligibility *is* the "would-show"
|
|
82
|
+
* moment: the telemetry gate is opened for the experiment's assignment-context id
|
|
83
|
+
* (in both arms), and then only the treatment arm is enqueued to actually show the
|
|
84
|
+
* tour. Control opens the gate but renders nothing and is not marked as shown.
|
|
85
|
+
*
|
|
86
|
+
* Developer mode is the exception: it shows the tour unconditionally and never
|
|
87
|
+
* opens the telemetry gate, so a local preview can never affect the experiment
|
|
88
|
+
* scorecard regardless of which arm the developer happens to be assigned to.
|
|
89
|
+
*/
|
|
90
|
+
private _evaluate;
|
|
91
|
+
private _isAutoEligible;
|
|
92
|
+
private _enqueue;
|
|
93
|
+
private _pump;
|
|
94
|
+
private _doPump;
|
|
95
|
+
private _runPresentation;
|
|
96
|
+
/** Emit per-tour telemetry. Only called when a tour was actually shown. */
|
|
97
|
+
private _reportOutcome;
|
|
98
|
+
private _registerTriggerListeners;
|
|
99
|
+
/**
|
|
100
|
+
* Resolve the two experiment treatment flags for each scenario that declares an experiment.
|
|
101
|
+
* The experiment is only active when both resolve: the boolean to a boolean and the id to a
|
|
102
|
+
* non-empty string that starts with {@link ONBOARDING_ASSIGNMENT_CONTEXT_PREFIX}. Resolved
|
|
103
|
+
* once per scenario; re-evaluation is triggered when an experiment becomes active.
|
|
104
|
+
*/
|
|
105
|
+
private _resolveExperiments;
|
|
106
|
+
private _loadOpenedIds;
|
|
107
|
+
/**
|
|
108
|
+
* Open the telemetry gate for an assignment-context id: from now on (and after reload) the
|
|
109
|
+
* id is no longer filtered out, so every event carries it. Idempotent.
|
|
110
|
+
*/
|
|
111
|
+
private _openGate;
|
|
112
|
+
/**
|
|
113
|
+
* The key under which a scenario's once-per-user "shown" state is stored.
|
|
114
|
+
* Scenarios may opt into a shared {@link IOnboardingScenario.seenKey} so that
|
|
115
|
+
* variations of the same onboarding are gated together; otherwise the
|
|
116
|
+
* scenario id is used.
|
|
117
|
+
*/
|
|
118
|
+
private _seenKey;
|
|
119
|
+
private _hasBeenShownKey;
|
|
120
|
+
private _markShown;
|
|
121
|
+
private _recordOutcome;
|
|
122
|
+
}
|