Skip to content

Commit a1f61fd

Browse files
committed
welcome views: telemetry events for buttons
1 parent 487db98 commit a1f61fd

26 files changed

Lines changed: 79 additions & 34 deletions

File tree

src/vs/workbench/browser/parts/views/customView.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { CollapseAllAction } from 'vs/base/browser/ui/tree/treeDefaults';
4343
import { isFalsyOrWhitespace } from 'vs/base/common/strings';
4444
import { SIDE_BAR_BACKGROUND, PANEL_BACKGROUND } from 'vs/workbench/common/theme';
4545
import { IOpenerService } from 'vs/platform/opener/common/opener';
46+
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
4647

4748
export class CustomTreeViewPane extends ViewPane {
4849

@@ -59,8 +60,9 @@ export class CustomTreeViewPane extends ViewPane {
5960
@IInstantiationService instantiationService: IInstantiationService,
6061
@IOpenerService openerService: IOpenerService,
6162
@IThemeService themeService: IThemeService,
63+
@ITelemetryService telemetryService: ITelemetryService,
6264
) {
63-
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: options.title, titleMenuId: MenuId.ViewTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
65+
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: options.title, titleMenuId: MenuId.ViewTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
6466
const { treeView } = (<ITreeViewDescriptor>Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).getView(options.id));
6567
this.treeView = treeView;
6668
this._register(this.treeView.onDidChangeActions(() => this.updateActions(), this));

src/vs/workbench/browser/parts/views/viewPaneContainer.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ export class DraggedViewIdentifier {
6666
}
6767
}
6868

69+
type WelcomeActionClassification = {
70+
viewId: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
71+
uri: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
72+
};
6973

7074
const viewsRegistry = Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry);
7175

@@ -199,6 +203,7 @@ export abstract class ViewPane extends Pane implements IView {
199203
@IInstantiationService protected instantiationService: IInstantiationService,
200204
@IOpenerService protected openerService: IOpenerService,
201205
@IThemeService protected themeService: IThemeService,
206+
@ITelemetryService protected telemetryService: ITelemetryService,
202207
) {
203208
super(options);
204209

@@ -416,7 +421,10 @@ export abstract class ViewPane extends Pane implements IView {
416421
} else if (linkedText.nodes.length === 1) {
417422
const button = new Button(p, { title: node.title });
418423
button.label = node.label;
419-
button.onDidClick(_ => this.openerService.open(node.href), null, disposables);
424+
button.onDidClick(_ => {
425+
this.telemetryService.publicLog2<{ viewId: string, uri: string }, WelcomeActionClassification>('views.welcomeAction', { viewId: this.id, uri: node.href });
426+
this.openerService.open(node.href);
427+
}, null, disposables);
420428
disposables.add(button);
421429
disposables.add(attachButtonStyler(button, this.themeService));
422430
} else {

src/vs/workbench/contrib/bulkEdit/browser/bulkEditPane.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import type { IAsyncDataTreeViewState } from 'vs/base/browser/ui/tree/asyncDataT
3838
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
3939
import { IViewDescriptorService } from 'vs/workbench/common/views';
4040
import { IOpenerService } from 'vs/platform/opener/common/opener';
41+
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
4142

4243
const enum State {
4344
Data = 'data',
@@ -86,10 +87,11 @@ export class BulkEditPane extends ViewPane {
8687
@IConfigurationService configurationService: IConfigurationService,
8788
@IOpenerService openerService: IOpenerService,
8889
@IThemeService themeService: IThemeService,
90+
@ITelemetryService telemetryService: ITelemetryService,
8991
) {
9092
super(
9193
{ ...options, titleMenuId: MenuId.BulkEditTitle },
92-
keybindingService, contextMenuService, configurationService, _contextKeyService, viewDescriptorService, _instaService, openerService, themeService
94+
keybindingService, contextMenuService, configurationService, _contextKeyService, viewDescriptorService, _instaService, openerService, themeService, telemetryService
9395
);
9496

9597
this.element.classList.add('bulk-edit-panel', 'show-file-icons');

src/vs/workbench/contrib/comments/browser/commentsView.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
2727
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
2828
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
2929
import { IOpenerService } from 'vs/platform/opener/common/opener';
30+
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
3031

3132

3233
export class CommentsPanel extends ViewPane {
@@ -51,9 +52,10 @@ export class CommentsPanel extends ViewPane {
5152
@IKeybindingService keybindingService: IKeybindingService,
5253
@IOpenerService openerService: IOpenerService,
5354
@IThemeService themeService: IThemeService,
54-
@ICommentService private readonly commentService: ICommentService
55+
@ICommentService private readonly commentService: ICommentService,
56+
@ITelemetryService telemetryService: ITelemetryService,
5557
) {
56-
super({ ...(options as IViewPaneOptions), id: COMMENTS_VIEW_ID, ariaHeaderLabel: COMMENTS_VIEW_TITLE }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
58+
super({ ...(options as IViewPaneOptions), id: COMMENTS_VIEW_ID, ariaHeaderLabel: COMMENTS_VIEW_TITLE }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
5759
}
5860

5961
public renderBody(container: HTMLElement): void {

src/vs/workbench/contrib/debug/browser/breakpointsView.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { Gesture } from 'vs/base/browser/touch';
3535
import { IViewDescriptorService } from 'vs/workbench/common/views';
3636
import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor';
3737
import { IOpenerService } from 'vs/platform/opener/common/opener';
38+
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
3839

3940
const $ = dom.$;
4041

@@ -71,8 +72,9 @@ export class BreakpointsView extends ViewPane {
7172
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
7273
@IContextKeyService contextKeyService: IContextKeyService,
7374
@IOpenerService openerService: IOpenerService,
75+
@ITelemetryService telemetryService: ITelemetryService,
7476
) {
75-
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('breakpointsSection', "Breakpoints Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
77+
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('breakpointsSection', "Breakpoints Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
7678

7779
this.minimumBodySize = this.maximumBodySize = getExpandedBodySize(this.debugService.getModel());
7880
this._register(this.debugService.getModel().onDidChangeBreakpoints(() => this.onBreakpointsChange()));

src/vs/workbench/contrib/debug/browser/callStackView.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { CollapseAction } from 'vs/workbench/browser/viewlet';
3737
import { IViewDescriptorService } from 'vs/workbench/common/views';
3838
import { IThemeService } from 'vs/platform/theme/common/themeService';
3939
import { IOpenerService } from 'vs/platform/opener/common/opener';
40+
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
4041

4142
const $ = dom.$;
4243

@@ -101,8 +102,9 @@ export class CallStackView extends ViewPane {
101102
@IContextKeyService readonly contextKeyService: IContextKeyService,
102103
@IOpenerService openerService: IOpenerService,
103104
@IThemeService themeService: IThemeService,
105+
@ITelemetryService telemetryService: ITelemetryService,
104106
) {
105-
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('callstackSection', "Call Stack Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
107+
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('callstackSection', "Call Stack Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
106108
this.callStackItemType = CONTEXT_CALLSTACK_ITEM_TYPE.bindTo(contextKeyService);
107109

108110
this.contributedContextMenu = menuService.createMenu(MenuId.DebugCallStackContext, contextKeyService);

src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import type { ICompressibleTreeRenderer } from 'vs/base/browser/ui/tree/objectTr
3939
import { IViewDescriptorService } from 'vs/workbench/common/views';
4040
import { IOpenerService } from 'vs/platform/opener/common/opener';
4141
import { IThemeService } from 'vs/platform/theme/common/themeService';
42+
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
4243

4344
const NEW_STYLE_COMPRESS = true;
4445

@@ -427,8 +428,9 @@ export class LoadedScriptsView extends ViewPane {
427428
@ILabelService private readonly labelService: ILabelService,
428429
@IOpenerService openerService: IOpenerService,
429430
@IThemeService themeService: IThemeService,
431+
@ITelemetryService telemetryService: ITelemetryService,
430432
) {
431-
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('loadedScriptsSection', "Loaded Scripts Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
433+
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('loadedScriptsSection', "Loaded Scripts Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
432434
this.loadedScriptsItemType = CONTEXT_LOADED_SCRIPTS_ITEM_TYPE.bindTo(contextKeyService);
433435
}
434436

src/vs/workbench/contrib/debug/browser/repl.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
5858
import { IViewsService, IViewDescriptorService } from 'vs/workbench/common/views';
5959
import { IOpenerService } from 'vs/platform/opener/common/opener';
6060
import { ReplGroup } from 'vs/workbench/contrib/debug/common/replModel';
61+
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
6162

6263
const $ = dom.$;
6364

@@ -110,8 +111,9 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
110111
@IEditorService private readonly editorService: IEditorService,
111112
@IKeybindingService keybindingService: IKeybindingService,
112113
@IOpenerService openerService: IOpenerService,
114+
@ITelemetryService telemetryService: ITelemetryService,
113115
) {
114-
super({ ...(options as IViewPaneOptions), id: REPL_VIEW_ID, ariaHeaderLabel: localize('debugConsole', "Debug Console") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
116+
super({ ...(options as IViewPaneOptions), id: REPL_VIEW_ID, ariaHeaderLabel: localize('debugConsole', "Debug Console") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
115117

116118
this.history = new HistoryNavigator(JSON.parse(this.storageService.get(HISTORY_STORAGE_KEY, StorageScope.WORKSPACE, '[]')), 50);
117119
codeEditorService.registerDecorationType(DECORATION_KEY, {});

src/vs/workbench/contrib/debug/browser/startView.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { OpenFolderAction, OpenFileAction, OpenFileFolderAction } from 'vs/workb
2323
import { isMacintosh } from 'vs/base/common/platform';
2424
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
2525
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
26+
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
2627

2728
const debugStartLanguageKey = 'debugStartLanguage';
2829
const CONTEXT_DEBUG_START_LANGUAGE = new RawContextKey<string>(debugStartLanguageKey, undefined);
@@ -48,9 +49,10 @@ export class StartView extends ViewPane {
4849
@IInstantiationService instantiationService: IInstantiationService,
4950
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
5051
@IOpenerService openerService: IOpenerService,
51-
@IStorageService storageSevice: IStorageService
52+
@IStorageService storageSevice: IStorageService,
53+
@ITelemetryService telemetryService: ITelemetryService,
5254
) {
53-
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: localize('debugStart', "Debug Start Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
55+
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: localize('debugStart', "Debug Start Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
5456

5557
this.debugStartLanguageContext = CONTEXT_DEBUG_START_LANGUAGE.bindTo(contextKeyService);
5658
this.debuggerInterestedContext = CONTEXT_DEBUGGER_INTERESTED_IN_ACTIVE_EDITOR.bindTo(contextKeyService);

src/vs/workbench/contrib/debug/browser/variablesView.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { dispose } from 'vs/base/common/lifecycle';
3333
import { IViewDescriptorService } from 'vs/workbench/common/views';
3434
import { IOpenerService } from 'vs/platform/opener/common/opener';
3535
import { IThemeService } from 'vs/platform/theme/common/themeService';
36+
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
3637

3738
const $ = dom.$;
3839
let forgetScopes = true;
@@ -58,8 +59,9 @@ export class VariablesView extends ViewPane {
5859
@IContextKeyService contextKeyService: IContextKeyService,
5960
@IOpenerService openerService: IOpenerService,
6061
@IThemeService themeService: IThemeService,
62+
@ITelemetryService telemetryService: ITelemetryService,
6163
) {
62-
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('variablesSection', "Variables Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
64+
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('variablesSection', "Variables Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
6365

6466
// Use scheduler to prevent unnecessary flashing
6567
this.onFocusStackFrameScheduler = new RunOnceScheduler(async () => {

0 commit comments

Comments
 (0)