55import * as Common from '../../core/common/common.js' ;
66import * as i18n from '../../core/i18n/i18n.js' ;
77import type * as Platform from '../../core/platform/platform.js' ;
8- import type * as Root from '../../core/root/root.js' ;
8+ import * as Root from '../../core/root/root.js' ;
99import * as UI from '../../ui/legacy/legacy.js' ;
1010
1111import type * as AiAssistance from './ai_assistance.js' ;
@@ -108,13 +108,22 @@ function isAnyFeatureAvailable(config?: Root.Runtime.HostConfig): boolean {
108108 isPerformanceAgentFeatureAvailable ( config ) || isFileAgentFeatureAvailable ( config ) ;
109109}
110110
111+ function titleForAiAssistanceActions ( ) : Platform . UIString . LocalizedString {
112+ if ( Root . Runtime . hostConfig . devToolsAiDebugWithAi ?. enabled ||
113+ Root . Runtime . hostConfig . devToolsAiSubmenuPrompts ?. enabled ) {
114+ return i18nLazyString ( UIStrings . debugWithAi ) ( ) ;
115+ }
116+ return i18nLazyString ( UIStrings . askAi ) ( ) ;
117+ }
118+
111119UI . ViewManager . registerViewExtension ( {
112120 location : UI . ViewManager . ViewLocationValues . DRAWER_VIEW ,
113121 id : 'freestyler' ,
114122 commandPrompt : i18nLazyString ( UIStrings . showAiAssistance ) ,
115123 title : i18nLazyString ( UIStrings . aiAssistance ) ,
116124 order : 10 ,
117125 isPreviewFeature : true ,
126+ featurePromotionId : 'ai-assistance' ,
118127 persistence : UI . ViewManager . ViewPersistence . CLOSEABLE ,
119128 hasToolbar : false ,
120129 condition : config => isAnyFeatureAvailable ( config ) && ! isPolicyRestricted ( config ) ,
@@ -156,7 +165,7 @@ UI.ActionRegistration.registerActionExtension({
156165 return [ ] ;
157166 } ,
158167 category : UI . ActionRegistration . ActionCategory . GLOBAL ,
159- title : i18nLazyString ( UIStrings . askAi ) ,
168+ title : ( ) => titleForAiAssistanceActions ( ) ,
160169 async loadActionDelegate ( ) {
161170 const AiAssistance = await loadAiAssistanceModule ( ) ;
162171 return new AiAssistance . ActionDelegate ( ) ;
@@ -171,7 +180,7 @@ UI.ActionRegistration.registerActionExtension({
171180 return [ ] ;
172181 } ,
173182 category : UI . ActionRegistration . ActionCategory . GLOBAL ,
174- title : i18nLazyString ( UIStrings . askAi ) ,
183+ title : ( ) => titleForAiAssistanceActions ( ) ,
175184 async loadActionDelegate ( ) {
176185 const AiAssistance = await loadAiAssistanceModule ( ) ;
177186 return new AiAssistance . ActionDelegate ( ) ;
@@ -186,7 +195,7 @@ UI.ActionRegistration.registerActionExtension({
186195 return [ ] ;
187196 } ,
188197 category : UI . ActionRegistration . ActionCategory . GLOBAL ,
189- title : i18nLazyString ( UIStrings . askAi ) ,
198+ title : ( ) => titleForAiAssistanceActions ( ) ,
190199 async loadActionDelegate ( ) {
191200 const AiAssistance = await loadAiAssistanceModule ( ) ;
192201 return new AiAssistance . ActionDelegate ( ) ;
@@ -201,7 +210,7 @@ UI.ActionRegistration.registerActionExtension({
201210 return [ ] ;
202211 } ,
203212 category : UI . ActionRegistration . ActionCategory . GLOBAL ,
204- title : i18nLazyString ( UIStrings . debugWithAi ) ,
213+ title : ( ) => titleForAiAssistanceActions ( ) ,
205214 async loadActionDelegate ( ) {
206215 const AiAssistance = await loadAiAssistanceModule ( ) ;
207216 return new AiAssistance . ActionDelegate ( ) ;
@@ -216,7 +225,7 @@ UI.ActionRegistration.registerActionExtension({
216225 return [ ] ;
217226 } ,
218227 category : UI . ActionRegistration . ActionCategory . GLOBAL ,
219- title : i18nLazyString ( UIStrings . debugWithAi ) ,
228+ title : ( ) => titleForAiAssistanceActions ( ) ,
220229 async loadActionDelegate ( ) {
221230 const AiAssistance = await loadAiAssistanceModule ( ) ;
222231 return new AiAssistance . ActionDelegate ( ) ;
@@ -231,7 +240,7 @@ UI.ActionRegistration.registerActionExtension({
231240 return [ ] ;
232241 } ,
233242 category : UI . ActionRegistration . ActionCategory . GLOBAL ,
234- title : i18nLazyString ( UIStrings . askAi ) ,
243+ title : ( ) => titleForAiAssistanceActions ( ) ,
235244 async loadActionDelegate ( ) {
236245 const AiAssistance = await loadAiAssistanceModule ( ) ;
237246 return new AiAssistance . ActionDelegate ( ) ;
@@ -248,7 +257,7 @@ UI.ActionRegistration.registerActionExtension({
248257 return [ ] ;
249258 } ,
250259 category : UI . ActionRegistration . ActionCategory . GLOBAL ,
251- title : i18nLazyString ( UIStrings . askAi ) ,
260+ title : ( ) => titleForAiAssistanceActions ( ) ,
252261 async loadActionDelegate ( ) {
253262 const AiAssistance = await loadAiAssistanceModule ( ) ;
254263 return new AiAssistance . ActionDelegate ( ) ;
@@ -262,7 +271,7 @@ UI.ActionRegistration.registerActionExtension({
262271 return [ ] ;
263272 } ,
264273 category : UI . ActionRegistration . ActionCategory . GLOBAL ,
265- title : i18nLazyString ( UIStrings . debugWithAi ) ,
274+ title : ( ) => titleForAiAssistanceActions ( ) ,
266275 async loadActionDelegate ( ) {
267276 const AiAssistance = await loadAiAssistanceModule ( ) ;
268277 return new AiAssistance . ActionDelegate ( ) ;
0 commit comments