chrome-devtools-frontend 1.0.1566234 → 1.0.1567721
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/docs/contributing/performance.md +24 -0
- package/front_end/core/common/Base64.ts +21 -2
- package/front_end/core/common/ResourceType.ts +7 -0
- package/front_end/core/host/InspectorFrontendHostStub.ts +3 -0
- package/front_end/core/host/UserMetrics.ts +20 -0
- package/front_end/core/sdk/NetworkManager.ts +3 -3
- package/front_end/entrypoints/main/MainImpl.ts +1 -7
- package/front_end/generated/Deprecation.ts +0 -8
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.js +39 -49
- package/front_end/generated/protocol.ts +4 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +98 -105
- package/front_end/models/emulation/DeviceModeModel.ts +1 -1
- package/front_end/models/formatter/FormatterWorkerPool.ts +8 -6
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -9
- package/front_end/models/persistence/PersistenceImpl.ts +8 -0
- package/front_end/models/text_utils/TextUtils.snapshot.txt +83 -0
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -1
- package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +28 -4
- package/front_end/panels/ai_assistance/components/ChatView.ts +52 -169
- package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +27 -8
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +19 -4
- package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -0
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +42 -0
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +60 -11
- package/front_end/panels/application/DeviceBoundSessionsView.ts +947 -103
- package/front_end/panels/application/ResourcesPanel.ts +7 -0
- package/front_end/panels/application/deviceBoundSessionsView.css +10 -1
- package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +115 -0
- package/front_end/panels/common/aiCodeGenerationUpgradeDialog.css +79 -0
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsoleInsightTeaser.ts +17 -3
- package/front_end/panels/issues/AffectedSourcesView.ts +0 -1
- package/front_end/panels/issues/IssuesPane.ts +0 -4
- package/front_end/panels/network/RequestTimingView.ts +5 -20
- package/front_end/panels/network/networkTimingTable.css +5 -5
- package/front_end/panels/recorder/components/StepEditor.ts +15 -8
- package/front_end/panels/settings/AISettingsTab.ts +31 -2
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +8 -6
- package/front_end/panels/sources/UISourceCodeFrame.ts +9 -3
- package/front_end/panels/timeline/TimelinePanel.ts +12 -4
- package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +1 -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/lib/cjs/puppeteer/api/Browser.d.ts +9 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +8 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- 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 +3 -3
- 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/bidi/core/UserContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.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 +33 -31
- 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/cdp/WebWorker.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js +1 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +7 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Cookie.d.ts +2 -2
- 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 +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
- 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 +13 -4
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +62 -42
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +9 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +8 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- 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 +3 -3
- 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/bidi/core/UserContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.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 +33 -31
- 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/cdp/WebWorker.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js +1 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +7 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Cookie.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
- 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 +13 -4
- package/front_end/third_party/puppeteer/package/package.json +3 -3
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +11 -3
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +9 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +3 -5
- package/front_end/third_party/puppeteer/package/src/bidi/core/UserContext.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +43 -45
- package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +3 -11
- package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +12 -0
- package/front_end/third_party/puppeteer/package/src/common/Cookie.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/source-map-scopes-codec/README.chromium +2 -5
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts +130 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts.map +1 -0
- package/front_end/third_party/source-map-scopes-codec/package/deno.json +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/package.json +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/codec.js +4 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +4 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +30 -13
- package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +35 -17
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +2 -2
- package/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js +7 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js.map +1 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/util.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +4 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +11 -0
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -2
- package/front_end/third_party/source-map-scopes-codec/package/src/scopes-tsconfig.json +0 -8
- /package/front_end/third_party/source-map-scopes-codec/package/src/{scopes.d.ts → scopes.ts} +0 -0
|
@@ -13,15 +13,18 @@ let formatterWorkerPoolInstance: FormatterWorkerPool|undefined;
|
|
|
13
13
|
export class FormatterWorkerPool {
|
|
14
14
|
private taskQueue: Task[];
|
|
15
15
|
private workerTasks: Map<PlatformApi.HostRuntime.Worker, Task|null>;
|
|
16
|
+
private entrypointURL: string;
|
|
16
17
|
|
|
17
|
-
constructor() {
|
|
18
|
+
constructor(entrypointURL?: string) {
|
|
18
19
|
this.taskQueue = [];
|
|
19
20
|
this.workerTasks = new Map();
|
|
21
|
+
this.entrypointURL =
|
|
22
|
+
entrypointURL ?? import.meta.resolve('../../entrypoints/formatter_worker/formatter_worker-entrypoint.js');
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
static instance(): FormatterWorkerPool {
|
|
23
|
-
if (!formatterWorkerPoolInstance) {
|
|
24
|
-
formatterWorkerPoolInstance = new FormatterWorkerPool();
|
|
25
|
+
static instance(opts?: {forceNew: true, entrypointURL: string}): FormatterWorkerPool {
|
|
26
|
+
if (!formatterWorkerPoolInstance || opts?.forceNew) {
|
|
27
|
+
formatterWorkerPoolInstance = new FormatterWorkerPool(opts?.entrypointURL);
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
return formatterWorkerPoolInstance;
|
|
@@ -44,8 +47,7 @@ export class FormatterWorkerPool {
|
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
private createWorker(): PlatformApi.HostRuntime.Worker {
|
|
47
|
-
const worker = Platform.HostRuntime.HOST_RUNTIME.createWorker(
|
|
48
|
-
new URL('../../entrypoints/formatter_worker/formatter_worker-entrypoint.js', import.meta.url).toString());
|
|
50
|
+
const worker = Platform.HostRuntime.HOST_RUNTIME.createWorker(this.entrypointURL);
|
|
49
51
|
worker.onmessage = this.onWorkerMessage.bind(this, worker);
|
|
50
52
|
worker.onerror = this.onWorkerError.bind(this, worker);
|
|
51
53
|
return worker;
|
|
@@ -170,7 +170,7 @@ export const NativeFunctions = [
|
|
|
170
170
|
{
|
|
171
171
|
name: "set",
|
|
172
172
|
signatures: [["key","value"]],
|
|
173
|
-
receivers: ["Map","WeakMap","
|
|
173
|
+
receivers: ["Map","WeakMap","CrashReportContext"]
|
|
174
174
|
},
|
|
175
175
|
{
|
|
176
176
|
name: "set",
|
|
@@ -1493,7 +1493,7 @@ export const NativeFunctions = [
|
|
|
1493
1493
|
{
|
|
1494
1494
|
name: "item",
|
|
1495
1495
|
signatures: [["index"]],
|
|
1496
|
-
receivers: ["CSSRuleList","CSSStyleDeclaration","DOMRectList","DOMStringList","DOMTokenList","FileList","HTMLCollectionBase","HTMLCollectionOf","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","NodeListOf","Plugin","PluginArray","SpeechRecognitionResult","SpeechRecognitionResultList","StyleSheetList","TouchList","HTMLCollection","SpeechGrammarList"]
|
|
1496
|
+
receivers: ["CSSRuleList","CSSStyleDeclaration","DOMRectList","DOMStringList","DOMTokenList","FileList","HTMLCollectionBase","HTMLCollectionOf","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","NodeListOf","Plugin","PluginArray","SpeechRecognitionResult","SpeechRecognitionResultList","StyleSheetList","TouchList","TimelineTriggerRangeList","HTMLCollection","SpeechGrammarList"]
|
|
1497
1497
|
},
|
|
1498
1498
|
{
|
|
1499
1499
|
name: "item",
|
|
@@ -1575,7 +1575,7 @@ export const NativeFunctions = [
|
|
|
1575
1575
|
{
|
|
1576
1576
|
name: "delete",
|
|
1577
1577
|
signatures: [["key"]],
|
|
1578
|
-
receivers: ["Map","WeakMap"]
|
|
1578
|
+
receivers: ["Map","WeakMap","CrashReportContext"]
|
|
1579
1579
|
},
|
|
1580
1580
|
{
|
|
1581
1581
|
name: "delete",
|
|
@@ -1998,11 +1998,6 @@ export const NativeFunctions = [
|
|
|
1998
1998
|
signatures: [["start","end"]],
|
|
1999
1999
|
receivers: ["SourceBuffer"]
|
|
2000
2000
|
},
|
|
2001
|
-
{
|
|
2002
|
-
name: "remove",
|
|
2003
|
-
signatures: [["key"]],
|
|
2004
|
-
receivers: ["CrashReportStorage"]
|
|
2005
|
-
},
|
|
2006
2001
|
{
|
|
2007
2002
|
name: "remove",
|
|
2008
2003
|
signatures: [["?options"]],
|
|
@@ -3863,7 +3858,7 @@ export const NativeFunctions = [
|
|
|
3863
3858
|
{
|
|
3864
3859
|
name: "initialize",
|
|
3865
3860
|
signatures: [["length"]],
|
|
3866
|
-
receivers: ["
|
|
3861
|
+
receivers: ["CrashReportContext"]
|
|
3867
3862
|
},
|
|
3868
3863
|
{
|
|
3869
3864
|
name: "initialize",
|
|
@@ -285,6 +285,14 @@ export class PersistenceImpl extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
285
285
|
return bindings.get(uiSourceCode) || null;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Returns whether the UISourceCode has editable content - either its project
|
|
290
|
+
* supports file content changes, or it has a persistence binding to a file system.
|
|
291
|
+
*/
|
|
292
|
+
hasEditableContent(uiSourceCode: Workspace.UISourceCode.UISourceCode): boolean {
|
|
293
|
+
return uiSourceCode.project().canSetFileContent() || this.binding(uiSourceCode) !== null;
|
|
294
|
+
}
|
|
295
|
+
|
|
288
296
|
subscribeForBindingEvent(uiSourceCode: Workspace.UISourceCode.UISourceCode, listener: () => void): void {
|
|
289
297
|
this.#subscribedBindingEventListeners.set(uiSourceCode, listener);
|
|
290
298
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Title: TextUtils BalancedJSONTokenizer matches quotes
|
|
2
|
+
Content:
|
|
3
|
+
Parsing {"odd back slashes with text around":"tes\\\"t"}
|
|
4
|
+
{"odd back slashes with text around":"tes\\\"t"}
|
|
5
|
+
Parsing {"escaped double quotes":"\"test\""}
|
|
6
|
+
{"escaped double quotes":"\"test\""}
|
|
7
|
+
Parsing {"escaped back slash before double quote":"test\\"}
|
|
8
|
+
{"escaped back slash before double quote":"test\\"}
|
|
9
|
+
Parsing {"1":2}
|
|
10
|
+
{"1":2}
|
|
11
|
+
Parsing {"":""}
|
|
12
|
+
{"":""}
|
|
13
|
+
Parsing {"nested brackets":{}}
|
|
14
|
+
{"nested brackets":{}}
|
|
15
|
+
Parsing {"nested brackets with double quotes":{"":""}}
|
|
16
|
+
{"nested brackets with double quotes":{"":""}}
|
|
17
|
+
Parsing {"etc":{"\\":"\""}}
|
|
18
|
+
{"etc":{"\\":"\""}}
|
|
19
|
+
Parsing {"etc":{"\\\\":"\\"}}
|
|
20
|
+
{"etc":{"\\\\":"\\"}}
|
|
21
|
+
Parsing {"etc":{"\\\\\"":"\\\\\""}}
|
|
22
|
+
{"etc":{"\\\\\"":"\\\\\""}}
|
|
23
|
+
=== end content
|
|
24
|
+
|
|
25
|
+
Title: TextUtils BalancedJSONTokenizer matches sequence using one shot
|
|
26
|
+
Content:
|
|
27
|
+
Parsing {"one":"one"}
|
|
28
|
+
{"one":"one"}
|
|
29
|
+
Parsing [{"one":"one"},{"two":"two"}]
|
|
30
|
+
[{"one":"one"}
|
|
31
|
+
Parsing [{"one":"one"},{"two":"two"},{"three":"three"}]
|
|
32
|
+
[{"one":"one"}
|
|
33
|
+
=== end content
|
|
34
|
+
|
|
35
|
+
Title: TextUtils BalancedJSONTokenizer matches sequence using multiple
|
|
36
|
+
Content:
|
|
37
|
+
Parsing {"one":"one"}
|
|
38
|
+
{"one":"one"}
|
|
39
|
+
Parsing [{"one":"one"},{"two":"two"}]
|
|
40
|
+
[{"one":"one"},{"two":"two"}
|
|
41
|
+
Parsing [{"one":"one"},{"two":"two"},{"three":"three"}]
|
|
42
|
+
[{"one":"one"},{"two":"two"},{"three":"three"}
|
|
43
|
+
=== end content
|
|
44
|
+
|
|
45
|
+
Title: TextUtils BalancedJSONTokenizer incremental writes
|
|
46
|
+
Content:
|
|
47
|
+
Running at once:
|
|
48
|
+
[{"odd back slashes with text around":"tes\\\"t"},{"escaped double quotes":"\"test\""},{"escaped back slash before double quote":"test\\"},{"1":2},{"":""},{"nested brackets":{}},{"nested brackets with double quotes":{"":""}},{"etc":{"\\":"\""}},{"etc":{"\\\\":"\\"}},{"etc":{"\\\\\"":"\\\\\""}}
|
|
49
|
+
Running by 3:
|
|
50
|
+
[{"odd back slashes with text around":"tes\\\"t"}
|
|
51
|
+
,{"escaped double quotes":"\"test\""}
|
|
52
|
+
,{"escaped back slash before double quote":"test\\"}
|
|
53
|
+
,{"1":2}
|
|
54
|
+
,{"":""}
|
|
55
|
+
,{"nested brackets":{}}
|
|
56
|
+
,{"nested brackets with double quotes":{"":""}}
|
|
57
|
+
,{"etc":{"\\":"\""}}
|
|
58
|
+
,{"etc":{"\\\\":"\\"}}
|
|
59
|
+
,{"etc":{"\\\\\"":"\\\\\""}}
|
|
60
|
+
Running by 15:
|
|
61
|
+
[{"odd back slashes with text around":"tes\\\"t"}
|
|
62
|
+
,{"escaped double quotes":"\"test\""}
|
|
63
|
+
,{"escaped back slash before double quote":"test\\"},{"1":2}
|
|
64
|
+
,{"":""}
|
|
65
|
+
,{"nested brackets":{}}
|
|
66
|
+
,{"nested brackets with double quotes":{"":""}}
|
|
67
|
+
,{"etc":{"\\":"\""}}
|
|
68
|
+
,{"etc":{"\\\\":"\\"}}
|
|
69
|
+
,{"etc":{"\\\\\"":"\\\\\""}}
|
|
70
|
+
Running by 50:
|
|
71
|
+
[{"odd back slashes with text around":"tes\\\"t"}
|
|
72
|
+
,{"escaped double quotes":"\"test\""}
|
|
73
|
+
,{"escaped back slash before double quote":"test\\"},{"1":2}
|
|
74
|
+
,{"":""},{"nested brackets":{}}
|
|
75
|
+
,{"nested brackets with double quotes":{"":""}},{"etc":{"\\":"\""}}
|
|
76
|
+
,{"etc":{"\\\\":"\\"}},{"etc":{"\\\\\"":"\\\\\""}}
|
|
77
|
+
=== end content
|
|
78
|
+
|
|
79
|
+
Title: TextUtils BalancedJSONTokenizer garbage after object
|
|
80
|
+
Content:
|
|
81
|
+
Parsing [{a: 'b'}], {'x': {a: 'b'}}
|
|
82
|
+
[{a: 'b'}
|
|
83
|
+
=== end content
|
|
@@ -148,7 +148,6 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
148
148
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
149
149
|
title: i18nLazyString(UIStrings.debugWithAi),
|
|
150
150
|
configurableBindings: false,
|
|
151
|
-
featurePromotionId: 'ai-assistance',
|
|
152
151
|
async loadActionDelegate() {
|
|
153
152
|
const AiAssistance = await loadAiAssistanceModule();
|
|
154
153
|
return new AiAssistance.ActionDelegate();
|
|
@@ -5,14 +5,17 @@
|
|
|
5
5
|
import './CollapsibleAssistanceContentWidget.js';
|
|
6
6
|
import './PerformanceAgentFlameChart.js';
|
|
7
7
|
|
|
8
|
+
import * as Common from '../../../core/common/common.js';
|
|
8
9
|
import * as AiAssistanceModel from '../../../models/ai_assistance/ai_assistance.js';
|
|
9
10
|
import * as Logs from '../../../models/logs/logs.js';
|
|
10
11
|
import * as NetworkTimeCalculator from '../../../models/network_time_calculator/network_time_calculator.js';
|
|
11
12
|
import * as Trace from '../../../models/trace/trace.js';
|
|
12
13
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
13
14
|
import * as Lit from '../../../ui/lit/lit.js';
|
|
15
|
+
import * as NetworkForward from '../../network/forward/forward.js';
|
|
14
16
|
import * as Network from '../../network/network.js';
|
|
15
17
|
import * as Insights from '../../timeline/components/insights/insights.js';
|
|
18
|
+
import * as Timeline from '../../timeline/timeline.js';
|
|
16
19
|
|
|
17
20
|
import artifactsViewerStyles from './artifactsViewer.css.js';
|
|
18
21
|
import type * as PerformanceAgentFlameChart from './PerformanceAgentFlameChart.js';
|
|
@@ -39,7 +42,14 @@ export function renderArtifact(
|
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
return html`
|
|
42
|
-
<devtools-collapsible-assistance-content-widget .data=${{
|
|
45
|
+
<devtools-collapsible-assistance-content-widget .data=${{
|
|
46
|
+
headerText: `Insight - ${componentName}`,
|
|
47
|
+
onReveal: () => {
|
|
48
|
+
void UI.InspectorView.InspectorView.instance().showPanel('timeline').then(() => {
|
|
49
|
+
Timeline.TimelinePanel.TimelinePanel.instance().revealInsight(insightModel);
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
}}>
|
|
43
53
|
${insightRenderer.renderInsightToWidgetElement(parsedTrace, insightSet, insightModel, componentName, {
|
|
44
54
|
selected: true,
|
|
45
55
|
isAIAssistanceContext: true,
|
|
@@ -59,8 +69,16 @@ export function renderArtifact(
|
|
|
59
69
|
}
|
|
60
70
|
return html`
|
|
61
71
|
<devtools-collapsible-assistance-content-widget
|
|
62
|
-
.data=${{
|
|
63
|
-
|
|
72
|
+
.data=${{
|
|
73
|
+
headerText: `Network Request: ${
|
|
74
|
+
sdkRequest.url().length > 80 ? sdkRequest.url().slice(0, 80) + '...' : sdkRequest.url()}`,
|
|
75
|
+
onReveal: () => {
|
|
76
|
+
void UI.InspectorView.InspectorView.instance().showPanel('network').then(() => {
|
|
77
|
+
void Common.Revealer.reveal(NetworkForward.UIRequestLocation.UIRequestLocation.tab(
|
|
78
|
+
sdkRequest, NetworkForward.UIRequestLocation.UIRequestTabs.TIMING));
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
}}>
|
|
64
82
|
<devtools-widget class="actions" .widgetConfig=${UI.Widget.widgetConfig(Network.RequestTimingView.RequestTimingView, {
|
|
65
83
|
request: sdkRequest,
|
|
66
84
|
calculator,
|
|
@@ -71,7 +89,13 @@ export function renderArtifact(
|
|
|
71
89
|
}
|
|
72
90
|
case 'flamechart': {
|
|
73
91
|
return html`
|
|
74
|
-
<devtools-collapsible-assistance-content-widget .data=${{
|
|
92
|
+
<devtools-collapsible-assistance-content-widget .data=${{
|
|
93
|
+
headerText: `Flamechart`,
|
|
94
|
+
onReveal: () => {
|
|
95
|
+
// eslint-disable-next-line no-console
|
|
96
|
+
console.log('Reveal flamechart', artifact.start, artifact.end);
|
|
97
|
+
},
|
|
98
|
+
}}>
|
|
75
99
|
<devtools-performance-agent-flame-chart .data=${{
|
|
76
100
|
parsedTrace,
|
|
77
101
|
start: artifact.start,
|
|
@@ -208,7 +208,6 @@ export class ChatView extends HTMLElement {
|
|
|
208
208
|
};
|
|
209
209
|
|
|
210
210
|
#render(): void {
|
|
211
|
-
|
|
212
211
|
const inputWidgetClasses = Lit.Directives.classMap({
|
|
213
212
|
'chat-input-widget': true,
|
|
214
213
|
sticky: !this.#props.isReadOnly,
|
|
@@ -219,22 +218,58 @@ export class ChatView extends HTMLElement {
|
|
|
219
218
|
<style>${chatViewStyles}</style>
|
|
220
219
|
<div class="chat-ui">
|
|
221
220
|
<main @scroll=${this.#handleScroll} ${ref(this.#mainElementRef)}>
|
|
222
|
-
${
|
|
223
|
-
messages
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
221
|
+
${this.#props.messages.length > 0 ? html`
|
|
222
|
+
<div class="messages-container" ${ref(this.#handleMessageContainerRef)}>
|
|
223
|
+
${repeat(this.#props.messages, message =>
|
|
224
|
+
html`<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(ChatMessage, {
|
|
225
|
+
message,
|
|
226
|
+
isLoading: this.#props.isLoading,
|
|
227
|
+
isReadOnly: this.#props.isReadOnly,
|
|
228
|
+
canShowFeedbackForm: this.#props.canShowFeedbackForm,
|
|
229
|
+
userInfo: this.#props.userInfo,
|
|
230
|
+
markdownRenderer: this.#props.markdownRenderer,
|
|
231
|
+
isLastMessage: this.#props.messages.at(-1) === message,
|
|
232
|
+
onSuggestionClick: this.#handleSuggestionClick,
|
|
233
|
+
onFeedbackSubmit: this.#props.onFeedbackSubmit,
|
|
234
|
+
onCopyResponseClick: this.#props.onCopyResponseClick,
|
|
235
|
+
})}></devtools-widget>`
|
|
236
|
+
)}
|
|
237
|
+
${this.#props.isLoading ? Lit.nothing : html`<devtools-widget
|
|
238
|
+
.widgetConfig=${UI.Widget.widgetConfig(PatchWidget, {
|
|
239
|
+
changeSummary: this.#props.changeSummary ?? '',
|
|
240
|
+
changeManager: this.#props.changeManager,
|
|
241
|
+
})}
|
|
242
|
+
></devtools-widget>`}
|
|
243
|
+
</div>
|
|
244
|
+
` : html`
|
|
245
|
+
<div class="empty-state-container">
|
|
246
|
+
<div class="header">
|
|
247
|
+
<div class="icon">
|
|
248
|
+
<devtools-icon
|
|
249
|
+
name="smart-assistant"
|
|
250
|
+
></devtools-icon>
|
|
251
|
+
</div>
|
|
252
|
+
<h1>${lockedString(UIStringsNotTranslate.emptyStateText)}</h1>
|
|
253
|
+
</div>
|
|
254
|
+
<div class="empty-state-content">
|
|
255
|
+
${this.#props.emptyStateSuggestions.map(({title, jslogContext}) => {
|
|
256
|
+
return html`<devtools-button
|
|
257
|
+
class="suggestion"
|
|
258
|
+
@click=${() => this.#handleSuggestionClick(title)}
|
|
259
|
+
.data=${
|
|
260
|
+
{
|
|
261
|
+
variant: Buttons.Button.Variant.OUTLINED,
|
|
262
|
+
size: Buttons.Button.Size.REGULAR,
|
|
263
|
+
title,
|
|
264
|
+
jslogContext: jslogContext ?? 'suggestion',
|
|
265
|
+
disabled: this.#props.isTextInputDisabled,
|
|
266
|
+
} as Buttons.Button.ButtonData
|
|
267
|
+
}
|
|
268
|
+
>${title}</devtools-button>`;
|
|
269
|
+
})}
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
`}
|
|
238
273
|
<devtools-widget class=${inputWidgetClasses} .widgetConfig=${UI.Widget.widgetConfig(ChatInput, {
|
|
239
274
|
isLoading: this.#props.isLoading,
|
|
240
275
|
blockedByCrossOrigin: this.#props.blockedByCrossOrigin,
|
|
@@ -266,158 +301,6 @@ export class ChatView extends HTMLElement {
|
|
|
266
301
|
}
|
|
267
302
|
}
|
|
268
303
|
|
|
269
|
-
function renderMainContents({
|
|
270
|
-
messages,
|
|
271
|
-
isLoading,
|
|
272
|
-
isReadOnly,
|
|
273
|
-
canShowFeedbackForm,
|
|
274
|
-
isTextInputDisabled,
|
|
275
|
-
suggestions,
|
|
276
|
-
userInfo,
|
|
277
|
-
markdownRenderer,
|
|
278
|
-
changeSummary,
|
|
279
|
-
changeManager,
|
|
280
|
-
onSuggestionClick,
|
|
281
|
-
onFeedbackSubmit,
|
|
282
|
-
onCopyResponseClick,
|
|
283
|
-
onMessageContainerRef,
|
|
284
|
-
}: {
|
|
285
|
-
messages: Message[],
|
|
286
|
-
isLoading: boolean,
|
|
287
|
-
isReadOnly: boolean,
|
|
288
|
-
canShowFeedbackForm: boolean,
|
|
289
|
-
isTextInputDisabled: boolean,
|
|
290
|
-
suggestions: AiAssistanceModel.AiAgent.ConversationSuggestion[],
|
|
291
|
-
userInfo: Pick<Host.InspectorFrontendHostAPI.SyncInformation, 'accountImage'|'accountFullName'>,
|
|
292
|
-
markdownRenderer: MarkdownLitRenderer,
|
|
293
|
-
changeManager: AiAssistanceModel.ChangeManager.ChangeManager,
|
|
294
|
-
onSuggestionClick: (suggestion: string) => void,
|
|
295
|
-
onFeedbackSubmit: (rpcId: Host.AidaClient.RpcGlobalId, rate: Host.AidaClient.Rating, feedback?: string) => void,
|
|
296
|
-
onCopyResponseClick: (message: ModelChatMessage) => void,
|
|
297
|
-
onMessageContainerRef: (el: Element|undefined) => void,
|
|
298
|
-
changeSummary?: string,
|
|
299
|
-
}): Lit.LitTemplate {
|
|
300
|
-
if (messages.length > 0) {
|
|
301
|
-
return renderMessages({
|
|
302
|
-
messages,
|
|
303
|
-
isLoading,
|
|
304
|
-
isReadOnly,
|
|
305
|
-
canShowFeedbackForm,
|
|
306
|
-
userInfo,
|
|
307
|
-
markdownRenderer,
|
|
308
|
-
changeSummary,
|
|
309
|
-
changeManager,
|
|
310
|
-
onSuggestionClick,
|
|
311
|
-
onFeedbackSubmit,
|
|
312
|
-
onMessageContainerRef,
|
|
313
|
-
onCopyResponseClick
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
return renderEmptyState({isTextInputDisabled, suggestions, onSuggestionClick});
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
function renderMessages({
|
|
321
|
-
messages,
|
|
322
|
-
isLoading,
|
|
323
|
-
isReadOnly,
|
|
324
|
-
canShowFeedbackForm,
|
|
325
|
-
userInfo,
|
|
326
|
-
markdownRenderer,
|
|
327
|
-
changeSummary,
|
|
328
|
-
changeManager,
|
|
329
|
-
onSuggestionClick,
|
|
330
|
-
onFeedbackSubmit,
|
|
331
|
-
onCopyResponseClick,
|
|
332
|
-
onMessageContainerRef,
|
|
333
|
-
}: {
|
|
334
|
-
messages: Message[],
|
|
335
|
-
isLoading: boolean,
|
|
336
|
-
isReadOnly: boolean,
|
|
337
|
-
canShowFeedbackForm: boolean,
|
|
338
|
-
userInfo: Pick<Host.InspectorFrontendHostAPI.SyncInformation, 'accountImage'|'accountFullName'>,
|
|
339
|
-
markdownRenderer: MarkdownLitRenderer,
|
|
340
|
-
onSuggestionClick: (suggestion: string) => void,
|
|
341
|
-
onFeedbackSubmit: (rpcId: Host.AidaClient.RpcGlobalId, rate: Host.AidaClient.Rating, feedback?: string) => void,
|
|
342
|
-
onCopyResponseClick: (message: ModelChatMessage) => void,
|
|
343
|
-
onMessageContainerRef: (el: Element|undefined) => void,
|
|
344
|
-
changeSummary?: string,
|
|
345
|
-
changeManager?: AiAssistanceModel.ChangeManager.ChangeManager,
|
|
346
|
-
}): Lit.TemplateResult {
|
|
347
|
-
function renderPatchWidget(): Lit.LitTemplate {
|
|
348
|
-
if (isLoading) {
|
|
349
|
-
return Lit.nothing;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// clang-format off
|
|
353
|
-
return html`<devtools-widget
|
|
354
|
-
.widgetConfig=${UI.Widget.widgetConfig(PatchWidget, {
|
|
355
|
-
changeSummary: changeSummary ?? '',
|
|
356
|
-
changeManager,
|
|
357
|
-
})}
|
|
358
|
-
></devtools-widget>`;
|
|
359
|
-
// clang-format on
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
// clang-format off
|
|
363
|
-
return html`
|
|
364
|
-
<div class="messages-container" ${ref(onMessageContainerRef)}>
|
|
365
|
-
${repeat(messages, message =>
|
|
366
|
-
html`<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(ChatMessage, {
|
|
367
|
-
message,
|
|
368
|
-
isLoading,
|
|
369
|
-
isReadOnly,
|
|
370
|
-
canShowFeedbackForm,
|
|
371
|
-
userInfo,
|
|
372
|
-
markdownRenderer,
|
|
373
|
-
isLastMessage: messages.at(-1) === message,
|
|
374
|
-
onSuggestionClick,
|
|
375
|
-
onFeedbackSubmit,
|
|
376
|
-
onCopyResponseClick,
|
|
377
|
-
})}></devtools-widget>`
|
|
378
|
-
)}
|
|
379
|
-
${renderPatchWidget()}
|
|
380
|
-
</div>
|
|
381
|
-
`;
|
|
382
|
-
// clang-format on
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
function renderEmptyState({isTextInputDisabled, suggestions, onSuggestionClick}: {
|
|
386
|
-
isTextInputDisabled: boolean,
|
|
387
|
-
suggestions: AiAssistanceModel.AiAgent.ConversationSuggestion[],
|
|
388
|
-
onSuggestionClick: (suggestion: string) => void,
|
|
389
|
-
}): Lit.TemplateResult {
|
|
390
|
-
// clang-format off
|
|
391
|
-
return html`<div class="empty-state-container">
|
|
392
|
-
<div class="header">
|
|
393
|
-
<div class="icon">
|
|
394
|
-
<devtools-icon
|
|
395
|
-
name="smart-assistant"
|
|
396
|
-
></devtools-icon>
|
|
397
|
-
</div>
|
|
398
|
-
<h1>${lockedString(UIStringsNotTranslate.emptyStateText)}</h1>
|
|
399
|
-
</div>
|
|
400
|
-
<div class="empty-state-content">
|
|
401
|
-
${suggestions.map(({title, jslogContext}) => {
|
|
402
|
-
return html`<devtools-button
|
|
403
|
-
class="suggestion"
|
|
404
|
-
@click=${() => onSuggestionClick(title)}
|
|
405
|
-
.data=${
|
|
406
|
-
{
|
|
407
|
-
variant: Buttons.Button.Variant.OUTLINED,
|
|
408
|
-
size: Buttons.Button.Size.REGULAR,
|
|
409
|
-
title,
|
|
410
|
-
jslogContext: jslogContext ?? 'suggestion',
|
|
411
|
-
disabled: isTextInputDisabled,
|
|
412
|
-
} as Buttons.Button.ButtonData
|
|
413
|
-
}
|
|
414
|
-
>${title}</devtools-button>`;
|
|
415
|
-
})}
|
|
416
|
-
</div>
|
|
417
|
-
</div>`;
|
|
418
|
-
// clang-format on
|
|
419
|
-
}
|
|
420
|
-
|
|
421
304
|
declare global {
|
|
422
305
|
interface HTMLElementTagNameMap {
|
|
423
306
|
'devtools-ai-chat-view': ChatView;
|
|
@@ -12,15 +12,18 @@ const {render, html} = Lit;
|
|
|
12
12
|
|
|
13
13
|
export interface CollapsibleAssistanceContentWidgetData {
|
|
14
14
|
headerText: string;
|
|
15
|
+
onReveal?: () => void;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export class CollapsibleAssistanceContentWidget extends HTMLElement {
|
|
18
19
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
19
20
|
#isCollapsed = false;
|
|
20
21
|
#headerText = 'Details';
|
|
22
|
+
#onReveal?: () => void;
|
|
21
23
|
|
|
22
24
|
set data(data: CollapsibleAssistanceContentWidgetData) {
|
|
23
25
|
this.#headerText = data.headerText;
|
|
26
|
+
this.#onReveal = data.onReveal;
|
|
24
27
|
this.#render();
|
|
25
28
|
}
|
|
26
29
|
|
|
@@ -43,14 +46,30 @@ export class CollapsibleAssistanceContentWidget extends HTMLElement {
|
|
|
43
46
|
this.#toggleCollapse();
|
|
44
47
|
}}>
|
|
45
48
|
${this.#headerText}
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
<div>
|
|
50
|
+
<devtools-button .data=${{
|
|
51
|
+
variant: Buttons.Button.Variant.ICON,
|
|
52
|
+
iconName: 'select-element',
|
|
53
|
+
color: 'var(--sys-color-on-surface)',
|
|
54
|
+
width: '14px',
|
|
55
|
+
height: '14px',
|
|
56
|
+
title: 'reveal',
|
|
57
|
+
} as Buttons.Button.ButtonData}
|
|
58
|
+
@click=${(event: Event) => {
|
|
59
|
+
event.stopPropagation();
|
|
60
|
+
this.#onReveal?.();
|
|
61
|
+
}}
|
|
62
|
+
></devtools-button>
|
|
63
|
+
<devtools-button .data=${{
|
|
64
|
+
variant: Buttons.Button.Variant.ICON,
|
|
65
|
+
iconName: this.#isCollapsed ? 'triangle-right' : 'triangle-down',
|
|
66
|
+
color: 'var(--sys-color-on-surface)',
|
|
67
|
+
width: '14px',
|
|
68
|
+
height: '14px',
|
|
69
|
+
title: 'expand',
|
|
70
|
+
} as Buttons.Button.ButtonData}
|
|
71
|
+
></devtools-button>
|
|
72
|
+
</div>
|
|
54
73
|
</summary>
|
|
55
74
|
<div class="content">
|
|
56
75
|
<slot></slot>
|
|
@@ -2,10 +2,10 @@
|
|
|
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
4
|
|
|
5
|
-
import './CollapsibleAssistanceContentWidget.js';
|
|
6
5
|
import '../../../models/trace/insights/insights.js';
|
|
7
6
|
import '../../../panels/timeline/components/components.js';
|
|
8
7
|
import './PerformanceAgentFlameChart.js';
|
|
8
|
+
import './CollapsibleAssistanceContentWidget.js';
|
|
9
9
|
|
|
10
10
|
import * as Common from '../../../core/common/common.js';
|
|
11
11
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
@@ -19,9 +19,11 @@ import type * as Marked from '../../../third_party/marked/marked.js';
|
|
|
19
19
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
20
20
|
import * as Lit from '../../../ui/lit/lit.js';
|
|
21
21
|
import * as PanelsCommon from '../../common/common.js';
|
|
22
|
+
import * as NetworkForward from '../../network/forward/forward.js';
|
|
22
23
|
import * as Network from '../../network/network.js';
|
|
23
24
|
import * as TimelineComponents from '../../timeline/components/components.js';
|
|
24
25
|
import * as Insights from '../../timeline/components/insights/insights.js';
|
|
26
|
+
import * as Timeline from '../../timeline/timeline.js';
|
|
25
27
|
|
|
26
28
|
import {MarkdownRendererWithCodeBlock} from './MarkdownRendererWithCodeBlock.js';
|
|
27
29
|
import type * as PerformanceAgentFlameChart from './PerformanceAgentFlameChart.js';
|
|
@@ -86,7 +88,11 @@ export class PerformanceAgentMarkdownRenderer extends MarkdownRendererWithCodeBl
|
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
return html`<devtools-collapsible-assistance-content-widget .data=${{
|
|
89
|
-
headerText: `Insight - ${componentName}
|
|
91
|
+
headerText: `Insight - ${componentName}`, onReveal: () => {
|
|
92
|
+
void UI.InspectorView.InspectorView.instance().showPanel('timeline').then(() => {
|
|
93
|
+
Timeline.TimelinePanel.TimelinePanel.instance().revealInsight(insightM);
|
|
94
|
+
});
|
|
95
|
+
},
|
|
90
96
|
}
|
|
91
97
|
}>
|
|
92
98
|
${this.#insightRenderer.renderInsightToWidgetElement(this.parsedTrace, insightSet, insightM, componentName, {
|
|
@@ -115,7 +121,13 @@ export class PerformanceAgentMarkdownRenderer extends MarkdownRendererWithCodeBl
|
|
|
115
121
|
return html`<devtools-collapsible-assistance-content-widget
|
|
116
122
|
.data=${{
|
|
117
123
|
headerText: `Network Request: ${
|
|
118
|
-
networkRequest.url().length > 80 ? networkRequest.url().slice(0, 80) + '...' : networkRequest.url()}
|
|
124
|
+
networkRequest.url().length > 80 ? networkRequest.url().slice(0, 80) + '...' : networkRequest.url()}`,
|
|
125
|
+
onReveal: () => {
|
|
126
|
+
void UI.InspectorView.InspectorView.instance().showPanel('network').then(() => {
|
|
127
|
+
void Common.Revealer.reveal(NetworkForward.UIRequestLocation.UIRequestLocation.tab(
|
|
128
|
+
networkRequest, NetworkForward.UIRequestLocation.UIRequestTabs.TIMING));
|
|
129
|
+
});
|
|
130
|
+
},
|
|
119
131
|
}
|
|
120
132
|
}>
|
|
121
133
|
<devtools-widget class="actions" .widgetConfig=${
|
|
@@ -142,7 +154,10 @@ export class PerformanceAgentMarkdownRenderer extends MarkdownRendererWithCodeBl
|
|
|
142
154
|
|
|
143
155
|
return html`<devtools-collapsible-assistance-content-widget
|
|
144
156
|
.data=${{
|
|
145
|
-
headerText: 'Network Request'
|
|
157
|
+
headerText: 'Network Request', onReveal: () => {
|
|
158
|
+
// eslint-disable-next-line no-console
|
|
159
|
+
console.log('Reveal network request', value);
|
|
160
|
+
},
|
|
146
161
|
}
|
|
147
162
|
}>
|
|
148
163
|
${networkTooltip}
|
|
@@ -773,6 +773,7 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
|
|
|
773
773
|
this.cookieListTreeElement.removeChildren();
|
|
774
774
|
this.interestGroupTreeElement.clearEvents();
|
|
775
775
|
this.deviceBoundSessionsModel?.clearVisibleSites();
|
|
776
|
+
this.deviceBoundSessionsModel?.clearEvents();
|
|
776
777
|
}
|
|
777
778
|
|
|
778
779
|
private frameNavigated(event: Common.EventTarget.EventTargetEvent<SDK.ResourceTreeModel.ResourceTreeFrame>): void {
|