@codingame/monaco-vscode-welcome-service-override 37.2.0 → 37.3.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/common.d.ts +2 -0
- package/common.js +15 -0
- package/index.js +3 -7
- package/package.json +11 -3
- package/session.d.ts +2 -0
- package/session.js +10 -0
- package/vscode/src/vs/workbench/contrib/onboarding/browser/onboarding.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/onboarding/browser/onboardingService.js +5 -5
- package/vscode/src/vs/workbench/contrib/onboarding/browser/sequence/sequencePresentation.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/onboarding/browser/sequence/sequencePresentation.js +2 -2
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightOverlay.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightOverlay.js +9 -9
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightPresentation.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightPresentation.js +7 -4
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingPresentation.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.js +21 -21
- package/vscode/src/vs/workbench/contrib/welcomeOnboarding/browser/onboardingVariationA.js +55 -55
- package/vscode/src/vs/workbench/contrib/welcomeOnboarding/browser/welcomeOnboarding.contribution.js +2 -2
- 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/vscode/src/vs/workbench/contrib/onboarding/browser/media/onboardingTarget.css +0 -28
- package/vscode/src/vs/workbench/contrib/onboarding/browser/sequence/runOnboardingStep.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/onboarding/browser/sequence/runOnboardingStep.js +0 -32
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/onboardingTarget.d.ts +0 -37
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/onboardingTarget.js +0 -29
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightTypes.d.ts +0 -67
- package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightTypes.js +0 -5
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingRegistry.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingRegistry.js +0 -35
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingScenario.d.ts +0 -172
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingScenario.js +0 -20
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingScenarioService.d.ts +0 -48
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingScenarioService.js +0 -11
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingSequence.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/onboarding/common/onboardingSequence.js +0 -29
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import * as onboardingTarget from '../media/onboardingTarget.css';
|
|
5
|
-
|
|
6
|
-
registerCss(onboardingTarget);
|
|
7
|
-
const ONBOARDING_TARGET_ATTR = "data-onboarding-id";
|
|
8
|
-
const onboardingTargetRegistrations = ( new WeakMap());
|
|
9
|
-
function openOnboardingTarget(element) {
|
|
10
|
-
return onboardingTargetRegistrations.get(element)?.options.open?.();
|
|
11
|
-
}
|
|
12
|
-
function findOnboardingTarget(targetWindow, id) {
|
|
13
|
-
const selector = `[${ONBOARDING_TARGET_ATTR}="${CSS.escape(id)}"]`;
|
|
14
|
-
const targets = Array.from(targetWindow.document.querySelectorAll(selector));
|
|
15
|
-
return targets.find(target => isVisibleOnboardingTarget(targetWindow, target));
|
|
16
|
-
}
|
|
17
|
-
function isVisibleOnboardingTarget(targetWindow, target) {
|
|
18
|
-
if (!target.isConnected) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
const style = targetWindow.getComputedStyle(target);
|
|
22
|
-
if (style.display === "none" || style.visibility === "hidden") {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
const rect = target.getBoundingClientRect();
|
|
26
|
-
return rect.width > 0 && rect.height > 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { ONBOARDING_TARGET_ATTR, findOnboardingTarget, openOnboardingTarget };
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { IMarkdownString } from "@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent";
|
|
2
|
-
import { ContextKeyExpression } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey";
|
|
3
|
-
/** The presentation `kind` handled by the spotlight presentation. */
|
|
4
|
-
export declare const SPOTLIGHT_PRESENTATION_KIND = "spotlight";
|
|
5
|
-
/** Preferred placement of the callout relative to the spotlighted target. */
|
|
6
|
-
export type SpotlightPlacement = "above" | "below" | "left" | "right" | "auto";
|
|
7
|
-
/** `advanceOnly` consumes target activation instead of running the target's action. */
|
|
8
|
-
export type SpotlightTargetClickBehavior = boolean | "advanceOnly";
|
|
9
|
-
/** Behavior when a spotlight target is not rendered when its step is reached. */
|
|
10
|
-
export type SpotlightMissingTargetBehavior = {
|
|
11
|
-
readonly kind: "skip";
|
|
12
|
-
} | {
|
|
13
|
-
readonly kind: "abort";
|
|
14
|
-
} | {
|
|
15
|
-
readonly kind: "wait";
|
|
16
|
-
readonly timeoutMs: number;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* A single step in a spotlight tour. Steps are pure data; the spotlight
|
|
20
|
-
* presentation turns them into the dim overlay, the cut-out highlight and the
|
|
21
|
-
* anchored callout.
|
|
22
|
-
*/
|
|
23
|
-
export interface ISpotlightStep {
|
|
24
|
-
/** Stable identifier (unique within the tour). */
|
|
25
|
-
readonly id: string;
|
|
26
|
-
/**
|
|
27
|
-
* The `data-onboarding-id` of the element to spotlight. Resolved on demand
|
|
28
|
-
* via {@link findOnboardingTarget} so steps work even if the element is not
|
|
29
|
-
* yet rendered when the tour starts.
|
|
30
|
-
*/
|
|
31
|
-
readonly targetId: string;
|
|
32
|
-
/** Callout heading (localized). */
|
|
33
|
-
readonly title: string;
|
|
34
|
-
/** Callout body (localized string or markdown). */
|
|
35
|
-
readonly description: string | IMarkdownString;
|
|
36
|
-
/** Localized primary button label, replacing the default Next or Done. */
|
|
37
|
-
readonly nextButtonLabel?: string;
|
|
38
|
-
/** Preferred placement of the callout. Defaults to `'auto'`. */
|
|
39
|
-
readonly placement?: SpotlightPlacement;
|
|
40
|
-
/** When present and unsatisfied, the step is skipped. */
|
|
41
|
-
readonly when?: ContextKeyExpression;
|
|
42
|
-
/** Defaults to waiting two seconds before skipping; `abort` ends the run immediately if the target is missing. */
|
|
43
|
-
readonly missingTarget?: SpotlightMissingTargetBehavior;
|
|
44
|
-
/** Opens or expands the target through its owner before the step begins. */
|
|
45
|
-
readonly openTarget?: boolean;
|
|
46
|
-
/** Allow the spotlighted element to remain interactive. Defaults to `false`. */
|
|
47
|
-
readonly allowTargetInteraction?: boolean;
|
|
48
|
-
/** Advances on target activation; `advanceOnly` consumes the activation without running its action. */
|
|
49
|
-
readonly advanceOnTargetClick?: SpotlightTargetClickBehavior;
|
|
50
|
-
/** Overrides hiding Next when advancing on target clicks. `advanceWhen` always hides Next. */
|
|
51
|
-
readonly hideNext?: boolean;
|
|
52
|
-
/** Hides Next and advances once this context expression becomes satisfied. */
|
|
53
|
-
readonly advanceWhen?: ContextKeyExpression;
|
|
54
|
-
/** Extra padding (px) around the target when cutting the highlight hole. */
|
|
55
|
-
readonly padding?: number;
|
|
56
|
-
/**
|
|
57
|
-
* Optional hook run just before the step is shown, e.g. to open the view
|
|
58
|
-
* that hosts the target. Awaited before the target is resolved.
|
|
59
|
-
*/
|
|
60
|
-
readonly onBeforeShow?: () => Promise<void> | void;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* The payload of a spotlight scenario: an ordered list of steps.
|
|
64
|
-
*/
|
|
65
|
-
export interface ISpotlightPayload {
|
|
66
|
-
readonly steps: readonly ISpotlightStep[];
|
|
67
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
|
-
import { IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
-
import { IOnboardingScenario } from "./onboardingScenario.js";
|
|
4
|
-
/**
|
|
5
|
-
* Registry of onboarding scenarios. Feature areas register their scenarios here
|
|
6
|
-
* (pure data); the engine reads from it to decide what to run.
|
|
7
|
-
*/
|
|
8
|
-
export interface IOnboardingScenarioRegistry {
|
|
9
|
-
/** Register a scenario. Throws if a scenario with the same id already exists. */
|
|
10
|
-
register(scenario: IOnboardingScenario): IDisposable;
|
|
11
|
-
/** All currently registered scenarios. */
|
|
12
|
-
getScenarios(): readonly IOnboardingScenario[];
|
|
13
|
-
/** Look up a single scenario by id. */
|
|
14
|
-
getScenario(id: string): IOnboardingScenario | undefined;
|
|
15
|
-
/** Fires when scenarios are added or removed. */
|
|
16
|
-
readonly onDidChange: Event<void>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Global scenario registry. Scenario data files register here on import.
|
|
20
|
-
*/
|
|
21
|
-
export declare const onboardingScenarioRegistry: IOnboardingScenarioRegistry;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
3
|
-
|
|
4
|
-
class OnboardingScenarioRegistry {
|
|
5
|
-
constructor() {
|
|
6
|
-
this._scenarios = ( new Map());
|
|
7
|
-
this._onDidChange = ( new Emitter());
|
|
8
|
-
this.onDidChange = this._onDidChange.event;
|
|
9
|
-
}
|
|
10
|
-
register(scenario) {
|
|
11
|
-
const id = scenario.id;
|
|
12
|
-
if (( this._scenarios.has(id))) {
|
|
13
|
-
throw ( new Error(`An onboarding scenario with id '${id}' is already registered.`));
|
|
14
|
-
}
|
|
15
|
-
this._scenarios.set(id, scenario);
|
|
16
|
-
this._onDidChange.fire();
|
|
17
|
-
return {
|
|
18
|
-
dispose: () => {
|
|
19
|
-
if (this._scenarios.get(id) === scenario) {
|
|
20
|
-
this._scenarios.delete(id);
|
|
21
|
-
this._onDidChange.fire();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
getScenarios() {
|
|
27
|
-
return Array.from(( this._scenarios.values()));
|
|
28
|
-
}
|
|
29
|
-
getScenario(id) {
|
|
30
|
-
return this._scenarios.get(id);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const onboardingScenarioRegistry = ( new OnboardingScenarioRegistry());
|
|
34
|
-
|
|
35
|
-
export { onboardingScenarioRegistry };
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
2
|
-
import { ContextKeyExpression } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey";
|
|
3
|
-
/**
|
|
4
|
-
* Describes when an onboarding scenario becomes eligible to run automatically.
|
|
5
|
-
*/
|
|
6
|
-
export type OnboardingTrigger =
|
|
7
|
-
/** Eligible as soon as the scenario's `when` clause is satisfied. */
|
|
8
|
-
{
|
|
9
|
-
readonly kind: "auto";
|
|
10
|
-
}
|
|
11
|
-
/** Only started explicitly via a command (never runs automatically). */
|
|
12
|
-
| {
|
|
13
|
-
readonly kind: "command";
|
|
14
|
-
readonly commandId: string;
|
|
15
|
-
}
|
|
16
|
-
/** Eligible whenever the provided observable yields `true`. */
|
|
17
|
-
| {
|
|
18
|
-
readonly kind: "observable";
|
|
19
|
-
readonly signal: IObservable<boolean>;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* A reference to a registered {@link IOnboardingPresentation} together with the
|
|
23
|
-
* opaque payload that presentation understands (e.g. spotlight steps).
|
|
24
|
-
*/
|
|
25
|
-
export interface IOnboardingPresentationRef<TPayload = unknown> {
|
|
26
|
-
/** The presentation kind, e.g. `'spotlight'`. */
|
|
27
|
-
readonly kind: string;
|
|
28
|
-
/** Presentation-specific data. The engine never inspects this. */
|
|
29
|
-
readonly payload: TPayload;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Reserved prefix that every onboarding experiment's **assignment-context identifier** must
|
|
33
|
-
* use (for example `onb-newsession-2026q3`).
|
|
34
|
-
*
|
|
35
|
-
* ### Why this exists
|
|
36
|
-
* The experimentation platform stamps every telemetry event with the user's assignment
|
|
37
|
-
* context as soon as the assignments are fetched at startup. For onboarding experiments we
|
|
38
|
-
* must *not* emit the identifier until the user actually reaches the point where the
|
|
39
|
-
* onboarding would be shown — otherwise the scorecard counts activity from before the
|
|
40
|
-
* experiment could have had any effect.
|
|
41
|
-
*
|
|
42
|
-
* The treatment flags that tell the client *which* variant belongs to a given tour resolve
|
|
43
|
-
* asynchronously, after the assignment context has already been committed to telemetry, so
|
|
44
|
-
* they are too late to block the very first events. This prefix solves that race: because it
|
|
45
|
-
* is a *static, well-known* string, the client can pre-emptively exclude **any**
|
|
46
|
-
* assignment-context entry that starts with it from the very first event, and then
|
|
47
|
-
* selectively unblock the one specific variant once the user reaches the onboarding moment.
|
|
48
|
-
*
|
|
49
|
-
* ### Contract for experiment authors
|
|
50
|
-
* - Every onboarding experiment configured in ExP MUST use variant names beginning with this
|
|
51
|
-
* prefix.
|
|
52
|
-
* - Each arm's variant name MUST be returned by the experiment's
|
|
53
|
-
* {@link IOnboardingExperiment.assignmentContextIdFlag} treatment flag.
|
|
54
|
-
*
|
|
55
|
-
* The engine enforces this defensively: an id that lacks the prefix is rejected (the experiment
|
|
56
|
-
* is treated as inactive and the misconfiguration is reported via `onUnexpectedError`) so a bad
|
|
57
|
-
* id can never leak into telemetry ungated. A prefixed id that is never claimed by a registered
|
|
58
|
-
* tour simply stays blocked forever.
|
|
59
|
-
*/
|
|
60
|
-
export declare const ONBOARDING_ASSIGNMENT_CONTEXT_PREFIX = "onb-";
|
|
61
|
-
/**
|
|
62
|
-
* Experiment configuration for an onboarding scenario. The two treatment flag *names* are
|
|
63
|
-
* resolved against the experimentation service; the experiment is only considered **active**
|
|
64
|
-
* when *both* resolve: the boolean to a boolean and the id to a non-empty string that starts
|
|
65
|
-
* with {@link ONBOARDING_ASSIGNMENT_CONTEXT_PREFIX}. If either flag is missing or the id lacks
|
|
66
|
-
* the required prefix, the experiment is **inactive** and the scenario does not run
|
|
67
|
-
* automatically (it can still be started explicitly via a command/`runScenario`, which
|
|
68
|
-
* bypasses experiment gating and does not open the telemetry gate; or by enabling
|
|
69
|
-
* `onboarding.developerMode` for the scenario, which previews the tour without opening the
|
|
70
|
-
* telemetry gate).
|
|
71
|
-
*/
|
|
72
|
-
export interface IOnboardingExperiment {
|
|
73
|
-
/**
|
|
74
|
-
* Name of the boolean treatment flag that decides the *experience*: `true` shows the tour
|
|
75
|
-
* (treatment arm), `false` does not (control arm). In both arms the assignment-context
|
|
76
|
-
* identifier starts flowing once the user reaches the onboarding moment.
|
|
77
|
-
*/
|
|
78
|
-
readonly behaviorFlag: string;
|
|
79
|
-
/**
|
|
80
|
-
* Name of the string treatment flag whose value is the current arm's ExP variant name. The
|
|
81
|
-
* telemetry entry appends `:<allocationId>`; the value itself MUST start with
|
|
82
|
-
* {@link ONBOARDING_ASSIGNMENT_CONTEXT_PREFIX}; an id without the prefix is rejected (the
|
|
83
|
-
* experiment is treated as inactive) so it can never leak into telemetry ungated.
|
|
84
|
-
*/
|
|
85
|
-
readonly assignmentContextIdFlag: string;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* A declarative onboarding scenario. Scenarios are pure data: they describe
|
|
89
|
-
* *when* onboarding should happen and *which* presentation renders it, but not
|
|
90
|
-
* *how* it is rendered (that is the presentation's job).
|
|
91
|
-
*/
|
|
92
|
-
export interface IOnboardingScenario<TPayload = unknown> {
|
|
93
|
-
/** Stable identifier. Used as the persistence key for "shown once" state. */
|
|
94
|
-
readonly id: string;
|
|
95
|
-
/**
|
|
96
|
-
* Persistence key for the once-per-user "shown" state. Scenarios that share a
|
|
97
|
-
* `seenKey` are treated as the *same* onboarding for once-per-user gating:
|
|
98
|
-
* showing any one of them marks them all as seen, so the others never run
|
|
99
|
-
* automatically. Use this for variations of the same tour that should be
|
|
100
|
-
* shown at most once between them. Defaults to {@link id}.
|
|
101
|
-
*/
|
|
102
|
-
readonly seenKey?: string;
|
|
103
|
-
/** Eligibility gate. AND-ed with the engine's own checks. */
|
|
104
|
-
readonly when?: ContextKeyExpression;
|
|
105
|
-
/** How the scenario becomes eligible to run automatically. */
|
|
106
|
-
readonly trigger: OnboardingTrigger;
|
|
107
|
-
/** Higher priority scenarios run first when several are eligible at once. Default `0`. */
|
|
108
|
-
readonly priority?: number;
|
|
109
|
-
/** The presentation that renders this scenario plus its payload. */
|
|
110
|
-
readonly presentation: IOnboardingPresentationRef<TPayload>;
|
|
111
|
-
/**
|
|
112
|
-
* Optional experiment that gates and measures this scenario. When present, the scenario
|
|
113
|
-
* only runs if the experiment is active (both treatment flags set). See
|
|
114
|
-
* {@link IOnboardingExperiment}.
|
|
115
|
-
*/
|
|
116
|
-
readonly experiment?: IOnboardingExperiment;
|
|
117
|
-
/** Variations exposed through the onboarding developer-mode variation override. */
|
|
118
|
-
readonly developerModeVariations?: readonly string[];
|
|
119
|
-
/** When `true`, the scenario runs on every eligible session instead of once per user. */
|
|
120
|
-
readonly repeatable?: boolean;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* The result of running a scenario's presentation.
|
|
124
|
-
*/
|
|
125
|
-
export declare enum OnboardingOutcome {
|
|
126
|
-
/** The user reached the end of the scenario. */
|
|
127
|
-
Completed = "completed",
|
|
128
|
-
/** The user explicitly skipped the scenario. */
|
|
129
|
-
Skipped = "skipped",
|
|
130
|
-
/** The scenario was dismissed (e.g. closed without an explicit skip). */
|
|
131
|
-
Dismissed = "dismissed",
|
|
132
|
-
/** The scenario was aborted by the engine (e.g. window shutdown, target lost). */
|
|
133
|
-
Aborted = "aborted"
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* The concrete mechanism that ended a scenario run. Refines {@link OnboardingOutcome} with
|
|
137
|
-
* the specific user action, primarily for telemetry (e.g. distinguishing the Skip button
|
|
138
|
-
* from the Escape key).
|
|
139
|
-
*/
|
|
140
|
-
export declare enum OnboardingDismissReason {
|
|
141
|
-
/** The user reached and advanced past the final step. */
|
|
142
|
-
Completed = "completed",
|
|
143
|
-
/** The user pressed the Skip button. */
|
|
144
|
-
SkipButton = "skipButton",
|
|
145
|
-
/** The user pressed the Escape key. */
|
|
146
|
-
EscapeKey = "escapeKey",
|
|
147
|
-
/** The user advanced by clicking the highlighted target on the final step. */
|
|
148
|
-
TargetClick = "targetClick",
|
|
149
|
-
/** The engine aborted the run (window shutdown, target lost, ...). */
|
|
150
|
-
Aborted = "aborted"
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Rich result returned by a presentation's `run`, carrying the outcome plus the data the
|
|
154
|
-
* engine needs to emit per-tour telemetry (how far the user got and how the run ended).
|
|
155
|
-
*/
|
|
156
|
-
export interface IOnboardingRunResult {
|
|
157
|
-
/** Coarse engine-level outcome. */
|
|
158
|
-
readonly outcome: OnboardingOutcome;
|
|
159
|
-
/**
|
|
160
|
-
* Whether the presentation actually displayed anything to the user. `false` for a
|
|
161
|
-
* degenerate run that rendered no UI (e.g. a scenario with no steps, or every step
|
|
162
|
-
* skipped because its target/`when` was unavailable). The engine only emits outcome
|
|
163
|
-
* telemetry when a tour was genuinely shown.
|
|
164
|
-
*/
|
|
165
|
-
readonly shown: boolean;
|
|
166
|
-
/** Concrete reason/mechanism that ended the run. */
|
|
167
|
-
readonly dismissReason: OnboardingDismissReason;
|
|
168
|
-
/** Furthest 0-based step index the user reached (`0` if the first step never showed). */
|
|
169
|
-
readonly lastStepIndex: number;
|
|
170
|
-
/** Total number of steps the scenario declared. */
|
|
171
|
-
readonly stepCount: number;
|
|
172
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const ONBOARDING_ASSIGNMENT_CONTEXT_PREFIX = 'onb-';
|
|
4
|
-
var OnboardingOutcome;
|
|
5
|
-
(function (OnboardingOutcome) {
|
|
6
|
-
OnboardingOutcome["Completed"] = "completed";
|
|
7
|
-
OnboardingOutcome["Skipped"] = "skipped";
|
|
8
|
-
OnboardingOutcome["Dismissed"] = "dismissed";
|
|
9
|
-
OnboardingOutcome["Aborted"] = "aborted";
|
|
10
|
-
})(OnboardingOutcome || (OnboardingOutcome = {}));
|
|
11
|
-
var OnboardingDismissReason;
|
|
12
|
-
(function (OnboardingDismissReason) {
|
|
13
|
-
OnboardingDismissReason["Completed"] = "completed";
|
|
14
|
-
OnboardingDismissReason["SkipButton"] = "skipButton";
|
|
15
|
-
OnboardingDismissReason["EscapeKey"] = "escapeKey";
|
|
16
|
-
OnboardingDismissReason["TargetClick"] = "targetClick";
|
|
17
|
-
OnboardingDismissReason["Aborted"] = "aborted";
|
|
18
|
-
})(OnboardingDismissReason || (OnboardingDismissReason = {}));
|
|
19
|
-
|
|
20
|
-
export { ONBOARDING_ASSIGNMENT_CONTEXT_PREFIX, OnboardingDismissReason, OnboardingOutcome };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
2
|
-
/** Global setting that enables/disables *automatic* onboarding scenarios. */
|
|
3
|
-
export declare const ONBOARDING_ENABLED_CONFIG = "onboarding.enabled";
|
|
4
|
-
/**
|
|
5
|
-
* Developer/advanced setting. A map of scenario/tour id to a boolean: when a
|
|
6
|
-
* scenario's flag is `true`, that scenario bypasses the gating that normally
|
|
7
|
-
* keeps it from showing, so it can be triggered on demand for testing. Concretely,
|
|
8
|
-
* developer mode for a scenario:
|
|
9
|
-
* - bypasses usage-based eligibility gating (e.g. the new-session tour's "first
|
|
10
|
-
* few sessions" check),
|
|
11
|
-
* - bypasses the once-per-user persisted "shown" state, and
|
|
12
|
-
* - bypasses the experiment gate: a tour with a linked experiment will show even
|
|
13
|
-
* if the experiment is not running, or the user is in the control arm. A
|
|
14
|
-
* developer-mode preview never opens the assignment-context telemetry gate (in
|
|
15
|
-
* any arm), so it can never affect an experiment scorecard.
|
|
16
|
-
*
|
|
17
|
-
* Developer mode does NOT override the global `onboarding.enabled` switch: when
|
|
18
|
-
* onboarding is disabled, nothing shows automatically regardless of this setting.
|
|
19
|
-
*
|
|
20
|
-
* The scenario is still shown at most once per window session (tracked in memory,
|
|
21
|
-
* not persisted), so reload the window to replay it — the "Reset Onboarding Shown
|
|
22
|
-
* State" command only clears the persisted state and does not affect developer-mode
|
|
23
|
-
* replays.
|
|
24
|
-
*
|
|
25
|
-
* The default value lists every registered scenario id set to `false`, so the
|
|
26
|
-
* available ids are discoverable (and toggleable) in the settings editor.
|
|
27
|
-
*/
|
|
28
|
-
export declare const ONBOARDING_DEVELOPER_MODE_CONFIG = "onboarding.developerMode";
|
|
29
|
-
/** Developer override for a scenario's experiment-selected variation. */
|
|
30
|
-
export declare const ONBOARDING_DEVELOPER_MODE_VARIATIONS_CONFIG = "onboarding.developerModeVariations";
|
|
31
|
-
/**
|
|
32
|
-
* The shape of the {@link ONBOARDING_DEVELOPER_MODE_CONFIG} setting: a map of
|
|
33
|
-
* scenario/tour id to whether developer mode is enabled for that scenario.
|
|
34
|
-
*/
|
|
35
|
-
export type OnboardingDeveloperMode = {
|
|
36
|
-
readonly [scenarioId: string]: boolean;
|
|
37
|
-
};
|
|
38
|
-
/** The shape of the {@link ONBOARDING_DEVELOPER_MODE_VARIATIONS_CONFIG} setting. */
|
|
39
|
-
export type OnboardingDeveloperModeVariations = {
|
|
40
|
-
readonly [scenarioId: string]: string;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Whether onboarding developer mode is enabled for the given scenario/tour id.
|
|
44
|
-
* Reads {@link ONBOARDING_DEVELOPER_MODE_CONFIG} and returns `true` only when the
|
|
45
|
-
* setting is an object whose entry for `scenarioId` is explicitly `true`.
|
|
46
|
-
*/
|
|
47
|
-
export declare function isOnboardingDeveloperModeEnabled(configurationService: IConfigurationService, scenarioId: string): boolean;
|
|
48
|
-
export declare function getOnboardingDeveloperModeVariation(configurationService: IConfigurationService, scenarioId: string): string | undefined;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const ONBOARDING_ENABLED_CONFIG = 'onboarding.enabled';
|
|
4
|
-
const ONBOARDING_DEVELOPER_MODE_CONFIG = 'onboarding.developerMode';
|
|
5
|
-
const ONBOARDING_DEVELOPER_MODE_VARIATIONS_CONFIG = 'onboarding.developerModeVariations';
|
|
6
|
-
function isOnboardingDeveloperModeEnabled(configurationService, scenarioId) {
|
|
7
|
-
const value = configurationService.getValue(ONBOARDING_DEVELOPER_MODE_CONFIG);
|
|
8
|
-
return typeof value === 'object' && value !== null && value[scenarioId] === true;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { ONBOARDING_DEVELOPER_MODE_CONFIG, ONBOARDING_DEVELOPER_MODE_VARIATIONS_CONFIG, ONBOARDING_ENABLED_CONFIG, isOnboardingDeveloperModeEnabled };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
-
import { IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
-
import { IOnboardingRunContext } from "./onboardingPresentation.js";
|
|
4
|
-
import { OnboardingDismissReason } from "./onboardingScenario.js";
|
|
5
|
-
export declare const ONBOARDING_SEQUENCE_PRESENTATION_KIND = "sequence";
|
|
6
|
-
/** One entry in a heterogeneous onboarding sequence. */
|
|
7
|
-
export interface IOnboardingSequenceStep<TPayload = unknown> {
|
|
8
|
-
readonly id: string;
|
|
9
|
-
readonly kind: string;
|
|
10
|
-
readonly payload: TPayload;
|
|
11
|
-
}
|
|
12
|
-
/** Payload rendered by the sequence presentation. */
|
|
13
|
-
export interface IOnboardingSequencePayload {
|
|
14
|
-
readonly steps: readonly IOnboardingSequenceStep[];
|
|
15
|
-
}
|
|
16
|
-
/** Context passed to a sequence step presentation. */
|
|
17
|
-
export interface IOnboardingSequenceStepContext extends IOnboardingRunContext {
|
|
18
|
-
readonly cancellationToken: CancellationToken;
|
|
19
|
-
readonly stepIndex: number;
|
|
20
|
-
readonly visualStepIndex: number;
|
|
21
|
-
readonly visualStepCount: number;
|
|
22
|
-
readonly canGoBack: boolean;
|
|
23
|
-
readonly isLastVisualStep: boolean;
|
|
24
|
-
}
|
|
25
|
-
/** Traversal result returned by one sequence step. */
|
|
26
|
-
export interface IOnboardingSequenceStepResult {
|
|
27
|
-
readonly action: "next" | "back" | "skipStep" | "skipSequence" | "abort";
|
|
28
|
-
readonly shown: boolean;
|
|
29
|
-
readonly dismissReason?: OnboardingDismissReason;
|
|
30
|
-
}
|
|
31
|
-
/** Renders one kind of sequence step. */
|
|
32
|
-
export interface IOnboardingSequenceStepPresentation {
|
|
33
|
-
readonly kind: string;
|
|
34
|
-
/** Whether this kind participates in visual progress counters. */
|
|
35
|
-
readonly countsAsVisualStep: boolean;
|
|
36
|
-
/** Whether a forward revisit skips a step that already ran. */
|
|
37
|
-
readonly runOnce?: boolean;
|
|
38
|
-
runStep(step: IOnboardingSequenceStep, context: IOnboardingSequenceStepContext): Promise<IOnboardingSequenceStepResult>;
|
|
39
|
-
}
|
|
40
|
-
/** Registry of sequence step presentations by kind. */
|
|
41
|
-
export interface IOnboardingSequenceStepPresentationRegistry {
|
|
42
|
-
register(presentation: IOnboardingSequenceStepPresentation): IDisposable;
|
|
43
|
-
get(kind: string): IOnboardingSequenceStepPresentation | undefined;
|
|
44
|
-
}
|
|
45
|
-
export declare const onboardingSequenceStepPresentationRegistry: IOnboardingSequenceStepPresentationRegistry;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const ONBOARDING_SEQUENCE_PRESENTATION_KIND = "sequence";
|
|
4
|
-
class OnboardingSequenceStepPresentationRegistry {
|
|
5
|
-
constructor() {
|
|
6
|
-
this._presentations = ( new Map());
|
|
7
|
-
}
|
|
8
|
-
register(presentation) {
|
|
9
|
-
if (( this._presentations.has(presentation.kind))) {
|
|
10
|
-
throw ( new Error(
|
|
11
|
-
`An onboarding sequence step presentation with kind '${presentation.kind}' is already registered.`
|
|
12
|
-
));
|
|
13
|
-
}
|
|
14
|
-
this._presentations.set(presentation.kind, presentation);
|
|
15
|
-
return {
|
|
16
|
-
dispose: () => {
|
|
17
|
-
if (this._presentations.get(presentation.kind) === presentation) {
|
|
18
|
-
this._presentations.delete(presentation.kind);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
get(kind) {
|
|
24
|
-
return this._presentations.get(kind);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const onboardingSequenceStepPresentationRegistry = ( new OnboardingSequenceStepPresentationRegistry());
|
|
28
|
-
|
|
29
|
-
export { ONBOARDING_SEQUENCE_PRESENTATION_KIND, onboardingSequenceStepPresentationRegistry };
|