Skip to content

Commit 13cbd6c

Browse files
Samiya CaurDevtools-frontend LUCI CQ
authored andcommitted
[DrJones] Update strings for consent view to include file agent and performance agent.
Bug: 375332654 Change-Id: I90f423255b7b450f029836bbe525086d6e72df11 Fixed: 375332654 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5961677 Reviewed-by: Alex Rudenko <[email protected]> Auto-Submit: Samiya Caur <[email protected]> Commit-Queue: Alex Rudenko <[email protected]>
1 parent 393ebf8 commit 13cbd6c

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

front_end/panels/freestyler/components/FreestylerChatUi.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ const UIStrings = {
5858
*@example {AI assistance in Settings} PH1
5959
*/
6060
turnOnForStylesAndRequests: 'Turn on {PH1} to get help with styles and network requests',
61+
/**
62+
*@description Text for asking the user to turn the AI assistance feature in settings first before they are able to use it.
63+
*@example {AI assistance in Settings} PH1
64+
*/
65+
turnOnForStylesRequestsAndFiles: 'Turn on {PH1} to get help with styles, network requests, and files',
66+
/**
67+
*@description Text for asking the user to turn the AI assistance feature in settings first before they are able to use it.
68+
*@example {AI assistance in Settings} PH1
69+
*/
70+
turnOnForStylesRequestsPerformanceAndFiles:
71+
'Turn on {PH1} to get help with styles, network requests, performance, and files',
6172
/**
6273
*@description The footer disclaimer that links to more information about the AI feature.
6374
*/
@@ -1060,11 +1071,21 @@ export class FreestylerChatUi extends HTMLElement {
10601071
void UI.ViewManager.ViewManager.instance().showView('chrome-ai');
10611072
});
10621073
settingsLink.setAttribute('jslog', `${VisualLogging.action('open-ai-settings').track({click: true})}`);
1074+
return html`${i18n.i18n.getFormatLocalizedString(str_, this.#getStringForConsentView(), {PH1: settingsLink})}`;
1075+
}
1076+
1077+
#getStringForConsentView(): string {
10631078
const config = Common.Settings.Settings.instance().getHostConfig();
1064-
return html`${
1065-
config.devToolsExplainThisResourceDogfood?.enabled ?
1066-
i18n.i18n.getFormatLocalizedString(str_, UIStrings.turnOnForStylesAndRequests, {PH1: settingsLink}) :
1067-
i18n.i18n.getFormatLocalizedString(str_, UIStrings.turnOnForStyles, {PH1: settingsLink})}`;
1079+
if (config.devToolsAiAssistancePerformanceAgentDogfood?.enabled) {
1080+
return UIStrings.turnOnForStylesRequestsPerformanceAndFiles;
1081+
}
1082+
if (config.devToolsAiAssistanceFileAgentDogfood?.enabled) {
1083+
return UIStrings.turnOnForStylesRequestsAndFiles;
1084+
}
1085+
if (config.devToolsExplainThisResourceDogfood?.enabled) {
1086+
return UIStrings.turnOnForStylesAndRequests;
1087+
}
1088+
return UIStrings.turnOnForStyles;
10681089
}
10691090

10701091
#getUnavailableAidaAvailabilityContents(

0 commit comments

Comments
 (0)