Skip to content

Commit 10099c8

Browse files
Samiya CaurDevtools-frontend LUCI CQ
authored andcommitted
Fix "Learn more" in FRE dialog not announcing the extra context
The aria-label on devtools-button does not work, instead we need to add title to enclosed button for announcement to work in Windows. Also renamed learnMoreButtonTitle to learnMoreButtonText so that it is more clear. Also, fixed settings text which got missed previously Fixed: 441578543, 440553443 Change-Id: I2354a4d47958af53af1e742b29eadfbadf0f75e2 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6904712 Commit-Queue: Samiya Caur <[email protected]> Reviewed-by: Ergün Erdoğmuş <[email protected]>
1 parent 8b519b7 commit 10099c8

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

front_end/panels/ai_assistance/PatchWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ export class PatchWidget extends UI.Widget.Widget {
599599
void UI.ViewManager.ViewManager.instance().showView('chrome-ai');
600600
},
601601
ariaLabel: lockedString(UIStringsNotTranslate.freDisclaimerHeader),
602-
learnMoreButtonTitle: lockedString(UIStringsNotTranslate.learnMore),
602+
learnMoreButtonText: lockedString(UIStringsNotTranslate.learnMore),
603603
});
604604

605605
if (result) {

front_end/panels/common/FreDialog.ts

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

3838
export class FreDialog {
39-
static show({header, reminderItems, onLearnMoreClick, ariaLabel, learnMoreButtonTitle, learnMoreButtonAriaLabel}: {
39+
static show({header, reminderItems, onLearnMoreClick, ariaLabel, learnMoreButtonText, learnMoreButtonAriaLabel}: {
4040
header: {
4141
iconName: string,
4242
text: Platform.UIString.LocalizedString,
@@ -47,7 +47,7 @@ export class FreDialog {
4747
}>,
4848
onLearnMoreClick: () => void,
4949
ariaLabel?: string,
50-
learnMoreButtonTitle?: string,
50+
learnMoreButtonText?: string,
5151
learnMoreButtonAriaLabel?: string,
5252
}): Promise<boolean> {
5353
const dialog = new UI.Dialog.Dialog();
@@ -83,8 +83,9 @@ export class FreDialog {
8383
@click=${onLearnMoreClick}
8484
.jslogContext=${'fre-disclaimer.learn-more'}
8585
.variant=${Buttons.Button.Variant.OUTLINED}
86+
.title=${learnMoreButtonAriaLabel ?? i18nString(UIStrings.learnMore)}
8687
aria-label=${ifDefined(learnMoreButtonAriaLabel)}>
87-
${learnMoreButtonTitle ?? i18nString(UIStrings.learnMore)}
88+
${learnMoreButtonText ?? i18nString(UIStrings.learnMore)}
8889
</devtools-button>
8990
<div class="right-buttons">
9091
<devtools-button

front_end/panels/settings/AISettingsTab.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ const UIStrings = {
177177
* @description Explainer for which data is being sent for the 'Code suggestions' feature
178178
*/
179179
codeSuggestionsSendData:
180-
'To generate annotation suggestions, your performance trace is sent to Google. This data may be seen by human reviewers to improve this feature.',
180+
'To generate code suggestions, your console input, the history of your current console session, the currently inspected CSS, and the contents of the currently open file are shared with Google. This data may be seen by human reviewers to improve this feature.',
181181
/**
182182
* @description Explainer for which data is being sent for the 'Code suggestions' feature when logging is not enabled
183183
*/
184184
codeSuggestionsSendDataNoLogging:
185-
'To generate annotation suggestions, your performance trace is sent to Google. This data will not be used to improve Google’s AI models. Your organization may change these settings at any time.',
185+
'To generate code suggestions, your console input, the history of your current console session, the currently inspected CSS, and the contents of the currently open file are shared with Google. This data will not be used to improve Google’s AI models. Your organization may change these settings at any time.',
186186
/**
187187
* @description Label for a link to the terms of service
188188
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ describeWithEnvironment('Overlays', () => {
517517
// This dialog should be visible
518518
assert.isTrue(showFreDialogStub.called, 'Expected FreDialog to be shown but it\'s not shown');
519519

520-
const customLearnMoreButtonTitle = showFreDialogStub.lastCall.args[0].learnMoreButtonTitle;
520+
const customLearnMoreButtonTitle = showFreDialogStub.lastCall.args[0].learnMoreButtonText;
521521
assert.exists(
522522
customLearnMoreButtonTitle, 'Expected FreDialog to have a custom button title but it\'s not provided');
523523
assert.deepEqual(customLearnMoreButtonTitle.toString(), 'Learn more');

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ export class EntryLabelOverlay extends HTMLElement {
577577
onLearnMoreClick: () => {
578578
UI.UIUtils.openInNewTab('https://developer.chrome.com/docs/devtools/performance/annotations#auto-annotations');
579579
},
580-
learnMoreButtonTitle: UIStringsNotTranslate.learnMoreButton,
580+
learnMoreButtonText: UIStringsNotTranslate.learnMoreButton,
581581
});
582582
this.dispatchEvent(new LabelAnnotationsConsentDialogVisibilityChange(false));
583583

0 commit comments

Comments
 (0)