提交 35bf784b 编写于 作者: C Christof Marti

Always show watermark, first session experiment (#15547)

上级 2a4cd323
...@@ -23,7 +23,7 @@ export interface ITelemetryInfo { ...@@ -23,7 +23,7 @@ export interface ITelemetryInfo {
export interface ITelemetryExperiments { export interface ITelemetryExperiments {
showDefaultViewlet: boolean; showDefaultViewlet: boolean;
showCommandsWatermark: boolean; showFirstSessionWatermark: boolean;
openUntitledFile: boolean; openUntitledFile: boolean;
} }
...@@ -46,7 +46,7 @@ export interface ITelemetryService { ...@@ -46,7 +46,7 @@ export interface ITelemetryService {
export const defaultExperiments: ITelemetryExperiments = { export const defaultExperiments: ITelemetryExperiments = {
showDefaultViewlet: false, showDefaultViewlet: false,
showCommandsWatermark: false, showFirstSessionWatermark: false,
openUntitledFile: true openUntitledFile: true
}; };
...@@ -80,7 +80,7 @@ export function loadExperiments(storageService: IStorageService, configurationSe ...@@ -80,7 +80,7 @@ export function loadExperiments(storageService: IStorageService, configurationSe
const random0 = parseFloat(valueString); const random0 = parseFloat(valueString);
let [random1, showDefaultViewlet] = splitRandom(random0); let [random1, showDefaultViewlet] = splitRandom(random0);
const [random2, showCommandsWatermark] = splitRandom(random1); const [random2, showFirstSessionWatermark] = splitRandom(random1);
let [, openUntitledFile] = splitRandom(random2); let [, openUntitledFile] = splitRandom(random2);
// is the user a first time user? // is the user a first time user?
...@@ -93,7 +93,7 @@ export function loadExperiments(storageService: IStorageService, configurationSe ...@@ -93,7 +93,7 @@ export function loadExperiments(storageService: IStorageService, configurationSe
return applyOverrides(configurationService, { return applyOverrides(configurationService, {
showDefaultViewlet, showDefaultViewlet,
showCommandsWatermark, showFirstSessionWatermark,
openUntitledFile openUntitledFile
}); });
} }
......
...@@ -138,15 +138,13 @@ export class WatermarkContribution implements IWorkbenchContribution { ...@@ -138,15 +138,13 @@ export class WatermarkContribution implements IWorkbenchContribution {
@IKeybindingService private keybindingService: IKeybindingService, @IKeybindingService private keybindingService: IKeybindingService,
@IWorkspaceContextService private contextService: IWorkspaceContextService, @IWorkspaceContextService private contextService: IWorkspaceContextService,
@IStorageService private storageService: IStorageService, @IStorageService private storageService: IStorageService,
@ITelemetryService telemetryService: ITelemetryService @ITelemetryService private telemetryService: ITelemetryService
) { ) {
if (telemetryService.getExperiments().showCommandsWatermark) {
lifecycleService.onShutdown(this.dispose, this); lifecycleService.onShutdown(this.dispose, this);
this.partService.joinCreation().then(() => { this.partService.joinCreation().then(() => {
this.create(); this.create();
}); });
} }
}
public getId() { public getId() {
return 'vs.watermark'; return 'vs.watermark';
...@@ -160,7 +158,8 @@ export class WatermarkContribution implements IWorkbenchContribution { ...@@ -160,7 +158,8 @@ export class WatermarkContribution implements IWorkbenchContribution {
const box = $(watermark) const box = $(watermark)
.div({ 'class': 'watermark-box' }); .div({ 'class': 'watermark-box' });
const folder = !!this.contextService.getWorkspace(); const folder = !!this.contextService.getWorkspace();
const firstSession = !this.storageService.get('telemetry.lastSessionDate'); const firstSession = this.telemetryService.getExperiments().showFirstSessionWatermark &&
!this.storageService.get('telemetry.lastSessionDate');
const selected = (folder ? folderEntries : firstSession ? firstSessionEntries : noFolderEntries) const selected = (folder ? folderEntries : firstSession ? firstSessionEntries : noFolderEntries)
.filter(entry => !('mac' in entry) || entry.mac === isMacintosh); .filter(entry => !('mac' in entry) || entry.mac === isMacintosh);
const update = () => { const update = () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册