Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/vs/platform/actionWidget/browser/actionWidgetDropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ export interface IActionWidgetDropdownOptions extends IBaseDropdownOptions {
getAnchor?: () => HTMLElement;

/**
* Name used for telemetry tracking when the dropdown closes.
* If not provided, no telemetry will be sent.
* Telemetry reporter configuration used when the dropdown closes. The `id` field is required
* and is used as the telemetry identifier; `name` is optional additional context. If not
* provided, no telemetry will be sent.
*/
readonly reporter?: { name: string; includeOptions?: boolean };
readonly reporter?: { id: string; name?: string; includeOptions?: boolean };
}

/**
Expand Down Expand Up @@ -216,6 +217,7 @@ export class ActionWidgetDropdown extends BaseDropdown {
this.telemetryService.publicLog2<ActionWidgetDropdownClosedEvent, ActionWidgetDropdownClosedClassification>(
'actionWidgetDropdownClosed',
{
id: this._options.reporter.id,
name: this._options.reporter.name,
selectionChanged: optionBefore?.id !== optionAfter?.id,
optionIdBefore: this._options.reporter.includeOptions ? optionBefore?.id : undefined,
Expand All @@ -229,7 +231,8 @@ export class ActionWidgetDropdown extends BaseDropdown {
}

type ActionWidgetDropdownClosedEvent = {
name: string;
id: string;
name: string | undefined;
selectionChanged: boolean;
optionIdBefore: string | undefined;
optionIdAfter: string | undefined;
Expand All @@ -238,6 +241,7 @@ type ActionWidgetDropdownClosedEvent = {
};

type ActionWidgetDropdownClosedClassification = {
id: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The telemetry id of the dropdown picker.' };
name: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The telemetry name of the dropdown picker.' };
selectionChanged: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'Whether the user changed the selected option.' };
optionIdBefore: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The option configured before opening the dropdown.' };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class ChatContinueInSessionActionItem extends ActionWidgetDropdownActionV
super(action, {
actionProvider: ChatContinueInSessionActionItem.actionProvider(chatSessionsService, instantiationService, location),
actionBarActions: ChatContinueInSessionActionItem.getActionBarActions(openerService),
reporter: { name: 'ChatContinueInSession', includeOptions: true },
reporter: { id: 'ChatContinueInSession', name: 'ChatContinueInSession', includeOptions: true },
}, actionWidgetService, keybindingService, contextKeyService, telemetryService);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class ChatSessionPickerActionItem extends ActionWidgetDropdownActionViewI
getActions: () => this.getDropdownActions()
},
actionBarActionProvider: undefined,
reporter: { name: `ChatSession:${group.name}`, includeOptions: false },
reporter: { id: group.id, name: `ChatSession:${group.name}`, includeOptions: false },
};

super(actionWithLabel, sessionPickerActionWidgetOptions, actionWidgetService, keybindingService, contextKeyService, telemetryService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class ModePickerActionItem extends ChatInputPickerActionViewItem {
getActions: () => this.getModePickerActionBarActions()
},
showItemKeybindings: true,
reporter: { name: 'ChatModePicker', includeOptions: true },
reporter: { id: 'ChatModePicker', name: 'ChatModePicker', includeOptions: true },
};

super(action, modePickerActionWidgetOptions, pickerOptions, actionWidgetService, keybindingService, contextKeyService, telemetryService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class ModelPickerActionItem extends ChatInputPickerActionViewItem {
const modelPickerActionWidgetOptions: Omit<IActionWidgetDropdownOptions, 'label' | 'labelRenderer'> = {
actionProvider: modelDelegateToWidgetActionsProvider(delegate, telemetryService, pickerOptions),
actionBarActionProvider: getModelPickerActionBarActionProvider(commandService, chatEntitlementService, productService),
reporter: { name: 'ChatModelPicker', includeOptions: true },
reporter: { id: 'ChatModelPicker', name: 'ChatModelPicker', includeOptions: true },
};

super(actionWithLabel, widgetOptions ?? modelPickerActionWidgetOptions, pickerOptions, actionWidgetService, keybindingService, contextKeyService, telemetryService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class SessionTypePickerActionItem extends ChatInputPickerActionViewItem {
actionProvider,
actionBarActionProvider,
showItemKeybindings: true,
reporter: { name: `ChatSessionTypePicker`, includeOptions: true },
reporter: { id: 'ChatSessionTypePicker', name: `ChatSessionTypePicker`, includeOptions: true },
};

super(action, sessionTargetPickerOptions, pickerOptions, actionWidgetService, keybindingService, contextKeyService, telemetryService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class WorkspacePickerActionItem extends ChatInputPickerActionViewItem {
actionProvider,
actionBarActionProvider,
showItemKeybindings: false,
reporter: { name: 'ChatWorkspacePicker', includeOptions: false },
reporter: { id: 'ChatWorkspacePicker', name: 'ChatWorkspacePicker', includeOptions: false },
};

super(action, workspacePickerOptions, pickerOptions, actionWidgetService, keybindingService, contextKeyService, telemetryService);
Expand Down
Loading