@@ -132,6 +132,22 @@ const UIStringsNotTranslate = {
132132 *@description Placeholder text for the chat UI input.
133133 */
134134 inputPlaceholderForPerformanceAgent : 'Ask a question about the selected item and its call tree' ,
135+ /**
136+ *@description Placeholder text for the chat UI input when there is no context selected.
137+ */
138+ inputPlaceholderForFreestylerAgentNoContext : 'Select an element to ask a question' ,
139+ /**
140+ *@description Placeholder text for the chat UI input when there is no context selected.
141+ */
142+ inputPlaceholderForNetworkAgentNoContext : 'Select a network request to ask a question' ,
143+ /**
144+ *@description Placeholder text for the chat UI input when there is no context selected.
145+ */
146+ inputPlaceholderForFileAgentNoContext : 'Select a file to ask a question' ,
147+ /**
148+ *@description Placeholder text for the chat UI input when there is no context selected.
149+ */
150+ inputPlaceholderForPerformanceAgentNoContext : 'Select an item to ask a question' ,
135151 /**
136152 * @description Placeholder text for the input shown when the conversation is blocked because a cross-origin context was selected.
137153 */
@@ -1043,13 +1059,19 @@ export class ChatView extends HTMLElement {
10431059 }
10441060 switch ( agentType ) {
10451061 case AgentType . STYLING :
1046- return lockedString ( UIStringsNotTranslate . inputPlaceholderForFreestylerAgent ) ;
1062+ return this . #props. selectedContext ? lockedString ( UIStringsNotTranslate . inputPlaceholderForFreestylerAgent ) :
1063+ lockedString ( UIStringsNotTranslate . inputPlaceholderForFileAgentNoContext ) ;
10471064 case AgentType . FILE :
1048- return lockedString ( UIStringsNotTranslate . inputPlaceholderForFileAgent ) ;
1065+ return this . #props. selectedContext ? lockedString ( UIStringsNotTranslate . inputPlaceholderForFileAgent ) :
1066+ lockedString ( UIStringsNotTranslate . inputPlaceholderForFileAgentNoContext ) ;
10491067 case AgentType . NETWORK :
1050- return lockedString ( UIStringsNotTranslate . inputPlaceholderForNetworkAgent ) ;
1068+ return this . #props. selectedContext ?
1069+ lockedString ( UIStringsNotTranslate . inputPlaceholderForNetworkAgent ) :
1070+ lockedString ( UIStringsNotTranslate . inputPlaceholderForNetworkAgentNoContext ) ;
10511071 case AgentType . PERFORMANCE :
1052- return lockedString ( UIStringsNotTranslate . inputPlaceholderForPerformanceAgent ) ;
1072+ return this . #props. selectedContext ?
1073+ lockedString ( UIStringsNotTranslate . inputPlaceholderForPerformanceAgent ) :
1074+ lockedString ( UIStringsNotTranslate . inputPlaceholderForPerformanceAgentNoContext ) ;
10531075 }
10541076 }
10551077
0 commit comments