Skip to content

Commit 6551e43

Browse files
wolfibDevtools-frontend LUCI CQ
authored andcommitted
[AI Settings] Conditional disclaimer text
This CL updates the AI Settings disclaimer texts and introduces a variation which is only shown to enterprise users which have logging disabled. Bug: 372196790 Change-Id: Ie3aa13ef15c4670cee9376310db1ebcc6e90971f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6038011 Reviewed-by: Alex Rudenko <[email protected]> Auto-Submit: Wolfgang Beyer <[email protected]> Commit-Queue: Alex Rudenko <[email protected]>
1 parent 631e5a6 commit 6551e43

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

front_end/panels/settings/AISettingsTab.test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ describeWithEnvironment('AISettingsTab', () => {
7474
const sharedDisclaimerHeader = view.shadowRoot.querySelector('.shared-disclaimer h2');
7575
assert.strictEqual(sharedDisclaimerHeader?.textContent, 'Boost your productivity with AI');
7676

77+
const disclaimers = view.shadowRoot.querySelectorAll('.shared-disclaimer .disclaimer-list div');
78+
assert.strictEqual(
79+
disclaimers[3].textContent,
80+
'These features send relevant data to Google. Google collects this data and feedback to improve its products and services with the help of human reviewers. Avoid sharing sensitive or personal information.');
81+
assert.strictEqual(
82+
disclaimers[7].textContent, 'Depending on your region, Google may refrain from data collection.');
83+
7784
const settingCards = view.shadowRoot.querySelectorAll('.setting-card h2');
7885
const settingNames = Array.from(settingCards).map(element => element.textContent);
7986
assert.deepEqual(settingNames, ['Console Insights', 'AI assistance']);
@@ -82,6 +89,35 @@ describeWithEnvironment('AISettingsTab', () => {
8289
assert.strictEqual(settingCardDesc[1].textContent, 'Get help with understanding CSS styles');
8390
});
8491

92+
it('renders different dislaimers for managed users which have logging disabled', async () => {
93+
Common.Settings.moduleSetting('console-insights-enabled').set(true);
94+
Common.Settings.moduleSetting('ai-assistance-enabled').set(true);
95+
const stub = getGetHostConfigStub({
96+
aidaAvailability: {
97+
enabled: true,
98+
blockedByAge: false,
99+
blockedByEnterprisePolicy: false,
100+
blockedByGeo: false,
101+
disallowLogging: true,
102+
enterprisePolicyValue: 1,
103+
},
104+
});
105+
106+
view = new Settings.AISettingsTab.AISettingsTab();
107+
renderElementIntoDOM(view);
108+
await view.render();
109+
assert.isNotNull(view.shadowRoot);
110+
111+
const disclaimers = view.shadowRoot.querySelectorAll('.shared-disclaimer .disclaimer-list div');
112+
assert.strictEqual(
113+
disclaimers[3].textContent,
114+
'Usage data will be retained for up to 18 months and stored in such a way that Google can’t tell who provided it.');
115+
assert.strictEqual(
116+
disclaimers[5].textContent,
117+
'Your content will not be used by human reviewers to improve AI. Your organization may change these settings at any time. Depending on your Google account management and/or region, Google may refrain from data collection.');
118+
stub.restore();
119+
});
120+
85121
it('renders with explain this resource enabled', async () => {
86122
mockHostConfigWithExplainThisResourceEnabled();
87123
Common.Settings.moduleSetting('console-insights-enabled').set(true);

front_end/panels/settings/AISettingsTab.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as Common from '../../core/common/common.js';
66
import * as Host from '../../core/host/host.js';
77
import * as i18n from '../../core/i18n/i18n.js';
88
import type * as Platform from '../../core/platform/platform.js';
9+
import * as Root from '../../core/root/root.js';
910
import * as Buttons from '../../ui/components/buttons/buttons.js';
1011
import type * as IconButton from '../../ui/components/icon_button/icon_button.js';
1112
import * as Input from '../../ui/components/input/input.js';
@@ -46,8 +47,12 @@ const UIStrings = {
4647
/**
4748
*@description Text describing a fact to consider when using AI features
4849
*/
49-
adminSettings:
50-
'Depending on your Google account management and/or region, Google may refrain from data collection. Depending on your organization’s settings, features available to managed users may vary.',
50+
dataCollection: 'Depending on your region, Google may refrain from data collection.',
51+
/**
52+
*@description Text describing a fact to consider when using AI features
53+
*/
54+
dataCollectionNoLogging:
55+
'Your content will not be used by human reviewers to improve AI. Your organization may change these settings at any time. Depending on your Google account management and/or region, Google may refrain from data collection.',
5156
/**
5257
*@description Text describing the 'Console Insights' feature
5358
*/
@@ -326,12 +331,17 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
326331
const privacyNoticeLink = UI.XLink.XLink.create(
327332
'https://policies.google.com/privacy', i18nString(UIStrings.privacyNotice), undefined, undefined,
328333
'privacy-notice');
334+
const noLogging = Common.Settings.Settings.instance().getHostConfig().aidaAvailability?.enterprisePolicyValue ===
335+
Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING;
329336

330337
const bulletPoints = [
331338
{icon: 'psychiatry', text: i18nString(UIStrings.experimentalFeatures)},
332-
{icon: 'google', text: i18nString(UIStrings.sendsDataToGoogle)},
339+
...noLogging ? [] : [{icon: 'google', text: i18nString(UIStrings.sendsDataToGoogle)}],
333340
{icon: 'calendar-today', text: i18nString(UIStrings.retainData)},
334-
{icon: 'corporate-fare', text: i18nString(UIStrings.adminSettings)},
341+
{
342+
icon: 'corporate-fare',
343+
text: noLogging ? i18nString(UIStrings.dataCollectionNoLogging) : i18nString(UIStrings.dataCollection),
344+
},
335345
{
336346
icon: 'policy',
337347
text: html`${i18n.i18n.getFormatLocalizedString(str_, UIStrings.termsOfServicePrivacyNotice, {

0 commit comments

Comments
 (0)