Skip to content

Commit df136ee

Browse files
ergunshDevtools-frontend LUCI CQ
authored andcommitted
[AiAssistance] Use patching flag for change summary view
Bug: 382746811 Change-Id: Ieb5084d8f8fda09151298cb4dc0dcdf0f0d4f83a Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6229631 Commit-Queue: Ergün Erdoğmuş <[email protected]> Commit-Queue: Alex Rudenko <[email protected]> Auto-Submit: Ergün Erdoğmuş <[email protected]> Reviewed-by: Alex Rudenko <[email protected]>
1 parent 03ae42b commit df136ee

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

front_end/panels/ai_assistance/AiAssistancePanel.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
964964
step.code ??= data.code;
965965
step.output ??= data.output;
966966
step.canceled = data.canceled;
967-
if (isAiAssistanceChangeSummariesEnabled() && this.#currentAgent && !this.#currentAgent.isHistoryEntry) {
967+
if (isAiAssistancePatchingEnabled() && this.#currentAgent && !this.#currentAgent.isHistoryEntry) {
968968
this.#viewProps.changeSummary = this.#changeManager.formatChanges(this.#currentAgent.id);
969969
}
970970
commitStep();
@@ -1058,16 +1058,9 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
10581058
}
10591059
}
10601060

1061-
function setAiAssistanceChangeSummariesEnabled(enabled: true): void {
1062-
if (enabled) {
1063-
localStorage.setItem('aiAssistance_changeSummariesEnabled', 'true');
1064-
} else {
1065-
localStorage.setItem('aiAssistance_changeSummariesEnabled', 'false');
1066-
}
1067-
}
1068-
1069-
function isAiAssistanceChangeSummariesEnabled(): boolean {
1070-
return localStorage.getItem('aiAssistance_changeSummariesEnabled') === 'true';
1061+
function isAiAssistancePatchingEnabled(): boolean {
1062+
const config = Common.Settings.Settings.instance().getHostConfig();
1063+
return Boolean(config.devToolsFreestyler?.patching);
10711064
}
10721065

10731066
function setAiAssistanceServerSideLoggingEnabled(enabled: boolean): void {
@@ -1101,6 +1094,4 @@ function isAiAssistanceStylingWithFunctionCallingEnabled(): boolean {
11011094
// @ts-ignore
11021095
globalThis.setAiAssistanceServerSideLoggingEnabled = setAiAssistanceServerSideLoggingEnabled;
11031096
// @ts-ignore
1104-
globalThis.setAiAssistanceChangeSummariesEnabled = setAiAssistanceChangeSummariesEnabled;
1105-
// @ts-ignore
11061097
globalThis.setAiAssistanceStylingWithFunctionCalling = setAiAssistanceStylingWithFunctionCalling;

0 commit comments

Comments
 (0)