Skip to content

Commit 1d0247a

Browse files
AlinaVarkkiDevtools-frontend LUCI CQ
authored andcommitted
[RPP] Update the 'learn more' links and button name
Bug: 405316456, 406544094 Change-Id: Ie056d0ba2816f7c89664f0faf4804d77a3f42b56 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6400620 Auto-Submit: Alina Varkki <[email protected]> Commit-Queue: Alina Varkki <[email protected]> Reviewed-by: Jack Franklin <[email protected]>
1 parent 1d64325 commit 1d0247a

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

front_end/panels/common/common.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,7 @@ const str_ = i18n.i18n.registerUIStrings('panels/common/common.ts', UIStrings);
4040
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
4141

4242
export class FreDialog {
43-
static show({
44-
header,
45-
reminderItems,
46-
onLearnMoreClick,
47-
ariaLabel,
48-
}: {
43+
static show({header, reminderItems, onLearnMoreClick, ariaLabel, learnMoreButtonTitle}: {
4944
header: {
5045
iconName: string,
5146
text: Platform.UIString.LocalizedString,
@@ -56,6 +51,7 @@ export class FreDialog {
5651
}>,
5752
onLearnMoreClick: () => void,
5853
ariaLabel?: string,
54+
learnMoreButtonTitle?: string,
5955
}): Promise<boolean> {
6056
const dialog = new UI.Dialog.Dialog();
6157
if (ariaLabel) {
@@ -90,7 +86,7 @@ export class FreDialog {
9086
@click=${onLearnMoreClick}
9187
.jslogContext=${'fre-disclaimer.learn-more'}
9288
.variant=${Buttons.Button.Variant.OUTLINED}>
93-
${i18nString(UIStrings.learnMore)}
89+
${learnMoreButtonTitle ?? i18nString(UIStrings.learnMore)}
9490
</devtools-button>
9591
<div class="right-buttons">
9692
<devtools-button

front_end/panels/settings/AISettingsTab.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,17 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
339339
settingDescription: i18nString(UIStrings.getAIAnnotationsSuggestions),
340340
enableSettingText: i18nString(UIStrings.enableAiSuggestedAnnotations),
341341
settingItems: [
342-
{iconName: 'pen', text: i18nString(UIStrings.getAIAnnotationsSuggestions)},
342+
{iconName: 'pen-spark', text: i18nString(UIStrings.getAIAnnotationsSuggestions)},
343343
],
344344
toConsiderSettingItems: [{
345345
iconName: 'google',
346346
text: noLogging ? i18nString(UIStrings.generatedAiAnnotationsSendDataNoLogging) :
347347
i18nString(UIStrings.generatedAiAnnotationsSendData)
348348
}],
349-
// TODO(b/405316456): Add a relevant link here once we have written the documentation.
350-
learnMoreLink: {url: '', linkJSLogContext: 'learn-more.ai-annotations'},
349+
learnMoreLink: {
350+
url: 'https://developer.chrome.com/docs/devtools/performance/reference#auto-annotations',
351+
linkJSLogContext: 'learn-more.auto-annotations'
352+
},
351353
settingExpandState: {
352354
isSettingExpanded: false,
353355
expandSettingJSLogContext: 'freestyler.accordion',

front_end/panels/timeline/overlays/OverlaysImpl.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,11 @@ describeWithEnvironment('Overlays', () => {
516516

517517
// This dialog should be visible
518518
assert.isTrue(showFreDialogStub.called, 'Expected FreDialog to be shown but it\'s not shown');
519+
520+
const customLearnMoreButtonTitle = showFreDialogStub.lastCall.args[0].learnMoreButtonTitle;
521+
assert.exists(
522+
customLearnMoreButtonTitle, 'Expected FreDialog to have a custom button title but it\'s not provided');
523+
assert.deepEqual(customLearnMoreButtonTitle.toString(), 'Learn more about auto annotations');
519524
});
520525

521526
it('should not show FRE dialog on the ai suggestion button click if the `ai-annotations-enabled` setting is on',

front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ const UIStringsNotTranslate = {
9898
*@description Third disclaimer item text part for the fre dialog part - settings panel text.
9999
*/
100100
settingsPanel: 'settings panel',
101+
/**
102+
*@description Text for the 'learn more' button displayed in fre.
103+
*/
104+
learnMoreButton: 'Learn more about auto annotations',
101105
} as const;
102106

103107
const str_ = i18n.i18n.registerUIStrings('panels/timeline/overlays/components/EntryLabelOverlay.ts', UIStrings);
@@ -551,11 +555,12 @@ export class EntryLabelOverlay extends HTMLElement {
551555
})}
552556
>${lockedString(UIStringsNotTranslate.settingsPanel)}</x-link>`,
553557
// clang-format on
554-
}
558+
},
555559
],
556560
onLearnMoreClick: () => {
557-
void UI.ViewManager.ViewManager.instance().showView('chrome-ai');
558-
}
561+
UI.UIUtils.openInNewTab('https://developer.chrome.com/docs/devtools/performance/reference#auto-annotations');
562+
},
563+
learnMoreButtonTitle: UIStringsNotTranslate.learnMoreButton,
559564
});
560565

561566
if (userConsented) {

0 commit comments

Comments
 (0)