chrome-devtools-frontend 1.0.1573331 → 1.0.1574367
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/front_end/Images/src/account-tree.svg +10 -1
- package/front_end/Images/src/arrow-right-circle.svg +2 -7
- package/front_end/Images/src/center-focus-weak.svg +3 -1
- package/front_end/Images/src/dog-paw.svg +10 -3
- package/front_end/Images/src/group.svg +3 -1
- package/front_end/Images/src/home.svg +3 -1
- package/front_end/Images/src/spark-info.svg +3 -3
- package/front_end/Images/src/spark.svg +2 -9
- package/front_end/core/sdk/AnimationModel.ts +0 -6
- package/front_end/devtools_compatibility.js +16 -1
- package/front_end/entrypoints/main/GlobalAiButton.ts +18 -3
- package/front_end/generated/InspectorBackendCommands.ts +6 -4
- package/front_end/generated/SupportedCSSProperties.js +17 -4
- package/front_end/generated/protocol-mapping.d.ts +2 -0
- package/front_end/generated/protocol-proxy-api.d.ts +2 -0
- package/front_end/generated/protocol.ts +37 -7
- package/front_end/models/ai_assistance/AiUtils.ts +8 -0
- package/front_end/models/issues_manager/CorsIssue.ts +4 -44
- package/front_end/models/logs/NetworkLog.ts +0 -9
- package/front_end/panels/ai_assistance/PatchWidget.ts +2 -1
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +34 -13
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +3 -1
- package/front_end/panels/ai_assistance/components/ChatView.ts +20 -3
- package/front_end/panels/ai_assistance/components/chatView.css +20 -0
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +3 -1
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +2 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +3 -1
- package/front_end/panels/issues/CorsIssueDetailsView.ts +0 -46
- package/front_end/panels/network/NetworkDataGridNode.ts +3 -1
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +0 -5
- package/front_end/panels/profiler/HeapProfileView.ts +0 -6
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -14
- package/front_end/panels/settings/AISettingsTab.ts +1 -1
- package/front_end/panels/sources/NavigatorView.ts +3 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/README.md +5 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +53 -55
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +25 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +7 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +7 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +21 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +54 -56
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +25 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts +7 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +7 -1
- package/front_end/third_party/puppeteer/package/package.json +5 -5
- package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +7 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +62 -71
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +29 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +12 -1
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/buttons/Button.ts +26 -14
- package/front_end/ui/components/buttons/FloatingButton.ts +7 -3
- package/front_end/ui/components/buttons/floatingButton.css +44 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +3 -2
|
@@ -44,12 +44,6 @@ export const enum IssueCode {
|
|
|
44
44
|
PREFLIGHT_INVALID_ALLOW_EXTERNAL = 'CorsIssue::PreflightInvalidAllowExternal',
|
|
45
45
|
NO_CORS_REDIRECT_MODE_NOT_FOLLOW = 'CorsIssue::NoCorsRedirectModeNotFollow',
|
|
46
46
|
INVALID_PRIVATE_NETWORK_ACCESS = 'CorsIssue::InvalidPrivateNetworkAccess',
|
|
47
|
-
UNEXPECTED_PRIVATE_NETWORK_ACCESS = 'CorsIssue::UnexpectedPrivateNetworkAccess',
|
|
48
|
-
PREFLIGHT_ALLOW_PRIVATE_NETWORK_ERROR = 'CorsIssue::PreflightAllowPrivateNetworkError',
|
|
49
|
-
PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_ID = 'CorsIssue::PreflightMissingPrivateNetworkAccessId',
|
|
50
|
-
PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_NAME = 'CorsIssue::PreflightMissingPrivateNetworkAccessName',
|
|
51
|
-
PRIVATE_NETWORK_ACCESS_PERMISSION_UNAVAILABLE = 'CorsIssue::PrivateNetworkAccessPermissionUnavailable',
|
|
52
|
-
PRIVATE_NETWORK_ACCESS_PERMISSION_DENIED = 'CorsIssue::PrivateNetworkAccessPermissionDenied',
|
|
53
47
|
LOCAL_NETWORK_ACCESS_PERMISSION_DENIED = 'CorsIssue::LocalNetworkAccessPermissionDenied',
|
|
54
48
|
}
|
|
55
49
|
|
|
@@ -97,22 +91,12 @@ function getIssueCode(details: Protocol.Audits.CorsIssueDetails): IssueCode {
|
|
|
97
91
|
return IssueCode.NO_CORS_REDIRECT_MODE_NOT_FOLLOW;
|
|
98
92
|
case Protocol.Network.CorsError.InvalidPrivateNetworkAccess:
|
|
99
93
|
return IssueCode.INVALID_PRIVATE_NETWORK_ACCESS;
|
|
100
|
-
case Protocol.Network.CorsError.UnexpectedPrivateNetworkAccess:
|
|
101
|
-
return IssueCode.UNEXPECTED_PRIVATE_NETWORK_ACCESS;
|
|
102
|
-
case Protocol.Network.CorsError.PreflightMissingAllowPrivateNetwork:
|
|
103
|
-
case Protocol.Network.CorsError.PreflightInvalidAllowPrivateNetwork:
|
|
104
|
-
return IssueCode.PREFLIGHT_ALLOW_PRIVATE_NETWORK_ERROR;
|
|
105
|
-
case Protocol.Network.CorsError.PreflightMissingPrivateNetworkAccessId:
|
|
106
|
-
return IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_ID;
|
|
107
|
-
case Protocol.Network.CorsError.PreflightMissingPrivateNetworkAccessName:
|
|
108
|
-
return IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_NAME;
|
|
109
|
-
case Protocol.Network.CorsError.PrivateNetworkAccessPermissionUnavailable:
|
|
110
|
-
return IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_UNAVAILABLE;
|
|
111
|
-
case Protocol.Network.CorsError.PrivateNetworkAccessPermissionDenied:
|
|
112
|
-
return IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_DENIED;
|
|
113
94
|
case Protocol.Network.CorsError.LocalNetworkAccessPermissionDenied:
|
|
114
95
|
return IssueCode.LOCAL_NETWORK_ACCESS_PERMISSION_DENIED;
|
|
115
96
|
}
|
|
97
|
+
// TODO(b/394636065): Remove this once browser protocol has rolled, as we
|
|
98
|
+
// will never hit this case.
|
|
99
|
+
return null as unknown as IssueCode;
|
|
116
100
|
}
|
|
117
101
|
|
|
118
102
|
export class CorsIssue extends Issue<Protocol.Audits.CorsIssueDetails, IssueCode> {
|
|
@@ -136,14 +120,6 @@ export class CorsIssue extends Issue<Protocol.Audits.CorsIssueDetails, IssueCode
|
|
|
136
120
|
linkTitle: i18nString(UIStrings.corsPrivateNetworkAccess),
|
|
137
121
|
}],
|
|
138
122
|
};
|
|
139
|
-
case IssueCode.PREFLIGHT_ALLOW_PRIVATE_NETWORK_ERROR:
|
|
140
|
-
return {
|
|
141
|
-
file: 'corsPreflightAllowPrivateNetworkError.md',
|
|
142
|
-
links: [{
|
|
143
|
-
link: 'https://developer.chrome.com/blog/private-network-access-update',
|
|
144
|
-
linkTitle: i18nString(UIStrings.corsPrivateNetworkAccess),
|
|
145
|
-
}],
|
|
146
|
-
};
|
|
147
123
|
case IssueCode.INVALID_HEADER_VALUES:
|
|
148
124
|
return {
|
|
149
125
|
file: 'corsInvalidHeaderValues.md',
|
|
@@ -232,17 +208,6 @@ export class CorsIssue extends Issue<Protocol.Audits.CorsIssueDetails, IssueCode
|
|
|
232
208
|
linkTitle: i18nString(UIStrings.CORS),
|
|
233
209
|
}],
|
|
234
210
|
};
|
|
235
|
-
// TODO(1462857): Change the link after we have a blog post for PNA
|
|
236
|
-
// permission prompt.
|
|
237
|
-
case IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_ID:
|
|
238
|
-
case IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_NAME:
|
|
239
|
-
return {
|
|
240
|
-
file: 'corsPrivateNetworkPermissionDenied.md',
|
|
241
|
-
links: [{
|
|
242
|
-
link: 'https://developer.chrome.com/blog/private-network-access-update',
|
|
243
|
-
linkTitle: i18nString(UIStrings.corsPrivateNetworkAccess),
|
|
244
|
-
}],
|
|
245
|
-
};
|
|
246
211
|
case IssueCode.LOCAL_NETWORK_ACCESS_PERMISSION_DENIED:
|
|
247
212
|
return {
|
|
248
213
|
file: 'corsLocalNetworkAccessPermissionDenied.md',
|
|
@@ -254,9 +219,6 @@ export class CorsIssue extends Issue<Protocol.Audits.CorsIssueDetails, IssueCode
|
|
|
254
219
|
case IssueCode.PREFLIGHT_MISSING_ALLOW_EXTERNAL:
|
|
255
220
|
case IssueCode.PREFLIGHT_INVALID_ALLOW_EXTERNAL:
|
|
256
221
|
case IssueCode.INVALID_PRIVATE_NETWORK_ACCESS:
|
|
257
|
-
case IssueCode.UNEXPECTED_PRIVATE_NETWORK_ACCESS:
|
|
258
|
-
case IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_UNAVAILABLE:
|
|
259
|
-
case IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_DENIED:
|
|
260
222
|
return null;
|
|
261
223
|
}
|
|
262
224
|
}
|
|
@@ -267,9 +229,7 @@ export class CorsIssue extends Issue<Protocol.Audits.CorsIssueDetails, IssueCode
|
|
|
267
229
|
|
|
268
230
|
getKind(): IssueKind {
|
|
269
231
|
if (this.details().isWarning &&
|
|
270
|
-
|
|
271
|
-
this.details().corsErrorStatus.corsError === Protocol.Network.CorsError.PreflightMissingAllowPrivateNetwork ||
|
|
272
|
-
this.details().corsErrorStatus.corsError === Protocol.Network.CorsError.PreflightInvalidAllowPrivateNetwork)) {
|
|
232
|
+
this.details().corsErrorStatus.corsError === Protocol.Network.CorsError.InsecurePrivateNetwork) {
|
|
273
233
|
return IssueKind.BREAKING_CHANGE;
|
|
274
234
|
}
|
|
275
235
|
return IssueKind.PAGE_ERROR;
|
|
@@ -469,15 +469,6 @@ export class NetworkLog extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
|
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
471
|
|
|
472
|
-
// This is only triggered in an edge case in which Chrome reports 2 preflight requests. The
|
|
473
|
-
// first preflight gets aborted and should not be shown in DevTools.
|
|
474
|
-
// (see https://crbug.com/1290390 for details)
|
|
475
|
-
if (request.isPreflightRequest() &&
|
|
476
|
-
request.corsErrorStatus()?.corsError === Protocol.Network.CorsError.UnexpectedPrivateNetworkAccess) {
|
|
477
|
-
this.removeRequest(request);
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
472
|
this.dispatchEventToListeners(Events.RequestUpdated, {request});
|
|
482
473
|
}
|
|
483
474
|
|
|
@@ -556,8 +556,9 @@ export class PatchWidget extends UI.Widget.Widget {
|
|
|
556
556
|
return true;
|
|
557
557
|
}
|
|
558
558
|
|
|
559
|
+
const iconName = AiAssistanceModel.AiUtils.getIconName();
|
|
559
560
|
const result = await PanelCommon.FreDialog.show({
|
|
560
|
-
header: {iconName
|
|
561
|
+
header: {iconName, text: lockedString(UIStringsNotTranslate.freDisclaimerHeader)},
|
|
561
562
|
reminderItems: [
|
|
562
563
|
{
|
|
563
564
|
iconName: 'psychiatry',
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
7
|
import type * as Platform from '../../core/platform/platform.js';
|
|
8
|
-
import
|
|
8
|
+
import * as Root from '../../core/root/root.js';
|
|
9
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
10
|
|
|
11
11
|
import type * as AiAssistance from './ai_assistance.js';
|
|
@@ -34,6 +34,22 @@ const UIStrings = {
|
|
|
34
34
|
* the current context
|
|
35
35
|
*/
|
|
36
36
|
debugWithAi: 'Debug with AI',
|
|
37
|
+
/**
|
|
38
|
+
* @description The title of the Gemini panel.
|
|
39
|
+
*/
|
|
40
|
+
gemini: 'Gemini',
|
|
41
|
+
/**
|
|
42
|
+
* @description The title of the command menu action for showing the Gemini panel.
|
|
43
|
+
*/
|
|
44
|
+
showGemini: 'Show Gemini',
|
|
45
|
+
/**
|
|
46
|
+
* @description The setting title to enable the Gemini via the settings tab.
|
|
47
|
+
*/
|
|
48
|
+
enableGemini: 'Enable Gemini',
|
|
49
|
+
/**
|
|
50
|
+
* @description Text of a context menu item to redirect to the Gemini panel with the current context
|
|
51
|
+
*/
|
|
52
|
+
debugWithGemini: 'Debug with Gemini',
|
|
37
53
|
/**
|
|
38
54
|
* @description Message shown to the user if the DevTools locale is not
|
|
39
55
|
* supported.
|
|
@@ -53,7 +69,12 @@ const UIStrings = {
|
|
|
53
69
|
|
|
54
70
|
const str_ = i18n.i18n.registerUIStrings('panels/ai_assistance/ai_assistance-meta.ts', UIStrings);
|
|
55
71
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
56
|
-
|
|
72
|
+
|
|
73
|
+
// Host config is initialized after this module executes, so need to lazily select the string.
|
|
74
|
+
function i18nAiBrandedString(gemini: string, assistance: string) {
|
|
75
|
+
// eslint-disable-next-line @devtools/l10n-i18nString-call-only-with-uistrings
|
|
76
|
+
return () => Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled ? i18nString(gemini) : i18nString(assistance);
|
|
77
|
+
}
|
|
57
78
|
|
|
58
79
|
const setting = 'ai-assistance-enabled';
|
|
59
80
|
|
|
@@ -102,8 +123,8 @@ function isAnyFeatureAvailable(config?: Root.Runtime.HostConfig): boolean {
|
|
|
102
123
|
UI.ViewManager.registerViewExtension({
|
|
103
124
|
location: UI.ViewManager.ViewLocationValues.DRAWER_VIEW,
|
|
104
125
|
id: 'freestyler',
|
|
105
|
-
commandPrompt:
|
|
106
|
-
title:
|
|
126
|
+
commandPrompt: i18nAiBrandedString(UIStrings.showGemini, UIStrings.showAiAssistance),
|
|
127
|
+
title: i18nAiBrandedString(UIStrings.gemini, UIStrings.aiAssistance),
|
|
107
128
|
order: 10,
|
|
108
129
|
persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
|
|
109
130
|
hasToolbar: false,
|
|
@@ -118,7 +139,7 @@ Common.Settings.registerSettingExtension({
|
|
|
118
139
|
category: Common.Settings.SettingCategory.AI,
|
|
119
140
|
settingName: setting,
|
|
120
141
|
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
121
|
-
title:
|
|
142
|
+
title: i18nAiBrandedString(UIStrings.enableGemini, UIStrings.enableAiAssistance),
|
|
122
143
|
defaultValue: false,
|
|
123
144
|
reloadRequired: false,
|
|
124
145
|
condition: isAnyFeatureAvailable,
|
|
@@ -146,7 +167,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
146
167
|
return [];
|
|
147
168
|
},
|
|
148
169
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
149
|
-
title:
|
|
170
|
+
title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
|
|
150
171
|
configurableBindings: false,
|
|
151
172
|
async loadActionDelegate() {
|
|
152
173
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -161,7 +182,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
161
182
|
return [];
|
|
162
183
|
},
|
|
163
184
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
164
|
-
title:
|
|
185
|
+
title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
|
|
165
186
|
configurableBindings: false,
|
|
166
187
|
async loadActionDelegate() {
|
|
167
188
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -177,7 +198,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
177
198
|
return [];
|
|
178
199
|
},
|
|
179
200
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
180
|
-
title:
|
|
201
|
+
title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
|
|
181
202
|
configurableBindings: false,
|
|
182
203
|
async loadActionDelegate() {
|
|
183
204
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -193,7 +214,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
193
214
|
return [];
|
|
194
215
|
},
|
|
195
216
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
196
|
-
title:
|
|
217
|
+
title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
|
|
197
218
|
configurableBindings: false,
|
|
198
219
|
async loadActionDelegate() {
|
|
199
220
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -209,7 +230,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
209
230
|
return [];
|
|
210
231
|
},
|
|
211
232
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
212
|
-
title:
|
|
233
|
+
title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
|
|
213
234
|
configurableBindings: false,
|
|
214
235
|
async loadActionDelegate() {
|
|
215
236
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -225,7 +246,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
225
246
|
return [];
|
|
226
247
|
},
|
|
227
248
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
228
|
-
title:
|
|
249
|
+
title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
|
|
229
250
|
configurableBindings: false,
|
|
230
251
|
async loadActionDelegate() {
|
|
231
252
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -241,7 +262,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
241
262
|
return [];
|
|
242
263
|
},
|
|
243
264
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
244
|
-
title:
|
|
265
|
+
title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
|
|
245
266
|
configurableBindings: false,
|
|
246
267
|
async loadActionDelegate() {
|
|
247
268
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -256,7 +277,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
256
277
|
return [];
|
|
257
278
|
},
|
|
258
279
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
259
|
-
title:
|
|
280
|
+
title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
|
|
260
281
|
configurableBindings: false,
|
|
261
282
|
async loadActionDelegate() {
|
|
262
283
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -292,6 +292,8 @@ export const DEFAULT_VIEW = (input: ChatMessageViewInput, output: ViewOutput, ta
|
|
|
292
292
|
return;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
+
const icon = AiAssistanceModel.AiUtils.getIconName();
|
|
296
|
+
|
|
295
297
|
// clang-format off
|
|
296
298
|
Lit.render(html`
|
|
297
299
|
<style>${Input.textInputStyles}</style>
|
|
@@ -301,7 +303,7 @@ export const DEFAULT_VIEW = (input: ChatMessageViewInput, output: ViewOutput, ta
|
|
|
301
303
|
jslog=${VisualLogging.section('answer')}
|
|
302
304
|
>
|
|
303
305
|
<div class="message-info">
|
|
304
|
-
<devtools-icon name
|
|
306
|
+
<devtools-icon name=${icon}></devtools-icon>
|
|
305
307
|
<div class="message-name">
|
|
306
308
|
<h2>${lockedString(UIStringsNotTranslate.ai)}</h2>
|
|
307
309
|
</div>
|
|
@@ -7,7 +7,7 @@ import '../../../ui/components/spinners/spinners.js';
|
|
|
7
7
|
import * as Host from '../../../core/host/host.js';
|
|
8
8
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
9
|
import type * as Platform from '../../../core/platform/platform.js';
|
|
10
|
-
import
|
|
10
|
+
import * as AiAssistanceModel from '../../../models/ai_assistance/ai_assistance.js';
|
|
11
11
|
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
12
12
|
import type {MarkdownLitRenderer} from '../../../ui/components/markdown_view/MarkdownView.js';
|
|
13
13
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
@@ -30,6 +30,10 @@ const UIStringsNotTranslate = {
|
|
|
30
30
|
* @description Text for the empty state of the AI assistance panel.
|
|
31
31
|
*/
|
|
32
32
|
emptyStateText: 'How can I help you?',
|
|
33
|
+
/**
|
|
34
|
+
* @description Text for the empty state of the Gemini panel.
|
|
35
|
+
*/
|
|
36
|
+
emptyStateTextGemini: 'Where should we start?',
|
|
33
37
|
} as const;
|
|
34
38
|
|
|
35
39
|
const lockedString = i18n.i18n.lockedString;
|
|
@@ -74,12 +78,18 @@ export interface Props {
|
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
interface ChatWidgetInput extends Props {
|
|
81
|
+
accountName: string;
|
|
77
82
|
handleScroll: (ev: Event) => void;
|
|
78
83
|
handleSuggestionClick: (title: string) => void;
|
|
79
84
|
handleMessageContainerRef: (el: Element|undefined) => void;
|
|
80
85
|
}
|
|
81
86
|
|
|
82
87
|
const DEFAULT_VIEW: View = (input, output, target) => {
|
|
88
|
+
const chatUiClasses = classMap({
|
|
89
|
+
'chat-ui': true,
|
|
90
|
+
gemini: AiAssistanceModel.AiUtils.isGeminiBranding(),
|
|
91
|
+
});
|
|
92
|
+
|
|
83
93
|
const inputWidgetClasses = classMap({
|
|
84
94
|
'chat-input-widget': true,
|
|
85
95
|
sticky: !input.isReadOnly,
|
|
@@ -88,7 +98,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
88
98
|
// clang-format off
|
|
89
99
|
render(html`
|
|
90
100
|
<style>${chatViewStyles}</style>
|
|
91
|
-
<div class
|
|
101
|
+
<div class=${chatUiClasses}>
|
|
92
102
|
<main @scroll=${input.handleScroll} ${ref(element => { output.mainElement = element as HTMLElement; } )}>
|
|
93
103
|
${input.messages.length > 0 ? html`
|
|
94
104
|
<div class="messages-container" ${ref(input.handleMessageContainerRef)}>
|
|
@@ -121,7 +131,12 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
121
131
|
name="smart-assistant"
|
|
122
132
|
></devtools-icon>
|
|
123
133
|
</div>
|
|
124
|
-
|
|
134
|
+
${AiAssistanceModel.AiUtils.isGeminiBranding() ?
|
|
135
|
+
html`
|
|
136
|
+
<h1 class='greeting'>Hello, ${input.accountName}</h1>
|
|
137
|
+
<h1>${lockedString(UIStringsNotTranslate.emptyStateTextGemini)}</h1>
|
|
138
|
+
` : html`<h1>${lockedString(UIStringsNotTranslate.emptyStateText)}</h1>`
|
|
139
|
+
}
|
|
125
140
|
</div>
|
|
126
141
|
<div class="empty-state-content">
|
|
127
142
|
${input.emptyStateSuggestions.map(({title, jslogContext}) => {
|
|
@@ -308,6 +323,8 @@ export class ChatView extends HTMLElement {
|
|
|
308
323
|
this.#view(
|
|
309
324
|
{
|
|
310
325
|
...this.#props,
|
|
326
|
+
// TODO(b/468206227): This needs to be a first name.
|
|
327
|
+
accountName: this.#props.userInfo.accountFullName ?? '',
|
|
311
328
|
handleScroll: this.#handleScroll,
|
|
312
329
|
handleSuggestionClick: this.#handleSuggestionClick,
|
|
313
330
|
handleMessageContainerRef: this.#handleMessageContainerRef,
|
|
@@ -165,7 +165,27 @@ main {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
.gemini {
|
|
169
|
+
.empty-state-container .icon {
|
|
170
|
+
display: none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.empty-state-container .header {
|
|
174
|
+
align-items: flex-start;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.empty-state-content {
|
|
178
|
+
align-items: flex-start
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.empty-state-container .greeting {
|
|
182
|
+
color: var(--sys-color-primary);
|
|
183
|
+
}
|
|
168
184
|
|
|
185
|
+
main {
|
|
186
|
+
align-items: flex-start;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
169
189
|
|
|
170
190
|
.change-summary {
|
|
171
191
|
background-color: var(--sys-color-surface3);
|
|
@@ -8,6 +8,7 @@ import * as Common from '../../core/common/common.js';
|
|
|
8
8
|
import * as Host from '../../core/host/host.js';
|
|
9
9
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
10
10
|
import * as Root from '../../core/root/root.js';
|
|
11
|
+
import * as AIAssistance from '../../models/ai_assistance/ai_assistance.js';
|
|
11
12
|
import * as AiCodeGeneration from '../../models/ai_code_generation/ai_code_generation.js';
|
|
12
13
|
import * as Snackbars from '../../ui/components/snackbars/snackbars.js';
|
|
13
14
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
@@ -259,8 +260,9 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
259
260
|
onAction = async(event: Event): Promise<void> => {
|
|
260
261
|
event.preventDefault();
|
|
261
262
|
|
|
263
|
+
const iconName = AIAssistance.AiUtils.getIconName();
|
|
262
264
|
const result = await FreDialog.show({
|
|
263
|
-
header: {iconName
|
|
265
|
+
header: {iconName, text: lockedString(UIStringsNotTranslate.freDisclaimerHeader)},
|
|
264
266
|
reminderItems: this.#createReminderItems(),
|
|
265
267
|
onLearnMoreClick: () => {
|
|
266
268
|
void UI.ViewManager.ViewManager.instance().showView('chrome-ai');
|
|
@@ -82,7 +82,7 @@ export const DEFAULT_VIEW: View = (input, _output, target): void => {
|
|
|
82
82
|
.size=${Buttons.Button.Size.REGULAR}
|
|
83
83
|
.title=${i18nString(UIStrings.dismiss)}
|
|
84
84
|
jslog=${VisualLogging.close().track({click: true})}
|
|
85
|
-
@click=${() =>
|
|
85
|
+
@click=${() => input.onCancelClick()}
|
|
86
86
|
></devtools-button>
|
|
87
87
|
</div>
|
|
88
88
|
</div>
|
|
@@ -495,8 +495,9 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
|
|
|
495
495
|
async #showFreDialog(): Promise<void> {
|
|
496
496
|
const noLogging = Root.Runtime.hostConfig.aidaAvailability?.enterprisePolicyValue ===
|
|
497
497
|
Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING;
|
|
498
|
+
const iconName = AiAssistanceModel.AiUtils.getIconName();
|
|
498
499
|
const result = await PanelCommon.FreDialog.show({
|
|
499
|
-
header: {iconName
|
|
500
|
+
header: {iconName, text: lockedString(UIStringsNotTranslate.freDisclaimerHeader)},
|
|
500
501
|
reminderItems: [
|
|
501
502
|
{
|
|
502
503
|
iconName: 'psychiatry',
|
|
@@ -42,6 +42,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
42
42
|
import * as Root from '../../core/root/root.js';
|
|
43
43
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
44
44
|
import * as Protocol from '../../generated/protocol.js';
|
|
45
|
+
import * as AIAssistance from '../../models/ai_assistance/ai_assistance.js';
|
|
45
46
|
import * as Badges from '../../models/badges/badges.js';
|
|
46
47
|
import type * as Elements from '../../models/elements/elements.js';
|
|
47
48
|
import type * as IssuesManager from '../../models/issues_manager/issues_manager.js';
|
|
@@ -1076,7 +1077,8 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1076
1077
|
const action = UI.ActionRegistry.ActionRegistry.instance().getAction('freestyler.elements-floating-button');
|
|
1077
1078
|
if (this.contentElement && !this.aiButtonContainer) {
|
|
1078
1079
|
this.aiButtonContainer = this.contentElement.createChild('span', 'ai-button-container');
|
|
1079
|
-
const floatingButton =
|
|
1080
|
+
const floatingButton =
|
|
1081
|
+
Buttons.FloatingButton.create(AIAssistance.AiUtils.getIconName(), action.title(), 'ask-ai');
|
|
1080
1082
|
floatingButton.addEventListener('click', ev => {
|
|
1081
1083
|
ev.stopPropagation();
|
|
1082
1084
|
this.select(true, false);
|
|
@@ -181,20 +181,6 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
181
181
|
this.appendColumnTitle(header, i18nString(UIStrings.initiatorAddressSpace));
|
|
182
182
|
this.appendColumnTitle(header, i18nString(UIStrings.initiatorContext));
|
|
183
183
|
break;
|
|
184
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_ALLOW_PRIVATE_NETWORK_ERROR:
|
|
185
|
-
this.appendColumnTitle(header, i18nString(UIStrings.preflightRequest));
|
|
186
|
-
this.appendColumnTitle(header, i18nString(UIStrings.invalidValue));
|
|
187
|
-
this.appendColumnTitle(header, i18nString(UIStrings.initiatorAddressSpace));
|
|
188
|
-
this.appendColumnTitle(header, i18nString(UIStrings.initiatorContext));
|
|
189
|
-
break;
|
|
190
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_ID:
|
|
191
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_NAME:
|
|
192
|
-
this.appendColumnTitle(header, i18nString(UIStrings.preflightRequest));
|
|
193
|
-
this.appendColumnTitle(header, i18nString(UIStrings.invalidValue));
|
|
194
|
-
this.appendColumnTitle(header, i18nString(UIStrings.resourceAddressSpace));
|
|
195
|
-
this.appendColumnTitle(header, i18nString(UIStrings.initiatorAddressSpace));
|
|
196
|
-
this.appendColumnTitle(header, i18nString(UIStrings.initiatorContext));
|
|
197
|
-
break;
|
|
198
184
|
case IssuesManager.CorsIssue.IssueCode.METHOD_DISALLOWED_BY_PREFLIGHT_RESPONSE:
|
|
199
185
|
this.appendColumnTitle(header, i18nString(UIStrings.preflightRequest));
|
|
200
186
|
this.appendColumnTitle(header, i18nString(UIStrings.disallowedRequestMethod));
|
|
@@ -222,9 +208,6 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
222
208
|
Platform.assertUnhandled<IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_ALLOW_EXTERNAL|
|
|
223
209
|
IssuesManager.CorsIssue.IssueCode.PREFLIGHT_INVALID_ALLOW_EXTERNAL|
|
|
224
210
|
IssuesManager.CorsIssue.IssueCode.INVALID_PRIVATE_NETWORK_ACCESS|
|
|
225
|
-
IssuesManager.CorsIssue.IssueCode.UNEXPECTED_PRIVATE_NETWORK_ACCESS|IssuesManager
|
|
226
|
-
.CorsIssue.IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_UNAVAILABLE|IssuesManager
|
|
227
|
-
.CorsIssue.IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_DENIED|
|
|
228
211
|
IssuesManager.CorsIssue.IssueCode.LOCAL_NETWORK_ACCESS_PERMISSION_DENIED>(issueCode);
|
|
229
212
|
}
|
|
230
213
|
|
|
@@ -267,18 +250,11 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
267
250
|
case Protocol.Network.CorsError.InvalidAllowCredentials:
|
|
268
251
|
case Protocol.Network.CorsError.PreflightInvalidAllowCredentials:
|
|
269
252
|
return 'Access-Control-Allow-Credentials';
|
|
270
|
-
case Protocol.Network.CorsError.PreflightMissingAllowPrivateNetwork:
|
|
271
|
-
case Protocol.Network.CorsError.PreflightInvalidAllowPrivateNetwork:
|
|
272
|
-
return 'Access-Control-Allow-Private-Network';
|
|
273
253
|
case Protocol.Network.CorsError.RedirectContainsCredentials:
|
|
274
254
|
case Protocol.Network.CorsError.PreflightDisallowedRedirect:
|
|
275
255
|
return 'Location';
|
|
276
256
|
case Protocol.Network.CorsError.PreflightInvalidStatus:
|
|
277
257
|
return 'Status-Code';
|
|
278
|
-
case Protocol.Network.CorsError.PreflightMissingPrivateNetworkAccessId:
|
|
279
|
-
return 'Private-Network-Access-Id';
|
|
280
|
-
case Protocol.Network.CorsError.PreflightMissingPrivateNetworkAccessName:
|
|
281
|
-
return 'Private-Network-Access-Name';
|
|
282
258
|
}
|
|
283
259
|
return '';
|
|
284
260
|
}
|
|
@@ -393,15 +369,6 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
393
369
|
this.appendIssueDetailCell(element, details.clientSecurityState?.initiatorIPAddressSpace ?? '');
|
|
394
370
|
this.#appendSecureContextCell(element, details.clientSecurityState?.initiatorIsSecureContext);
|
|
395
371
|
break;
|
|
396
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_ALLOW_PRIVATE_NETWORK_ERROR: {
|
|
397
|
-
element.appendChild(this.createRequestCell(details.request, opts));
|
|
398
|
-
this.#appendStatus(element, details.isWarning);
|
|
399
|
-
element.appendChild(this.createRequestCell(details.request, {...opts, linkToPreflight: true, highlightHeader}));
|
|
400
|
-
this.appendIssueDetailCell(element, details.corsErrorStatus.failedParameter, 'code-example');
|
|
401
|
-
this.appendIssueDetailCell(element, details.clientSecurityState?.initiatorIPAddressSpace ?? '');
|
|
402
|
-
this.#appendSecureContextCell(element, details.clientSecurityState?.initiatorIsSecureContext);
|
|
403
|
-
break;
|
|
404
|
-
}
|
|
405
372
|
case IssuesManager.CorsIssue.IssueCode.METHOD_DISALLOWED_BY_PREFLIGHT_RESPONSE:
|
|
406
373
|
element.appendChild(this.createRequestCell(details.request, opts));
|
|
407
374
|
this.#appendStatus(element, details.isWarning);
|
|
@@ -461,25 +428,12 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
461
428
|
this.#appendStatus(element, details.isWarning);
|
|
462
429
|
this.appendSourceLocation(element, details.location, issue.model()?.getTargetIfNotDisposed());
|
|
463
430
|
break;
|
|
464
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_ID:
|
|
465
|
-
case IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_NAME:
|
|
466
|
-
element.appendChild(this.createRequestCell(details.request, opts));
|
|
467
|
-
this.#appendStatus(element, details.isWarning);
|
|
468
|
-
element.appendChild(this.createRequestCell(details.request, {...opts, linkToPreflight: true, highlightHeader}));
|
|
469
|
-
this.appendIssueDetailCell(element, CorsIssueDetailsView.getHeaderFromError(corsError));
|
|
470
|
-
this.appendIssueDetailCell(element, details.resourceIPAddressSpace ?? '');
|
|
471
|
-
this.appendIssueDetailCell(element, details.clientSecurityState?.initiatorIPAddressSpace ?? '');
|
|
472
|
-
this.#appendSecureContextCell(element, details.clientSecurityState?.initiatorIsSecureContext);
|
|
473
|
-
break;
|
|
474
431
|
default:
|
|
475
432
|
element.appendChild(this.createRequestCell(details.request, opts));
|
|
476
433
|
this.#appendStatus(element, details.isWarning);
|
|
477
434
|
Platform.assertUnhandled<IssuesManager.CorsIssue.IssueCode.PREFLIGHT_MISSING_ALLOW_EXTERNAL|
|
|
478
435
|
IssuesManager.CorsIssue.IssueCode.PREFLIGHT_INVALID_ALLOW_EXTERNAL|
|
|
479
436
|
IssuesManager.CorsIssue.IssueCode.INVALID_PRIVATE_NETWORK_ACCESS|
|
|
480
|
-
IssuesManager.CorsIssue.IssueCode.UNEXPECTED_PRIVATE_NETWORK_ACCESS|IssuesManager
|
|
481
|
-
.CorsIssue.IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_UNAVAILABLE|IssuesManager
|
|
482
|
-
.CorsIssue.IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_DENIED|
|
|
483
437
|
IssuesManager.CorsIssue.IssueCode.LOCAL_NETWORK_ACCESS_PERMISSION_DENIED>(issueCode);
|
|
484
438
|
break;
|
|
485
439
|
}
|
|
@@ -42,6 +42,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
42
42
|
import * as Platform from '../../core/platform/platform.js';
|
|
43
43
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
44
44
|
import * as Protocol from '../../generated/protocol.js';
|
|
45
|
+
import * as AiAssistance from '../../models/ai_assistance/ai_assistance.js';
|
|
45
46
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
46
47
|
import type * as HAR from '../../models/har/har.js';
|
|
47
48
|
import * as Logs from '../../models/logs/logs.js';
|
|
@@ -1621,7 +1622,8 @@ export class NetworkRequestNode extends NetworkNode {
|
|
|
1621
1622
|
const action = UI.ActionRegistry.ActionRegistry.instance().getAction('drjones.network-floating-button');
|
|
1622
1623
|
const aiButtonContainer = document.createElement('span');
|
|
1623
1624
|
aiButtonContainer.classList.add('ai-button-container');
|
|
1624
|
-
const
|
|
1625
|
+
const icon = AiAssistance.AiUtils.getIconName();
|
|
1626
|
+
const floatingButton = Buttons.FloatingButton.create(icon, action.title(), 'ask-ai');
|
|
1625
1627
|
floatingButton.addEventListener('click', ev => {
|
|
1626
1628
|
ev.stopPropagation();
|
|
1627
1629
|
this.select();
|
|
@@ -126,11 +126,6 @@ export class DetachedElementsProfileType extends
|
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
const animationModel = target?.model(SDK.AnimationModel.AnimationModel);
|
|
130
|
-
if (animationModel) {
|
|
131
|
-
// TODO(b/406904348): Remove this once we correctly release animations on the backend.
|
|
132
|
-
await animationModel.releaseAllAnimations();
|
|
133
|
-
}
|
|
134
129
|
const data = await domModel.getDetachedDOMNodes();
|
|
135
130
|
|
|
136
131
|
const profile: DetachedElementsProfileHeader = new DetachedElementsProfileHeader(heapProfilerModel, this, data);
|
|
@@ -283,12 +283,6 @@ export class SamplingHeapProfileTypeBase extends
|
|
|
283
283
|
UI.InspectorView.InspectorView.instance().setPanelWarnings('heap-profiler', warnings);
|
|
284
284
|
|
|
285
285
|
this.recording = true;
|
|
286
|
-
const target = heapProfilerModel.target();
|
|
287
|
-
const animationModel = target.model(SDK.AnimationModel.AnimationModel);
|
|
288
|
-
if (animationModel) {
|
|
289
|
-
// TODO(b/406904348): Remove this once we correctly release animations on the backend.
|
|
290
|
-
await animationModel.releaseAllAnimations();
|
|
291
|
-
}
|
|
292
286
|
this.startSampling();
|
|
293
287
|
}
|
|
294
288
|
|
|
@@ -1369,15 +1369,6 @@ export class HeapSnapshotProfileType extends
|
|
|
1369
1369
|
this.addProfile(profile);
|
|
1370
1370
|
profile.updateStatus(i18nString(UIStrings.snapshotting));
|
|
1371
1371
|
|
|
1372
|
-
// Release all the animations before taking a heap snapshot.
|
|
1373
|
-
// The animations are stored for replay in the animations panel and they might cause
|
|
1374
|
-
// detached nodes to appear in snapshots. Because of this, we release
|
|
1375
|
-
// all the animations first before taking a heap snapshot.
|
|
1376
|
-
const animationModel = heapProfilerModel.target().model(SDK.AnimationModel.AnimationModel);
|
|
1377
|
-
if (animationModel) {
|
|
1378
|
-
await animationModel.releaseAllAnimations();
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
1372
|
await heapProfilerModel.takeHeapSnapshot({
|
|
1382
1373
|
reportProgress: true,
|
|
1383
1374
|
captureNumericValue: true,
|
|
@@ -1541,11 +1532,6 @@ export class TrackingHeapSnapshotProfileType extends
|
|
|
1541
1532
|
return;
|
|
1542
1533
|
}
|
|
1543
1534
|
|
|
1544
|
-
const animationModel = heapProfilerModel.target().model(SDK.AnimationModel.AnimationModel);
|
|
1545
|
-
if (animationModel) {
|
|
1546
|
-
// TODO(b/406904348): Remove this once we correctly release animations on the backend.
|
|
1547
|
-
await animationModel.releaseAllAnimations();
|
|
1548
|
-
}
|
|
1549
1535
|
void heapProfilerModel.startTrackingHeapObjects(this.recordAllocationStacksSettingInternal.get());
|
|
1550
1536
|
}
|
|
1551
1537
|
|
|
@@ -483,7 +483,7 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
483
483
|
if (this.#aiAssistanceSetting) {
|
|
484
484
|
const aiAssistanceData: AiSettingParams = {
|
|
485
485
|
settingName: i18n.i18n.lockedString('AI assistance'),
|
|
486
|
-
iconName:
|
|
486
|
+
iconName: AiAssistanceModel.AiUtils.getIconName(),
|
|
487
487
|
settingDescription: this.#getAiAssistanceSettingDescription(),
|
|
488
488
|
enableSettingText: i18nString(UIStrings.enableAiAssistance),
|
|
489
489
|
settingItems: [
|
|
@@ -10,6 +10,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
10
10
|
import * as Platform from '../../core/platform/platform.js';
|
|
11
11
|
import * as Root from '../../core/root/root.js';
|
|
12
12
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
13
|
+
import * as AiAssistance from '../../models/ai_assistance/ai_assistance.js';
|
|
13
14
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
14
15
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
15
16
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
@@ -1426,7 +1427,8 @@ export class NavigatorSourceTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1426
1427
|
const action = UI.ActionRegistry.ActionRegistry.instance().getAction('drjones.sources-floating-button');
|
|
1427
1428
|
if (!this.aiButtonContainer) {
|
|
1428
1429
|
this.aiButtonContainer = this.listItemElement.createChild('span', 'ai-button-container');
|
|
1429
|
-
const
|
|
1430
|
+
const icon = AiAssistance.AiUtils.getIconName();
|
|
1431
|
+
const floatingButton = Buttons.FloatingButton.create(icon, action.title(), 'ask-ai');
|
|
1430
1432
|
floatingButton.addEventListener('click', ev => {
|
|
1431
1433
|
ev.stopPropagation();
|
|
1432
1434
|
this.navigatorView.sourceSelected(this.uiSourceCode, false);
|
|
@@ -113,6 +113,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
113
113
|
const aiLabel = 'Debug with AI';
|
|
114
114
|
const ariaLabel = `Ask AI about ${model.title} insight`;
|
|
115
115
|
const content = renderContent();
|
|
116
|
+
const iconName = AIAssistance.AiUtils.getIconName();
|
|
116
117
|
|
|
117
118
|
// clang-format off
|
|
118
119
|
return html`
|
|
@@ -123,7 +124,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
123
124
|
<div class="ask-ai-btn-wrap">
|
|
124
125
|
<devtools-button class="ask-ai"
|
|
125
126
|
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
126
|
-
.iconName=${
|
|
127
|
+
.iconName=${iconName}
|
|
127
128
|
data-insights-ask-ai
|
|
128
129
|
jslog=${VisualLogging.action(`timeline.insight-ask-ai.${internalName}`).track({click: true})}
|
|
129
130
|
@click=${onAskAIButtonClick}
|