Skip to content

Commit bd2263a

Browse files
Kateryna ProkopenkoDevtools-frontend LUCI CQ
authored andcommitted
Record interactions with promoted reveal view commands in command menu
Bug: 434870886 Change-Id: Ic4532acded00ff290cfb6cf07ba996b173adea46 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6811273 Commit-Queue: Benedikt Meurer <[email protected]> Reviewed-by: Benedikt Meurer <[email protected]> Auto-Submit: Kateryna Prokopenko <[email protected]>
1 parent ae8f37a commit bd2263a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

front_end/entrypoints/main/MainImpl.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,10 +906,16 @@ export class MainMenuItem implements UI.Toolbar.Provider {
906906

907907
const aiPreregisteredView = UI.ViewManager.getRegisteredViewExtensionForID('freestyler');
908908
if (aiPreregisteredView) {
909-
const additionalElement = UI.UIUtils.maybeCreateNewBadge('ai-asisstance');
909+
let additionalElement = undefined;
910+
const promotionId = aiPreregisteredView.featurePromotionId();
911+
if (promotionId) {
912+
additionalElement = UI.UIUtils.maybeCreateNewBadge(promotionId);
913+
}
910914
contextMenu.defaultSection().appendItem(aiPreregisteredView.title(), () => {
911915
void UI.ViewManager.ViewManager.instance().showView('freestyler', true, false);
912-
UI.UIUtils.PromotionManager.instance().recordFeatureInteraction('ai-asisstance');
916+
if (promotionId) {
917+
UI.UIUtils.PromotionManager.instance().recordFeatureInteraction(promotionId);
918+
}
913919
}, {additionalElement, jslogContext: 'freestyler'});
914920
}
915921

front_end/ui/legacy/components/quick_open/CommandMenu.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export class CommandMenu {
8282
handler = () => {
8383
Host.userMetrics.actionTaken(actionCode);
8484
executeHandler();
85+
// not here
8586
};
8687
}
8788
return new Command(
@@ -173,6 +174,9 @@ export class CommandMenu {
173174
if (id === 'issues-pane') {
174175
Host.userMetrics.issuesPanelOpenedFrom(Host.UserMetrics.IssueOpener.COMMAND_MENU);
175176
}
177+
if (featurePromotionId) {
178+
UI.UIUtils.PromotionManager.instance().recordFeatureInteraction(featurePromotionId);
179+
}
176180
return UI.ViewManager.ViewManager.instance().showView(id, /* userGesture */ true);
177181
};
178182

@@ -345,7 +349,7 @@ export class CommandMenuProvider extends Provider {
345349
FilteredListWidget.highlightRanges(titleElement, query, true);
346350

347351
if (command.featurePromotionId) {
348-
const badge = UI.UIUtils.maybeCreateNewBadge('ai-asisstance');
352+
const badge = UI.UIUtils.maybeCreateNewBadge(command.featurePromotionId);
349353
if (badge) {
350354
titleElement.parentElement?.insertBefore(badge, subtitleElement);
351355
}

0 commit comments

Comments
 (0)