Skip to content

Commit 9da17a4

Browse files
Samiya CaurDevtools-frontend LUCI CQ
authored andcommitted
Update name of the setting for AI code completion
This CL also updates the string for opt-in and setting to include "the currently inspected CSS" Bug: 425865106 Change-Id: I00b3f8ff8d37f106c7013f3fa0506316764b6c87 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6826465 Auto-Submit: Samiya Caur <[email protected]> Reviewed-by: Ergün Erdoğmuş <[email protected]> Commit-Queue: Ergün Erdoğmuş <[email protected]>
1 parent 357669d commit 9da17a4

File tree

9 files changed

+17
-18
lines changed

9 files changed

+17
-18
lines changed

front_end/panels/common/AiCodeCompletionTeaser.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describeWithEnvironment('AiCodeCompletionTeaser', () => {
3535

3636
afterEach(() => {
3737
Common.Settings.Settings.instance().settingForTest('ai-code-completion-teaser-dismissed').set(false);
38-
Common.Settings.Settings.instance().settingForTest('ai-code-completion-fre-completed').set(false);
38+
Common.Settings.Settings.instance().settingForTest('ai-code-completion-enabled').set(false);
3939
sinon.restore();
4040
});
4141

front_end/panels/common/AiCodeCompletionTeaser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ const UIStringsNotTranslate = {
6060
* @description Second disclaimer item text for the fre dialog.
6161
*/
6262
freDisclaimerTextPrivacy:
63-
'To generate code suggestions, your console input, the history of your current console session, and the contents of the currently open file are shared with Google. This data may be seen by human reviewers to improve this feature.',
63+
'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.',
6464
/**
6565
* @description Second disclaimer item text for the fre dialog when enterprise logging is off.
6666
*/
6767
freDisclaimerTextPrivacyNoLogging:
68-
'To generate code suggestions, your console input, the history of your current console session, 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.',
68+
'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.',
6969
/**
7070
* @description Third disclaimer item text for the fre dialog.
7171
*/
@@ -124,7 +124,7 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
124124

125125
// Whether the user completed first run experience dialog or not.
126126
#aiCodeCompletionFreCompletedSetting =
127-
Common.Settings.Settings.instance().createSetting('ai-code-completion-fre-completed', false);
127+
Common.Settings.Settings.instance().createSetting('ai-code-completion-enabled', false);
128128
// Whether the user dismissed the teaser or not.
129129
#aiCodeCompletionTeaserDismissedSetting =
130130
Common.Settings.Settings.instance().createSetting('ai-code-completion-teaser-dismissed', false);

front_end/panels/console/ConsolePrompt.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describeWithMockConnection('ConsoleContextSelector', () => {
5252
UI.Context.Context.instance().setFlavor(SDK.RuntimeModel.ExecutionContext, targetContext);
5353
evaluateOnTarget = sinon.stub(target.runtimeAgent(), 'invoke_evaluate');
5454

55-
Common.Settings.Settings.instance().createSetting('ai-code-completion-fre-completed', false);
55+
Common.Settings.Settings.instance().createSetting('ai-code-completion-enabled', false);
5656
});
5757

5858
afterEach(async () => {
@@ -157,7 +157,7 @@ describeWithMockConnection('ConsoleContextSelector', () => {
157157

158158
it('updates aiCodeCompletion when FRE setting is updated', () => {
159159
assert.isUndefined(consolePrompt['aiCodeCompletion']);
160-
const setting = Common.Settings.Settings.instance().settingForTest('ai-code-completion-fre-completed');
160+
const setting = Common.Settings.Settings.instance().settingForTest('ai-code-completion-enabled');
161161
setting.set(true);
162162
assert.exists(consolePrompt['aiCodeCompletion']);
163163
setting.set(false);
@@ -169,7 +169,7 @@ describeWithMockConnection('ConsoleContextSelector', () => {
169169
completeCode: Promise.resolve(null),
170170
});
171171
consolePrompt.setAidaClientForTest(mockAidaClient);
172-
Common.Settings.Settings.instance().settingForTest('ai-code-completion-fre-completed').set(true);
172+
Common.Settings.Settings.instance().settingForTest('ai-code-completion-enabled').set(true);
173173
const onTextChangedSpy = sinon.spy(
174174
consolePrompt['aiCodeCompletion'] as AiCodeCompletion.AiCodeCompletion.AiCodeCompletion, 'onTextChanged');
175175
const consoleModel = target.model(SDK.ConsoleModel.ConsoleModel);

front_end/panels/console/ConsolePrompt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
7575
private placeholderCompartment: CodeMirror.Compartment = new CodeMirror.Compartment();
7676
private teaserContainer?: HTMLDivElement;
7777
private aiCodeCompletionSetting =
78-
Common.Settings.Settings.instance().createSetting('ai-code-completion-fre-completed', false);
78+
Common.Settings.Settings.instance().createSetting('ai-code-completion-enabled', false);
7979
private aiCodeCompletionCitations?: Host.AidaClient.Citation[] = [];
8080

8181
#getJavaScriptCompletionExtensions(): CodeMirror.Extension {

front_end/panels/console/ConsoleView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export class ConsoleView extends UI.Widget.VBox implements
333333
#isDetached = false;
334334
#onIssuesCountUpdateBound = this.#onIssuesCountUpdate.bind(this);
335335
private aiCodeCompletionSetting =
336-
Common.Settings.Settings.instance().createSetting('ai-code-completion-fre-completed', false);
336+
Common.Settings.Settings.instance().createSetting('ai-code-completion-enabled', false);
337337
private aiCodeCompletionSummaryToolbarContainer?: HTMLElement;
338338
private aiCodeCompletionSummaryToolbar?: AiCodeCompletionSummaryToolbar;
339339

front_end/panels/settings/AISettingsTab.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describeWithEnvironment('AISettingsTab', () => {
6262
Common.Settings.moduleSetting('console-insights-enabled').set(false);
6363
Common.Settings.moduleSetting('ai-assistance-enabled').set(true);
6464
Common.Settings.moduleSetting('ai-annotations-enabled').set(true);
65-
Common.Settings.moduleSetting('ai-code-completion-fre-completed').set(false);
65+
Common.Settings.moduleSetting('ai-code-completion-enabled').set(false);
6666

6767
view = new Settings.AISettingsTab.AISettingsTab();
6868
renderElementIntoDOM(view);
@@ -85,7 +85,7 @@ describeWithEnvironment('AISettingsTab', () => {
8585
Common.Settings.moduleSetting('console-insights-enabled').set(true);
8686
Common.Settings.moduleSetting('ai-assistance-enabled').set(true);
8787
Common.Settings.moduleSetting('ai-annotations-enabled').set(true);
88-
Common.Settings.moduleSetting('ai-code-completion-fre-completed').set(true);
88+
Common.Settings.moduleSetting('ai-code-completion-enabled').set(true);
8989

9090
view = new Settings.AISettingsTab.AISettingsTab();
9191
renderElementIntoDOM(view);
@@ -116,7 +116,7 @@ describeWithEnvironment('AISettingsTab', () => {
116116
Common.Settings.moduleSetting('console-insights-enabled').set(true);
117117
Common.Settings.moduleSetting('ai-assistance-enabled').set(true);
118118
Common.Settings.moduleSetting('ai-annotations-enabled').set(true);
119-
Common.Settings.moduleSetting('ai-code-completion-fre-completed').set(true);
119+
Common.Settings.moduleSetting('ai-code-completion-enabled').set(true);
120120
updateHostConfig({
121121
aidaAvailability: {
122122
enabled: true,

front_end/panels/settings/AISettingsTab.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ const UIStrings = {
174174
* @description Explainer for which data is being sent for the 'Code suggestions' feature
175175
*/
176176
codeSuggestionsSendData:
177-
'To generate code suggestions, your console input, the history of your current console session, and the contents of the currently open file are shared with Google. This data may be seen by human reviewers to improve this feature.',
177+
'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.',
178178
/**
179179
* @description Explainer for which data is being sent for the 'Code suggestions' feature when logging is not enabled
180180
*/
181181
codeSuggestionsSendDataNoLogging:
182-
'To generate code suggestions, your console input, the history of your current console session, and the contents of the currently open file are shared with Google. This data will not be used to improve Google’s AI models.',
182+
'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.',
183183
/**
184184
* @description Label for a link to the terms of service
185185
*/
@@ -256,7 +256,7 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
256256
if (Root.Runtime.hostConfig.devToolsAiCodeCompletion?.enabled) {
257257
// Get an existing setting or, if it does not exist, create a new one.
258258
this.#aiCodeCompletionSetting =
259-
Common.Settings.Settings.instance().createSetting('ai-code-completion-fre-completed', false);
259+
Common.Settings.Settings.instance().createSetting('ai-code-completion-enabled', false);
260260
}
261261

262262
this.#boundOnAidaAvailabilityChange = this.#onAidaAvailabilityChange.bind(this);

front_end/testing/EnvironmentHelpers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,7 @@ export async function initializeGlobalVars({reset = true} = {}) {
301301
Common.Settings.SettingCategory.AI, 'ai-assistance-patching-fre-completed', false,
302302
Common.Settings.SettingType.BOOLEAN),
303303
createSettingValue(
304-
Common.Settings.SettingCategory.AI, 'ai-code-completion-fre-completed', false,
305-
Common.Settings.SettingType.BOOLEAN),
304+
Common.Settings.SettingCategory.AI, 'ai-code-completion-enabled', false, Common.Settings.SettingType.BOOLEAN),
306305
createSettingValue(
307306
Common.Settings.SettingCategory.MOBILE, 'emulation.show-device-outline', false,
308307
Common.Settings.SettingType.BOOLEAN),

front_end/ui/visual_logging/KnownContextValues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export const knownContextValues = new Set([
344344
'ai-assistance-history-images',
345345
'ai-assistance-patching-fre-completed',
346346
'ai-assistance-patching-selected-project-id',
347-
'ai-code-completion-fre-completed',
347+
'ai-code-completion-enabled',
348348
'ai-code-completion-teaser-dismissed',
349349
'ai-code-completion-teaser.dismiss',
350350
'ai-code-completion-teaser.fre',

0 commit comments

Comments
 (0)