Skip to content

Commit e44baae

Browse files
AlinaVarkkiDevtools-frontend LUCI CQ
authored andcommitted
[RPP][AI] Add aria-label for the tooltip and the 'learn more in settings' tooltip button
Bug: 406544094, 406543373 Change-Id: Ie7ab6bd97916e44e07bec1229ef22021c1677bfb Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6401713 Auto-Submit: Alina Varkki <[email protected]> Commit-Queue: Alina Varkki <[email protected]> Commit-Queue: Jack Franklin <[email protected]> Reviewed-by: Jack Franklin <[email protected]>
1 parent 1d0247a commit e44baae

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ describeWithEnvironment('Overlays', () => {
631631
assert.isOk(tooltip);
632632
assert.strictEqual(
633633
cleanTextContent(tooltip.innerText),
634-
'The selected call stack is sent to Google. The content you submit and that is generated by this feature will be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right. Learn more',
634+
'The selected call stack is sent to Google. The content you submit and that is generated by this feature will be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right. Learn more in settings',
635635
);
636636
});
637637

@@ -664,7 +664,7 @@ describeWithEnvironment('Overlays', () => {
664664
assert.isOk(tooltip);
665665
assert.strictEqual(
666666
cleanTextContent(tooltip.innerText),
667-
'The selected call stack is sent to Google. The content you submit and that is generated by this feature will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right. Learn more',
667+
'The selected call stack is sent to Google. The content you submit and that is generated by this feature will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right. Learn more in settings',
668668
);
669669
});
670670

@@ -735,7 +735,7 @@ describeWithEnvironment('Overlays', () => {
735735
assert.isOk(tooltip);
736736
assert.strictEqual(
737737
cleanTextContent(tooltip.innerText),
738-
'Auto annotations are not available. Learn more',
738+
'Auto annotations are not available. Learn more in settings',
739739
);
740740
});
741741

@@ -762,7 +762,7 @@ describeWithEnvironment('Overlays', () => {
762762
assert.isOk(tooltip);
763763
assert.strictEqual(
764764
cleanTextContent(tooltip.innerText),
765-
'Auto annotations are not available. Learn more',
765+
'Auto annotations are not available. Learn more in settings',
766766
);
767767
});
768768

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,15 @@ const UIStrings = {
4545
/**
4646
*@description Label used for screenreaders on the FRE dialog
4747
*/
48-
freDialog: 'Get AI-powered annotation suggestions dialog'
48+
freDialog: 'Get AI-powered annotation suggestions dialog',
49+
/**
50+
*@description Screen-reader text for a tooltip link for navigating to "AI innovations" settings where the user can learn more about auto-annotations.
51+
*/
52+
learnMoreAriaLabel: 'Learn more about auto annotations in settings',
53+
/**
54+
*@description Screen-reader text for a tooltip icon.
55+
*/
56+
moreInfoAriaLabel: 'More info',
4957
} as const;
5058

5159
/*
@@ -55,7 +63,7 @@ const UIStringsNotTranslate = {
5563
/**
5664
*@description Tooltip link for the navigating to "AI innovations" page in settings.
5765
*/
58-
learnMore: 'Learn more',
66+
learnMore: 'Learn more in settings',
5967
/**
6068
*@description Security disclaimer text displayed when the information icon on a button that generates an AI label is hovered.
6169
*/
@@ -606,7 +614,11 @@ export class EntryLabelOverlay extends HTMLElement {
606614

607615
#renderAITooltip(opts: {textContent: string, includeSettingsButton: boolean}): Lit.TemplateResult {
608616
// clang-format off
609-
return html`<devtools-tooltip variant="rich" id="info-tooltip" ${Directives.ref(this.#richTooltip)}>
617+
return html`<devtools-tooltip
618+
variant="rich"
619+
id="info-tooltip"
620+
aria-label=${i18nString(UIStrings.moreInfoAriaLabel)}
621+
${Directives.ref(this.#richTooltip)}>
610622
<div class="info-tooltip-container">
611623
${opts.textContent}
612624
${opts.includeSettingsButton ? html`
@@ -617,6 +629,7 @@ export class EntryLabelOverlay extends HTMLElement {
617629
click: true,
618630
})}
619631
@click=${this.#onTooltipLearnMoreClick}
632+
aria-label=${i18nString(UIStrings.learnMoreAriaLabel)}
620633
>${lockedString(UIStringsNotTranslate.learnMore)}</button>
621634
` : Lit.nothing}
622635
</div>

0 commit comments

Comments
 (0)