File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
ui/legacy/components/quick_open Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments