chrome-devtools-frontend 1.0.1669021 → 1.0.1672388
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/fixing-skipped-tests/SKILL.md +6 -6
- package/.agents/skills/gerrit-cli/SKILL.md +4 -10
- package/.agents/skills/gerrit-cli/references/commands.md +45 -2
- package/.agents/skills/gerrit-cli/references/workflows.md +7 -0
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +34 -152
- package/config/typescript/tsconfig.eslint.json +1 -1
- package/docs/contributing/settings-experiments-features.md +2 -8
- package/docs/ecosystem/automatic_workspace_folders.md +0 -19
- package/eslint.config.mjs +2 -2
- package/front_end/core/common/Lazy.ts +3 -3
- package/front_end/core/common/SettingRegistration.ts +0 -7
- package/front_end/core/common/Settings.ts +0 -38
- package/front_end/core/host/UserMetrics.ts +187 -953
- package/front_end/core/host/UserMetricsEnums.d.ts +949 -0
- package/front_end/core/root/Runtime.ts +21 -133
- package/front_end/core/sdk/CSSMetadata.ts +70 -65
- package/front_end/core/sdk/CategorizedBreakpoint.ts +0 -1
- package/front_end/core/sdk/ChildTargetManager.ts +0 -2
- package/front_end/core/sdk/EmulationModel.ts +0 -2
- package/front_end/core/sdk/EventBreakpointsModel.ts +0 -4
- package/front_end/core/sdk/NetworkManager.ts +0 -3
- package/front_end/core/sdk/PageResourceLoader.ts +9 -9
- package/front_end/core/sdk/RehydratingConnection.ts +52 -4
- package/front_end/core/sdk/Target.ts +0 -4
- package/front_end/devtools_compatibility.js +886 -0
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +7 -6
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +0 -1
- package/front_end/entrypoints/main/MainImpl.ts +18 -22
- package/front_end/foundation/Universe.ts +7 -2
- package/front_end/generated/InspectorBackendCommands.ts +3 -10
- package/front_end/generated/protocol-mapping.d.ts +0 -42
- package/front_end/generated/protocol-proxy-api.d.ts +0 -38
- package/front_end/generated/protocol.ts +9 -169
- package/front_end/models/ai_assistance/AiAgent2.ts +11 -3
- package/front_end/models/ai_assistance/AiConversation.ts +1 -0
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +8 -5
- package/front_end/models/ai_assistance/AiSetting.ts +108 -0
- package/front_end/models/ai_assistance/AiUtils.ts +47 -0
- package/front_end/models/ai_assistance/ChangeManager.ts +1 -0
- package/front_end/models/ai_assistance/ExtensionScope.ts +3 -12
- package/front_end/models/ai_assistance/agents/AiAgent.ts +11 -18
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +3 -0
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +42 -17
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -2
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +253 -155
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +12 -6
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +3 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -0
- package/front_end/models/ai_assistance/injected.ts +1 -0
- package/front_end/models/ai_assistance/performance/AICallTree.ts +1 -0
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
- package/front_end/models/ai_assistance/skills/performance.md +10 -0
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +52 -5
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +4 -4
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +4 -4
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +5 -4
- package/front_end/models/ai_assistance/tools/GetStyles.ts +5 -4
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +5 -4
- package/front_end/models/ai_assistance/tools/README.md +1 -1
- package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +63 -0
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +5 -5
- package/front_end/models/ai_assistance/tools/Tool.ts +118 -24
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +2 -0
- package/front_end/models/badges/UserBadges.ts +2 -0
- package/front_end/models/bindings/NetworkProject.ts +5 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -0
- package/front_end/models/bindings/ResourceUtils.ts +3 -0
- package/front_end/models/crux-manager/CrUXManager.ts +1 -0
- package/front_end/models/emulation/DeviceModeModel.ts +140 -7
- package/front_end/models/emulation/EmulatedDevices.ts +246 -793
- package/front_end/models/issues_manager/IssuesManager.ts +10 -2
- package/front_end/models/live-metrics/LiveMetrics.ts +41 -9
- package/front_end/models/logs/LogManager.ts +8 -5
- package/front_end/models/logs/NetworkLog.ts +1 -0
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +21 -3
- package/front_end/models/persistence/NetworkPersistenceManager.ts +6 -0
- package/front_end/models/project_settings/ProjectSettingsModel.ts +8 -12
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +3 -1
- package/front_end/models/workspace/IgnoreListManager.ts +2 -0
- package/front_end/models/workspace/UISourceCode.ts +2 -0
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +4 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +22 -22
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -7
- package/front_end/panels/ai_assistance/components/ChatInput.ts +4 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +79 -34
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +1 -2
- package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -106
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +1 -1
- package/front_end/panels/application/application.ts +0 -10
- package/front_end/panels/application/components/components.ts +0 -4
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +0 -5
- package/front_end/panels/browser_debugger/EventListenerBreakpointsSidebarPane.ts +6 -12
- package/front_end/panels/browser_debugger/browser_debugger-meta.ts +5 -3
- package/front_end/panels/console/ConsoleFormat.ts +2 -62
- package/front_end/panels/console/ConsoleViewMessage.ts +14 -7
- package/front_end/panels/emulation/AdvancedApp.ts +1 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +83 -69
- package/front_end/panels/emulation/DeviceModeView.ts +4 -134
- package/front_end/panels/emulation/DeviceModeWrapper.ts +52 -69
- package/front_end/panels/emulation/MediaQueryInspector.ts +2 -2
- package/front_end/panels/emulation/emulation-meta.ts +12 -12
- package/front_end/panels/issues/IssuesPane.ts +3 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +6 -0
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +17 -21
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +206 -126
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
- package/front_end/panels/mobile_throttling/CalibrationController.ts +1 -1
- package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +3 -3
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +6 -6
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +11 -11
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +13 -13
- package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +10 -10
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +28 -28
- package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +6 -6
- package/front_end/panels/network/RequestHeadersView.ts +1 -1
- package/front_end/panels/network/ResourceChunkView.ts +243 -144
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +52 -29
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +21 -35
- package/front_end/panels/network/resourceChunkView.css +41 -36
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +21 -12
- package/front_end/panels/profiler/profiler.ts +4 -0
- package/front_end/panels/recorder/RecorderPanel.ts +6 -14
- package/front_end/panels/sensors/LocationsSettingsTab.ts +7 -7
- package/front_end/panels/settings/AISettingsTab.ts +75 -31
- package/front_end/panels/settings/SettingsScreen.ts +8 -13
- package/front_end/panels/settings/components/SyncSection.ts +3 -4
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +200 -18
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +18 -0
- package/front_end/panels/settings/settings-meta.ts +0 -1
- package/front_end/panels/sources/CategorizedBreakpointL10n.ts +0 -2
- package/front_end/panels/sources/DebuggerPausedMessage.ts +11 -5
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/EditingLocationHistoryManager.ts +12 -9
- package/front_end/panels/sources/SourcesPanel.ts +19 -17
- package/front_end/panels/sources/SourcesView.ts +191 -96
- package/front_end/panels/sources/TabbedEditorContainer.ts +3 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -5
- package/front_end/panels/timeline/TimelineUIUtils.ts +15 -0
- package/front_end/panels/timeline/timeline-meta.ts +3 -5
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1332 -193
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
- package/front_end/tsconfig.compatibility.json +2 -1
- package/front_end/tsconfig.json +1 -1
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +4 -7
- package/front_end/ui/components/settings/settings.ts +1 -2
- package/front_end/ui/legacy/Treeoutline.ts +52 -30
- package/front_end/ui/legacy/components/object_ui/CSSStyleSanitizer.ts +74 -0
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +6 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +47 -54
- package/front_end/ui/legacy/components/object_ui/object_ui.ts +2 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -27
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +10 -12
- package/front_end/ui/settings/SettingUIRegistration.ts +0 -8
- package/front_end/ui/visual_logging/KnownContextValues.ts +21 -0
- package/inspector_overlay/tsconfig.json +8 -2
- package/package.json +3 -2
- package/.agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py +0 -47
- package/front_end/core/sdk/CSSModel.test.api.ts +0 -102
- package/front_end/core/sdk/DOMModel.test.api.ts +0 -104
- package/front_end/foundation/Universe.test.api.ts +0 -73
- package/front_end/panels/application/SharedStorageEventsView.ts +0 -128
- package/front_end/panels/application/SharedStorageItemsView.ts +0 -179
- package/front_end/panels/application/SharedStorageListTreeElement.ts +0 -65
- package/front_end/panels/application/SharedStorageModel.ts +0 -249
- package/front_end/panels/application/SharedStorageTreeElement.ts +0 -40
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +0 -191
- package/front_end/panels/application/components/SharedStorageMetadataView.ts +0 -133
- package/front_end/panels/application/components/sharedStorageAccessGrid.css +0 -29
- package/front_end/panels/application/components/sharedStorageMetadataView.css +0 -29
- package/front_end/panels/application/sharedStorageEventsView.css +0 -9
- package/front_end/panels/network/OriginalResourceChunkView.ts +0 -340
- package/front_end/panels/network/originalResourceChunkView.css +0 -49
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +0 -47
- package/front_end/ui/components/settings/settingDeprecationWarning.css +0 -14
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2021 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
4
|
|
|
6
5
|
/*
|
|
7
6
|
* Copyright (C) 2012 Research In Motion Limited. All rights reserved.
|
|
@@ -26,11 +25,10 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
26
25
|
import * as Platform from '../../core/platform/platform.js';
|
|
27
26
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
28
27
|
import * as TextUtils from '../../core/text_utils/text_utils.js';
|
|
29
|
-
import * as UI from '../../ui/legacy/legacy.js';
|
|
30
28
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
31
29
|
|
|
32
30
|
import {BinaryResourceView} from './BinaryResourceView.js';
|
|
33
|
-
import {DataGridItem,
|
|
31
|
+
import {DataGridItem, ResourceChunkView} from './ResourceChunkView.js';
|
|
34
32
|
|
|
35
33
|
const UIStrings = {
|
|
36
34
|
/**
|
|
@@ -91,12 +89,11 @@ const str_ = i18n.i18n.registerUIStrings('panels/network/ResourceWebSocketFrameV
|
|
|
91
89
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
92
90
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
93
91
|
|
|
94
|
-
export class ResourceWebSocketFrameView extends
|
|
92
|
+
export class ResourceWebSocketFrameView extends ResourceChunkView<SDK.NetworkRequest.WebSocketFrame> {
|
|
95
93
|
constructor(request: SDK.NetworkRequest.NetworkRequest) {
|
|
96
|
-
super(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
this.element.setAttribute('jslog', `${VisualLogging.pane('web-socket-messages').track({resize: true})}`);
|
|
94
|
+
super(request, 'network-web-socket-message-filter', 'resource-web-socket-frame-split-view-state',
|
|
95
|
+
i18nString(UIStrings.webSocketFrame), i18nString(UIStrings.filterUsingRegex),
|
|
96
|
+
{jslog: `${VisualLogging.pane('web-socket-messages').track({resize: true})}`});
|
|
100
97
|
}
|
|
101
98
|
|
|
102
99
|
override getRequestChunks(): SDK.NetworkRequest.WebSocketFrame[] {
|
|
@@ -115,7 +112,7 @@ export class ResourceWebSocketFrameView extends OriginalResourceChunkView<SDK.Ne
|
|
|
115
112
|
|
|
116
113
|
override wasShown(): void {
|
|
117
114
|
super.wasShown();
|
|
118
|
-
this.
|
|
115
|
+
this.requestUpdate();
|
|
119
116
|
this.request.addEventListener(SDK.NetworkRequest.Events.WEBSOCKET_FRAME_ADDED, this.onWebSocketFrameAdded, this);
|
|
120
117
|
}
|
|
121
118
|
|
|
@@ -161,16 +158,13 @@ class ResourceFrameNode extends DataGridItem {
|
|
|
161
158
|
readonly frame: SDK.NetworkRequest.WebSocketFrame;
|
|
162
159
|
override readonly isTextFrame: boolean;
|
|
163
160
|
#dataText: string;
|
|
164
|
-
#binaryView: BinaryResourceView|null;
|
|
161
|
+
#binaryView: BinaryResourceView|null = null;
|
|
162
|
+
override readonly data: Record<string, string|HTMLElement>;
|
|
163
|
+
override readonly cssClass?: string;
|
|
165
164
|
|
|
166
165
|
constructor(frame: SDK.NetworkRequest.WebSocketFrame) {
|
|
166
|
+
super();
|
|
167
167
|
let length = String(frame.text.length);
|
|
168
|
-
const time = new Date(frame.time * 1000);
|
|
169
|
-
const timeText = ('0' + time.getHours()).substr(-2) + ':' + ('0' + time.getMinutes()).substr(-2) + ':' +
|
|
170
|
-
('0' + time.getSeconds()).substr(-2) + '.' + ('00' + time.getMilliseconds()).substr(-3);
|
|
171
|
-
const timeNode = document.createElement('div');
|
|
172
|
-
UI.UIUtils.createTextChild(timeNode, timeText);
|
|
173
|
-
UI.Tooltip.Tooltip.install(timeNode, time.toLocaleString());
|
|
174
168
|
|
|
175
169
|
let dataText: string = frame.text;
|
|
176
170
|
let description = ResourceWebSocketFrameView.opCodeDescription(frame.opCode, frame.mask);
|
|
@@ -179,39 +173,31 @@ class ResourceFrameNode extends DataGridItem {
|
|
|
179
173
|
if (frame.type === SDK.NetworkRequest.WebSocketFrameType.Error) {
|
|
180
174
|
description = dataText;
|
|
181
175
|
length = i18nString(UIStrings.na);
|
|
182
|
-
|
|
183
176
|
} else if (isTextFrame) {
|
|
184
177
|
description = dataText;
|
|
185
|
-
|
|
186
178
|
} else if (frame.opCode === OpCodes.BINARY_FRAME) {
|
|
187
179
|
length = i18n.ByteUtilities.bytesToString(Platform.StringUtilities.base64ToSize(frame.text));
|
|
188
180
|
description = opCodeDescriptions[frame.opCode]();
|
|
189
|
-
|
|
190
181
|
} else {
|
|
191
182
|
dataText = description;
|
|
192
183
|
}
|
|
193
184
|
|
|
194
|
-
super({data: description, length, time: timeNode});
|
|
195
|
-
|
|
196
185
|
this.frame = frame;
|
|
197
186
|
this.isTextFrame = isTextFrame;
|
|
198
187
|
this.#dataText = dataText;
|
|
199
188
|
|
|
200
|
-
this
|
|
201
|
-
|
|
189
|
+
this.data = {
|
|
190
|
+
data: description,
|
|
191
|
+
length,
|
|
192
|
+
};
|
|
202
193
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
super.createCells(element);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
override nodeSelfHeight(): number {
|
|
214
|
-
return 21;
|
|
194
|
+
if (frame.type === SDK.NetworkRequest.WebSocketFrameType.Error) {
|
|
195
|
+
this.cssClass = 'resource-chunk-view-row-error';
|
|
196
|
+
} else if (frame.type === SDK.NetworkRequest.WebSocketFrameType.Send) {
|
|
197
|
+
this.cssClass = 'resource-chunk-view-row-send';
|
|
198
|
+
} else if (frame.type === SDK.NetworkRequest.WebSocketFrameType.Receive) {
|
|
199
|
+
this.cssClass = 'resource-chunk-view-row-receive';
|
|
200
|
+
}
|
|
215
201
|
}
|
|
216
202
|
|
|
217
203
|
override dataText(): string {
|
|
@@ -4,46 +4,51 @@
|
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.resource-chunk-view .data-grid {
|
|
12
|
-
flex: auto;
|
|
13
|
-
border: none;
|
|
14
|
-
|
|
15
|
-
.resource-chunk-view-td {
|
|
16
|
-
border-bottom: 1px solid var(--sys-color-divider);
|
|
7
|
+
@scope to (devtools-widget > *) {
|
|
8
|
+
:scope {
|
|
9
|
+
overflow: auto;
|
|
10
|
+
height: 100%;
|
|
17
11
|
}
|
|
18
12
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
&.resource-chunk-view-row-receive td:first-child::before {
|
|
27
|
-
content: "\2B07";
|
|
28
|
-
color: var(--sys-color-error);
|
|
29
|
-
padding-right: 4px;
|
|
30
|
-
}
|
|
13
|
+
.resource-chunk-view {
|
|
14
|
+
height: 100%;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
user-select: text;
|
|
19
|
+
}
|
|
31
20
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
devtools-split-view {
|
|
22
|
+
flex: auto;
|
|
23
|
+
height: 100%;
|
|
24
|
+
}
|
|
35
25
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
.data-grid .data-container table.data {
|
|
27
|
+
tr.data-grid-data-grid-node {
|
|
28
|
+
td.resource-chunk-view-td {
|
|
29
|
+
border-bottom: 1px solid var(--sys-color-divider);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.resource-chunk-view-row-send td:first-child::before {
|
|
33
|
+
content: "\2B06";
|
|
34
|
+
color: var(--sys-color-tertiary);
|
|
35
|
+
padding-right: 4px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.resource-chunk-view-row-receive td:first-child::before {
|
|
39
|
+
content: "\2B07";
|
|
40
|
+
color: var(--sys-color-error);
|
|
41
|
+
padding-right: 4px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.resource-chunk-view-row-send {
|
|
45
|
+
background-color: color-mix(in srgb, var(--sys-color-tertiary-container), transparent 50%);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.resource-chunk-view-row-error {
|
|
49
|
+
background-color: var(--sys-color-surface-error);
|
|
50
|
+
color: var(--sys-color-on-surface-error);
|
|
51
|
+
}
|
|
39
52
|
}
|
|
40
53
|
}
|
|
41
54
|
}
|
|
42
|
-
|
|
43
|
-
.resource-chunk-view .data-grid .data {
|
|
44
|
-
background-image: none;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.resource-chunk-view devtools-toolbar {
|
|
48
|
-
border-bottom: 1px solid var(--sys-color-divider);
|
|
49
|
-
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// Copyright 2024 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-
|
|
5
|
-
|
|
4
|
+
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
6
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
6
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
7
|
import type * as Protocol from '../../generated/protocol.js';
|
|
9
8
|
import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
|
|
10
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
|
+
import {html, render} from '../../ui/lit/lit.js';
|
|
11
11
|
import * as Elements from '../elements/elements.js';
|
|
12
12
|
|
|
13
|
+
const {widget} = UI.Widget;
|
|
14
|
+
|
|
13
15
|
const UIStrings = {
|
|
14
16
|
/**
|
|
15
17
|
* @description Text in Heap Snapshot View of a profiler tool
|
|
@@ -79,7 +81,7 @@ export class HeapDetachedElementsDataGridNode extends DataGrid.DataGrid.DataGrid
|
|
|
79
81
|
|
|
80
82
|
case 'detached-node-count': {
|
|
81
83
|
const size = this.#getNodeSize(this.detachedElementInfo);
|
|
82
|
-
|
|
84
|
+
render(html`${size}`, cell);
|
|
83
85
|
return cell;
|
|
84
86
|
}
|
|
85
87
|
}
|
|
@@ -111,14 +113,21 @@ export class HeapDetachedElementsDataGridNode extends DataGrid.DataGrid.DataGrid
|
|
|
111
113
|
|
|
112
114
|
// FIXME: is it a partial dupe of front_end/panels/elements/ElementsTreeOutlineRenderer.ts?
|
|
113
115
|
#renderNode(node: SDK.DOMModel.DOMNode, target: HTMLElement): void {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
render(
|
|
117
|
+
html`
|
|
118
|
+
<devtools-widget
|
|
119
|
+
${widget(Elements.ElementsTreeOutline.DOMTreeWidget, {
|
|
120
|
+
omitRootDOMNode: false,
|
|
121
|
+
selectEnabled: true,
|
|
122
|
+
hideGutter: true,
|
|
123
|
+
rootDOMNode: node,
|
|
124
|
+
showSelectionOnKeyboardFocus: true,
|
|
125
|
+
preventTabOrder: true,
|
|
126
|
+
deindentSingleNode: true,
|
|
127
|
+
})}
|
|
128
|
+
></devtools-widget>
|
|
129
|
+
`,
|
|
130
|
+
target,
|
|
131
|
+
);
|
|
123
132
|
}
|
|
124
133
|
}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as BottomUpProfileDataGrid from './BottomUpProfileDataGrid.js';
|
|
6
|
+
import * as HeapDetachedElementsDataGrid from './HeapDetachedElementsDataGrid.js';
|
|
7
|
+
import * as HeapDetachedElementsView from './HeapDetachedElementsView.js';
|
|
6
8
|
import * as HeapProfilerPanel from './HeapProfilerPanel.js';
|
|
7
9
|
import * as HeapProfileView from './HeapProfileView.js';
|
|
8
10
|
import * as HeapSnapshotDataGrids from './HeapSnapshotDataGrids.js';
|
|
@@ -22,6 +24,8 @@ import * as WritableProfileHeader from './WritableProfileHeader.js';
|
|
|
22
24
|
|
|
23
25
|
export {
|
|
24
26
|
BottomUpProfileDataGrid,
|
|
27
|
+
HeapDetachedElementsDataGrid,
|
|
28
|
+
HeapDetachedElementsView,
|
|
25
29
|
HeapProfilerPanel,
|
|
26
30
|
HeapProfileView,
|
|
27
31
|
HeapSnapshotDataGrids,
|
|
@@ -10,10 +10,10 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
10
10
|
import * as Root from '../../core/root/root.js';
|
|
11
11
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
12
12
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
13
|
+
import * as EmulationModel from '../../models/emulation/emulation.js';
|
|
13
14
|
import * as PublicExtensions from '../../models/extensions/extensions.js';
|
|
14
15
|
import type * as Trace from '../../models/trace/trace.js';
|
|
15
16
|
import * as PanelCommon from '../../panels/common/common.js';
|
|
16
|
-
import * as Emulation from '../../panels/emulation/emulation.js';
|
|
17
17
|
import * as Tracing from '../../services/tracing/tracing.js';
|
|
18
18
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
19
19
|
import type * as Dialogs from '../../ui/components/dialogs/dialogs.js';
|
|
@@ -190,14 +190,6 @@ export const enum Pages {
|
|
|
190
190
|
RECORDING_PAGE = 'RecordingPage',
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
const CONVERTER_ID_TO_METRIC: Record<string, Host.UserMetrics.RecordingExported|undefined> = {
|
|
194
|
-
[Models.ConverterIds.ConverterIds.JSON]: Host.UserMetrics.RecordingExported.TO_JSON,
|
|
195
|
-
[Models.ConverterIds.ConverterIds.REPLAY]: Host.UserMetrics.RecordingExported.TO_PUPPETEER_REPLAY,
|
|
196
|
-
[Models.ConverterIds.ConverterIds.PUPPETEER]: Host.UserMetrics.RecordingExported.TO_PUPPETEER,
|
|
197
|
-
[Models.ConverterIds.ConverterIds.PUPPETEER_FIREFOX]: Host.UserMetrics.RecordingExported.TO_PUPPETEER,
|
|
198
|
-
[Models.ConverterIds.ConverterIds.LIGHTHOUSE]: Host.UserMetrics.RecordingExported.TO_LIGHTHOUSE,
|
|
199
|
-
};
|
|
200
|
-
|
|
201
193
|
/** Provide some defaults to prevent OOM issues like crbug.com/491027421 */
|
|
202
194
|
function verifyFlowSize(flow: Models.Schema.UserFlow): void {
|
|
203
195
|
if (flow.steps.length > 4096) {
|
|
@@ -1248,9 +1240,9 @@ export class RecorderPanel extends UI.Widget.VBox<DocumentFragment> {
|
|
|
1248
1240
|
|
|
1249
1241
|
async #disableDeviceModeIfEnabled(): Promise<void> {
|
|
1250
1242
|
try {
|
|
1251
|
-
const
|
|
1252
|
-
if (
|
|
1253
|
-
|
|
1243
|
+
const model = EmulationModel.DeviceModeModel.DeviceModeModel.instance();
|
|
1244
|
+
if (model.isDeviceModeOn()) {
|
|
1245
|
+
model.toggleDeviceMode();
|
|
1254
1246
|
const emulationModel = this.#getMainTarget().model(SDK.EmulationModel.EmulationModel);
|
|
1255
1247
|
await emulationModel?.emulateDevice(null);
|
|
1256
1248
|
}
|
|
@@ -1615,14 +1607,14 @@ export class RecorderPanel extends UI.Widget.VBox<DocumentFragment> {
|
|
|
1615
1607
|
}
|
|
1616
1608
|
const id = event.itemValue;
|
|
1617
1609
|
const byId = (converter: Converters.Converter.Converter): boolean => converter.getId() === id;
|
|
1610
|
+
const isBuiltIn = this.#builtInConverters.some(byId);
|
|
1618
1611
|
const converter = this.#builtInConverters.find(byId) || this.extensionConverters.find(byId);
|
|
1619
1612
|
if (!converter) {
|
|
1620
1613
|
throw new Error('No recording selected');
|
|
1621
1614
|
}
|
|
1622
1615
|
const [content] = await converter.stringify(this.currentRecording.flow);
|
|
1623
1616
|
await this.#exportContent(converter.getFilename(this.currentRecording.flow), content);
|
|
1624
|
-
|
|
1625
|
-
if (builtInMetric) {
|
|
1617
|
+
if (isBuiltIn) {
|
|
1626
1618
|
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.recordingExported));
|
|
1627
1619
|
} else if (converter.getId().startsWith(Converters.ExtensionConverter.EXTENSION_PREFIX)) {
|
|
1628
1620
|
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.recordingExported));
|
|
@@ -137,20 +137,20 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
137
137
|
function renderItemView(location: LocationDescription): LitTemplate {
|
|
138
138
|
// clang-format off
|
|
139
139
|
return html`
|
|
140
|
-
<div class="locations-list-item"
|
|
141
|
-
<div class="locations-list-text locations-list-title"
|
|
140
|
+
<div class="locations-list-item">
|
|
141
|
+
<div class="locations-list-text locations-list-title">
|
|
142
142
|
<div class="locations-list-title-text" title=${location.title}>${location.title}</div>
|
|
143
143
|
</div>
|
|
144
144
|
<div class="locations-list-separator"></div>
|
|
145
|
-
<div class="locations-list-text"
|
|
145
|
+
<div class="locations-list-text">${location.lat}</div>
|
|
146
146
|
<div class="locations-list-separator"></div>
|
|
147
|
-
<div class="locations-list-text"
|
|
147
|
+
<div class="locations-list-text">${location.long}</div>
|
|
148
148
|
<div class="locations-list-separator"></div>
|
|
149
|
-
<div class="locations-list-text"
|
|
149
|
+
<div class="locations-list-text">${location.timezoneId}</div>
|
|
150
150
|
<div class="locations-list-separator"></div>
|
|
151
|
-
<div class="locations-list-text"
|
|
151
|
+
<div class="locations-list-text">${location.locale}</div>
|
|
152
152
|
<div class="locations-list-separator"></div>
|
|
153
|
-
<div class="locations-list-text"
|
|
153
|
+
<div class="locations-list-text">${
|
|
154
154
|
location.accuracy ?? SDK.EmulationModel.Location.DEFAULT_ACCURACY}</div>
|
|
155
155
|
</div>`;
|
|
156
156
|
// clang-format on
|
|
@@ -224,6 +224,21 @@ const UIStrings = {
|
|
|
224
224
|
* @description Text informing the user that AI assistance isn't available in Incognito mode or Guest mode.
|
|
225
225
|
*/
|
|
226
226
|
notAvailableInIncognitoMode: 'AI assistance isn’t available in Incognito mode or Guest mode.',
|
|
227
|
+
/**
|
|
228
|
+
* @description Message shown to the user if the DevTools locale is not
|
|
229
|
+
* supported.
|
|
230
|
+
*/
|
|
231
|
+
wrongLocale: 'To use this feature, set your language preference to English in DevTools settings.',
|
|
232
|
+
/**
|
|
233
|
+
* @description Message shown to the user if the user's region is not
|
|
234
|
+
* supported.
|
|
235
|
+
*/
|
|
236
|
+
geoRestricted: 'This feature is unavailable in your region.',
|
|
237
|
+
/**
|
|
238
|
+
* @description Message shown to the user if the enterprise policy does
|
|
239
|
+
* not allow this feature.
|
|
240
|
+
*/
|
|
241
|
+
policyRestricted: 'This setting is managed by your administrator.',
|
|
227
242
|
} as const;
|
|
228
243
|
const str_ = i18n.i18n.registerUIStrings('panels/settings/AISettingsTab.ts', UIStrings);
|
|
229
244
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -235,6 +250,7 @@ interface SettingItem {
|
|
|
235
250
|
|
|
236
251
|
interface AiSettingParams {
|
|
237
252
|
settingName: Platform.UIString.LocalizedString;
|
|
253
|
+
setting?: Common.Settings.Setting<boolean>;
|
|
238
254
|
iconName: string;
|
|
239
255
|
settingDescription: Platform.UIString.LocalizedString;
|
|
240
256
|
enableSettingText: Common.UIString.LocalizedString;
|
|
@@ -250,9 +266,9 @@ interface AiSettingParams {
|
|
|
250
266
|
interface ViewInput {
|
|
251
267
|
disabledReasons: string[];
|
|
252
268
|
sharedDisclaimerBulletPoints: Array<{icon: string, text: Common.UIString.LocalizedString|Lit.LitTemplate}>;
|
|
253
|
-
settingToParams: Map<
|
|
254
|
-
expandSetting(
|
|
255
|
-
toggleSetting(
|
|
269
|
+
settingToParams: Map<string, AiSettingParams>;
|
|
270
|
+
expandSetting(settingName: string): void;
|
|
271
|
+
toggleSetting(settingName: string, ev: Event): void;
|
|
256
272
|
}
|
|
257
273
|
|
|
258
274
|
type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
@@ -297,18 +313,15 @@ export const AI_SETTINGS_TAB_DEFAULT_VIEW: View = (input, _output, target): void
|
|
|
297
313
|
|
|
298
314
|
const isDisabled = input.disabledReasons.length > 0;
|
|
299
315
|
const disabledReasonsJoined = input.disabledReasons.join('\n') || undefined;
|
|
300
|
-
const settings = Array.from(input.settingToParams.
|
|
301
|
-
const
|
|
302
|
-
if (!settingData) {
|
|
303
|
-
return nothing;
|
|
304
|
-
}
|
|
316
|
+
const settings = Array.from(input.settingToParams.entries()).map(([settingName, settingData]) => {
|
|
317
|
+
const isChecked = settingData.setting ? Boolean(settingData.setting.get()) : false;
|
|
305
318
|
const detailsClasses = {
|
|
306
319
|
'whole-row': true,
|
|
307
320
|
open: settingData.settingExpandState.isSettingExpanded,
|
|
308
321
|
};
|
|
309
322
|
const tabindex = settingData.settingExpandState.isSettingExpanded ? '0' : '-1';
|
|
310
323
|
return html`
|
|
311
|
-
<div class="accordion-header" @click=${input.expandSetting.bind(this,
|
|
324
|
+
<div class="accordion-header" @click=${input.expandSetting.bind(this, settingName)}>
|
|
312
325
|
<div class="icon-container centered">
|
|
313
326
|
<devtools-icon name=${settingData.iconName}></devtools-icon>
|
|
314
327
|
</div>
|
|
@@ -334,15 +347,15 @@ export const AI_SETTINGS_TAB_DEFAULT_VIEW: View = (input, _output, target): void
|
|
|
334
347
|
<div class="divider"></div>
|
|
335
348
|
<div class="toggle-container centered"
|
|
336
349
|
title=${ifDefined(disabledReasonsJoined)}
|
|
337
|
-
@click=${input.toggleSetting.bind(this,
|
|
350
|
+
@click=${settingData.setting ? input.toggleSetting.bind(this, settingName) : nothing}
|
|
338
351
|
>
|
|
339
352
|
<devtools-switch
|
|
340
|
-
.checked=${
|
|
341
|
-
.jslogContext=${
|
|
342
|
-
.disabled=${isDisabled}
|
|
353
|
+
.checked=${isChecked && !isDisabled}
|
|
354
|
+
.jslogContext=${settingName}
|
|
355
|
+
.disabled=${isDisabled || !settingData.setting}
|
|
343
356
|
.label=${disabledReasonsJoined || settingData.enableSettingText}
|
|
344
357
|
data-testid=${settingData.enableSettingText}
|
|
345
|
-
@switchchange=${input.toggleSetting.bind(this,
|
|
358
|
+
@switchchange=${settingData.setting ? input.toggleSetting.bind(this, settingName) : nothing}
|
|
346
359
|
></devtools-switch>
|
|
347
360
|
</div>
|
|
348
361
|
<div class=${classMap(detailsClasses)}>
|
|
@@ -394,17 +407,18 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
394
407
|
(ev: Common.EventTarget.EventTargetEvent<Host.AidaClient.AidaAccessPreconditions>) => void;
|
|
395
408
|
// Setting to parameters needed to display it in the UI.
|
|
396
409
|
// To display a a setting, it needs to be added to this map.
|
|
397
|
-
#settingToParams = new Map<
|
|
410
|
+
#settingToParams = new Map<string, AiSettingParams>();
|
|
398
411
|
|
|
399
412
|
constructor(view?: View) {
|
|
400
413
|
super();
|
|
401
414
|
try {
|
|
402
|
-
this.#consoleInsightsSetting =
|
|
415
|
+
this.#consoleInsightsSetting =
|
|
416
|
+
Common.Settings.Settings.instance().moduleSetting<boolean>('console-insights-enabled');
|
|
403
417
|
} catch {
|
|
404
418
|
this.#consoleInsightsSetting = undefined;
|
|
405
419
|
}
|
|
406
420
|
try {
|
|
407
|
-
this.#aiAssistanceSetting = Common.Settings.Settings.instance().moduleSetting('ai-assistance-enabled');
|
|
421
|
+
this.#aiAssistanceSetting = Common.Settings.Settings.instance().moduleSetting<boolean>('ai-assistance-enabled');
|
|
408
422
|
} catch {
|
|
409
423
|
this.#aiAssistanceSetting = undefined;
|
|
410
424
|
}
|
|
@@ -425,6 +439,26 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
425
439
|
this.#view = view ?? AI_SETTINGS_TAB_DEFAULT_VIEW;
|
|
426
440
|
}
|
|
427
441
|
|
|
442
|
+
#mapSettingDisabledReasons(reasons: AiAssistanceModel.AiUtils.DisabledReason[]): Platform.UIString.LocalizedString[] {
|
|
443
|
+
const mappedReasons: Platform.UIString.LocalizedString[] = [];
|
|
444
|
+
for (const reason of reasons) {
|
|
445
|
+
switch (reason) {
|
|
446
|
+
case AiAssistanceModel.AiUtils.DisabledReason.GEO_RESTRICTED:
|
|
447
|
+
mappedReasons.push(i18nString(UIStrings.geoRestricted));
|
|
448
|
+
break;
|
|
449
|
+
case AiAssistanceModel.AiUtils.DisabledReason.POLICY_RESTRICTED:
|
|
450
|
+
mappedReasons.push(i18nString(UIStrings.policyRestricted));
|
|
451
|
+
break;
|
|
452
|
+
case AiAssistanceModel.AiUtils.DisabledReason.WRONG_LOCALE:
|
|
453
|
+
mappedReasons.push(i18nString(UIStrings.wrongLocale));
|
|
454
|
+
break;
|
|
455
|
+
case AiAssistanceModel.AiUtils.DisabledReason.NOT_SUPPORTED:
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
return mappedReasons;
|
|
460
|
+
}
|
|
461
|
+
|
|
428
462
|
#getDisabledReasons(): Platform.UIString.LocalizedString[] {
|
|
429
463
|
const preconditions = AiAssistanceModel.AiUtils.getDisabledReasons(this.#aidaAvailability);
|
|
430
464
|
const mappedReasons: Platform.UIString.LocalizedString[] = [];
|
|
@@ -447,8 +481,11 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
447
481
|
Platform.assertNever(precondition, `Unknown precondition: ${precondition}`);
|
|
448
482
|
}
|
|
449
483
|
}
|
|
450
|
-
const
|
|
451
|
-
|
|
484
|
+
const availability =
|
|
485
|
+
AiAssistanceModel.AiUtils.aiAssistanceEnabledSettingDescriptor.isAvailable(Root.Runtime.hostConfig);
|
|
486
|
+
const settingDisabledReasons = availability.status === Common.Settings.SettingAvailability.DISABLED ?
|
|
487
|
+
this.#mapSettingDisabledReasons(availability.reason) :
|
|
488
|
+
[];
|
|
452
489
|
return [...mappedReasons, ...settingDisabledReasons];
|
|
453
490
|
}
|
|
454
491
|
|
|
@@ -488,6 +525,7 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
488
525
|
if (this.#consoleInsightsSetting) {
|
|
489
526
|
const consoleInsightsData: AiSettingParams = {
|
|
490
527
|
settingName: i18n.i18n.lockedString('Console Insights'),
|
|
528
|
+
setting: this.#consoleInsightsSetting,
|
|
491
529
|
iconName: 'lightbulb-spark',
|
|
492
530
|
settingDescription: i18nString(UIStrings.helpUnderstandConsole),
|
|
493
531
|
enableSettingText: i18nString(UIStrings.enableConsoleInsights),
|
|
@@ -510,13 +548,14 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
510
548
|
},
|
|
511
549
|
};
|
|
512
550
|
|
|
513
|
-
this.#settingToParams.set(
|
|
551
|
+
this.#settingToParams.set('console-insights-enabled', consoleInsightsData);
|
|
514
552
|
}
|
|
515
553
|
|
|
516
554
|
if (this.#aiAssistanceSetting) {
|
|
517
555
|
const aiAssistanceData: AiSettingParams = {
|
|
518
556
|
settingName: i18n.i18n.lockedString(AiAssistanceModel.AiUtils.isGeminiBranding() ? 'Gemini in Chrome DevTools' :
|
|
519
557
|
'AI assistance'),
|
|
558
|
+
setting: this.#aiAssistanceSetting,
|
|
520
559
|
iconName: AiAssistanceModel.AiUtils.getIconName(),
|
|
521
560
|
settingDescription: this.#getAiAssistanceSettingDescription(),
|
|
522
561
|
enableSettingText: i18nString(UIStrings.enableAiAssistance),
|
|
@@ -542,12 +581,13 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
542
581
|
},
|
|
543
582
|
};
|
|
544
583
|
|
|
545
|
-
this.#settingToParams.set(
|
|
584
|
+
this.#settingToParams.set('ai-assistance-enabled', aiAssistanceData);
|
|
546
585
|
}
|
|
547
586
|
|
|
548
587
|
if (this.#aiAnnotationsSetting) {
|
|
549
588
|
const aiAnnotationsData: AiSettingParams = {
|
|
550
589
|
settingName: i18n.i18n.lockedString('Auto annotations'),
|
|
590
|
+
setting: this.#aiAnnotationsSetting,
|
|
551
591
|
iconName: 'pen-spark',
|
|
552
592
|
settingDescription: i18nString(UIStrings.aIAnnotationsFeatureDescription),
|
|
553
593
|
enableSettingText: i18nString(UIStrings.enableAiSuggestedAnnotations),
|
|
@@ -569,7 +609,7 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
569
609
|
},
|
|
570
610
|
};
|
|
571
611
|
|
|
572
|
-
this.#settingToParams.set(
|
|
612
|
+
this.#settingToParams.set('ai-annotations-enabled', aiAnnotationsData);
|
|
573
613
|
}
|
|
574
614
|
|
|
575
615
|
if (this.#aiCodeCompletionSetting) {
|
|
@@ -586,6 +626,7 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
586
626
|
|
|
587
627
|
const aiCodeCompletionData: AiSettingParams = {
|
|
588
628
|
settingName: i18n.i18n.lockedString('Code suggestions'),
|
|
629
|
+
setting: this.#aiCodeCompletionSetting,
|
|
589
630
|
iconName: 'text-analysis',
|
|
590
631
|
settingDescription: i18nString(UIStrings.helpUnderstandCodeSuggestions),
|
|
591
632
|
enableSettingText: i18nString(UIStrings.enableAiCodeSuggestions),
|
|
@@ -605,7 +646,7 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
605
646
|
},
|
|
606
647
|
};
|
|
607
648
|
|
|
608
|
-
this.#settingToParams.set(
|
|
649
|
+
this.#settingToParams.set('ai-code-completion-enabled', aiCodeCompletionData);
|
|
609
650
|
}
|
|
610
651
|
}
|
|
611
652
|
|
|
@@ -628,8 +669,8 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
628
669
|
return i18nString(UIStrings.aiAssistanceWhenOnItem1);
|
|
629
670
|
}
|
|
630
671
|
|
|
631
|
-
#expandSetting(
|
|
632
|
-
const settingData = this.#settingToParams.get(
|
|
672
|
+
#expandSetting(settingName: string): void {
|
|
673
|
+
const settingData = this.#settingToParams.get(settingName);
|
|
633
674
|
if (!settingData) {
|
|
634
675
|
return;
|
|
635
676
|
}
|
|
@@ -637,18 +678,19 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
637
678
|
this.requestUpdate();
|
|
638
679
|
}
|
|
639
680
|
|
|
640
|
-
#toggleSetting(
|
|
681
|
+
#toggleSetting(settingName: string, ev: Event): void {
|
|
641
682
|
// If the switch is being clicked, there is both a click- and a
|
|
642
683
|
// change-event. Aborting on click avoids running this method twice.
|
|
643
684
|
if (ev.target instanceof Switch.Switch.Switch && ev.type !== Switch.Switch.SwitchChangeEvent.eventName) {
|
|
644
685
|
return;
|
|
645
686
|
}
|
|
646
687
|
|
|
647
|
-
const settingData = this.#settingToParams.get(
|
|
648
|
-
if (!settingData) {
|
|
688
|
+
const settingData = this.#settingToParams.get(settingName);
|
|
689
|
+
if (!settingData || !settingData.setting) {
|
|
649
690
|
return;
|
|
650
691
|
}
|
|
651
692
|
|
|
693
|
+
const setting = settingData.setting;
|
|
652
694
|
const oldSettingValue = setting.get();
|
|
653
695
|
setting.set(!oldSettingValue);
|
|
654
696
|
if (!oldSettingValue && !settingData.settingExpandState.isSettingExpanded) {
|
|
@@ -656,7 +698,7 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
656
698
|
}
|
|
657
699
|
|
|
658
700
|
// Custom settings logic
|
|
659
|
-
if (
|
|
701
|
+
if (settingName === 'console-insights-enabled') {
|
|
660
702
|
if (oldSettingValue) {
|
|
661
703
|
// If the user turns the feature off, we want them to go through the full onboarding flow should they later turn
|
|
662
704
|
// the feature on again. We achieve this by resetting the onboardig setting.
|
|
@@ -669,14 +711,16 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
669
711
|
.createSetting('console-insights-skip-reminder', true, Common.Settings.SettingStorageType.SESSION)
|
|
670
712
|
.set(true);
|
|
671
713
|
}
|
|
672
|
-
} else if (
|
|
714
|
+
} else if (settingName === 'ai-assistance-enabled') {
|
|
673
715
|
if (!setting.get()) {
|
|
674
716
|
// If the "AI Assistance" is toggled off, we remove all the history entries related to the feature.
|
|
675
717
|
void AiAssistanceModel.AiHistoryStorage.AiHistoryStorage.instance().deleteAll();
|
|
676
718
|
}
|
|
677
719
|
|
|
678
720
|
if (setting.get()) {
|
|
679
|
-
Common.Settings.Settings.instance()
|
|
721
|
+
Common.Settings.Settings.instance()
|
|
722
|
+
.resolve(AiAssistanceModel.AiUtils.aiAssistanceV2OptInChangeDialogSeenSettingDescriptor)
|
|
723
|
+
.set(true);
|
|
680
724
|
}
|
|
681
725
|
}
|
|
682
726
|
this.requestUpdate();
|