chrome-devtools-frontend 1.0.1565595 → 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/Images/src/lock-person.svg +1 -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/root/Runtime.ts +5 -0
- package/front_end/core/sdk/DOMModel.ts +32 -2
- package/front_end/core/sdk/NetworkManager.ts +16 -3
- package/front_end/core/sdk/ResourceTreeModel.ts +11 -6
- package/front_end/entrypoints/main/MainImpl.ts +1 -7
- package/front_end/generated/Deprecation.ts +0 -8
- package/front_end/generated/InspectorBackendCommands.ts +10 -1
- package/front_end/generated/SupportedCSSProperties.js +48 -62
- package/front_end/generated/protocol-mapping.d.ts +4 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +203 -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 +29 -0
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +12 -0
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +169 -0
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +219 -0
- package/front_end/panels/application/DeviceBoundSessionsView.ts +1096 -0
- package/front_end/panels/application/ResourcesPanel.ts +19 -0
- package/front_end/panels/application/application.ts +6 -0
- package/front_end/panels/application/deviceBoundSessionsView.css +27 -0
- 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 +41 -8
- package/front_end/panels/console/ConsoleViewMessage.ts +20 -13
- package/front_end/panels/elements/ElementsTreeOutline.ts +13 -0
- package/front_end/panels/elements/MetricsSidebarPane.ts +3 -1
- 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/security/SecurityPanelSidebar.ts +0 -1
- 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/color_picker/FormatPickerContextMenu.ts +8 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +4 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +13 -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
|
@@ -77,37 +77,29 @@ const getGreenDevAdditionalWidgetGuidelines = (): string => {
|
|
|
77
77
|
|
|
78
78
|
if (widgetsFromFunctionCalls) {
|
|
79
79
|
return `
|
|
80
|
-
- CRITICAL: You have access to
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
- **
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- **Example**: If you are explaining the causes of a poor LCP score, you MUST also call
|
|
90
|
-
\`addInsightWidget({insightType: 'LCPBreakdown'})\`. This provides the user with the data to explore
|
|
91
|
-
alongside your explanation.
|
|
92
|
-
- **\`addNetworkRequestWidget({eventKey: '...'})\`**:
|
|
80
|
+
- CRITICAL: You have access to a function for adding rich, interactive widgets to your response: \`addWidget\`.
|
|
81
|
+
You MUST use this function whenever you refer to a corresponding entity.
|
|
82
|
+
|
|
83
|
+
- **\`addWidget({widget: {type: 'insight', insightType: '...'}})\`**:
|
|
84
|
+
- **When to use**: Call this function every time you mention a specific performance insight (e.g., LCP, INP, CLS culprits).
|
|
85
|
+
- **Purpose**: It embeds an interactive widget that provides a detailed breakdown and visualization of the insight.
|
|
86
|
+
- **Example**: If you are explaining the causes of a poor LCP score, you MUST also call \`addWidget({widget: {type: 'insight', insightType: 'LCPBreakdown'}})\`.
|
|
87
|
+
|
|
88
|
+
- **\`addWidget({widget: {type: 'network-request', eventKey: '...'}})\`**:
|
|
93
89
|
- **When to use**: Call this function whenever you discuss a specific network request.
|
|
94
|
-
- **Purpose**: It adds a widget displaying the full details of the network request, such as its timing,
|
|
95
|
-
|
|
96
|
-
- **
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
or -) of that script's network request.
|
|
101
|
-
- **\`addFlameChartWidget({start: ..., end: ...})\`**:
|
|
102
|
-
- **When to use**: Call this function to highlight a specific time range within the trace, especially when
|
|
103
|
-
discussing long tasks, specific events, or periods of high activity.
|
|
90
|
+
- **Purpose**: It adds a widget displaying the full details of the network request, such as its timing, headers, and priority.
|
|
91
|
+
- **Critical**: The eventKey should be the trace event key (only the number, no letters prefix or -) of that script's network request.
|
|
92
|
+
- **Example**: If you identify a render-blocking script, you MUST also call \`addWidget({widget: {type: 'network-request', eventKey: '...'}})\`.
|
|
93
|
+
|
|
94
|
+
- **\`addWidget({widget: {type: 'flamechart', start: ..., end: ...}})\`**:
|
|
95
|
+
- **When to use**: Call this function to highlight a specific time range within the trace, especially when discussing long tasks, specific events, or periods of high activity.
|
|
104
96
|
- **Purpose**: It embeds a focused flame chart visualization for the given time range (in microseconds).
|
|
105
|
-
- **Example**: If you find a long task that is blocking the main thread, you MUST also call
|
|
106
|
-
|
|
107
|
-
alongside your explanation.
|
|
97
|
+
- **Example**: If you find a long task that is blocking the main thread, you MUST also call \`addWidget({widget: {type: 'flamechart', start: 123456, end: 789012}})\`.
|
|
98
|
+
|
|
108
99
|
- **General Rules**:
|
|
109
|
-
- You MUST call
|
|
100
|
+
- You MUST call this function as soon as you identify the entity you are discussing.
|
|
110
101
|
- Do NOT add more than one widget for the same insight, network request, or time range to avoid redundancy.
|
|
102
|
+
- If you have already shown a widget for any specific insight, network request, or time range, do not show it again.
|
|
111
103
|
`;
|
|
112
104
|
}
|
|
113
105
|
|
|
@@ -1247,104 +1239,105 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
1247
1239
|
}
|
|
1248
1240
|
|
|
1249
1241
|
if (Root.Runtime.hostConfig.devToolsGreenDevUi?.enabled) {
|
|
1250
|
-
this.declareFunction<
|
|
1242
|
+
this.declareFunction<
|
|
1243
|
+
{
|
|
1244
|
+
type: 'insight' | 'network-request' | 'flamechart',
|
|
1245
|
+
insightType?: Trace.Insights.Types.InsightKeys,
|
|
1246
|
+
eventKey?: number,
|
|
1247
|
+
start?: number,
|
|
1248
|
+
end?: number,
|
|
1249
|
+
},
|
|
1250
|
+
object|{error: string}>('addWidget', {
|
|
1251
1251
|
description:
|
|
1252
|
-
'Adds an insight widget to the response. When mentioning an insight, call this function to also display an appropriate widget.',
|
|
1252
|
+
'Adds an insight widget to the response. When mentioning an insight, call this function to also display an appropriate widget. Use this as much as possible to provide a better user experience.',
|
|
1253
1253
|
parameters: {
|
|
1254
1254
|
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
1255
1255
|
description: '',
|
|
1256
1256
|
nullable: false,
|
|
1257
1257
|
properties: {
|
|
1258
|
-
|
|
1258
|
+
type: {
|
|
1259
1259
|
type: Host.AidaClient.ParametersTypes.STRING,
|
|
1260
|
-
description:
|
|
1261
|
-
'The name of the insight. Only use the insight names given in the "Available insights" list.',
|
|
1260
|
+
description: 'The type of the widget to add. Possible values: insight, network-request, flamechart',
|
|
1262
1261
|
nullable: false,
|
|
1263
1262
|
},
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
},
|
|
1270
|
-
});
|
|
1271
|
-
|
|
1272
|
-
this.declareFunction<{eventKey: string}, object|{error: string}>('addNetworkRequestWidget', {
|
|
1273
|
-
description:
|
|
1274
|
-
'Adds a network request widget to the response. When mentioning a network request, call this function with its trace event key.',
|
|
1275
|
-
parameters: {
|
|
1276
|
-
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
1277
|
-
description: '',
|
|
1278
|
-
nullable: false,
|
|
1279
|
-
properties: {
|
|
1263
|
+
insightType: {
|
|
1264
|
+
type: Host.AidaClient.ParametersTypes.STRING,
|
|
1265
|
+
description: 'The type of the insight widget. Include for insight widgets.',
|
|
1266
|
+
nullable: true,
|
|
1267
|
+
},
|
|
1280
1268
|
eventKey: {
|
|
1281
1269
|
type: Host.AidaClient.ParametersTypes.STRING,
|
|
1282
|
-
description: 'The
|
|
1283
|
-
nullable:
|
|
1270
|
+
description: 'The event key for the network request widget. Include for network request widgets.',
|
|
1271
|
+
nullable: true,
|
|
1284
1272
|
},
|
|
1285
|
-
},
|
|
1286
|
-
},
|
|
1287
|
-
handler: async _params => {
|
|
1288
|
-
const rawTraceEvent =
|
|
1289
|
-
Trace.Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents().at(
|
|
1290
|
-
Number(_params.eventKey));
|
|
1291
|
-
// Get the trace event object if it is available.
|
|
1292
|
-
// If the trace is uploaded, we need to use the synthetic event.
|
|
1293
|
-
if (rawTraceEvent && Trace.Types.Events.isSyntheticNetworkRequest(rawTraceEvent)) {
|
|
1294
|
-
const rawTraceEventId = rawTraceEvent?.args?.data?.requestId;
|
|
1295
|
-
const rawTraceEventUrl = rawTraceEvent?.args?.data?.url;
|
|
1296
|
-
const networkRequest = rawTraceEvent ? Logs.NetworkLog.NetworkLog.instance()
|
|
1297
|
-
.requestsForId(rawTraceEventId)
|
|
1298
|
-
.find(r => r.url() === rawTraceEventUrl) :
|
|
1299
|
-
null;
|
|
1300
|
-
if (networkRequest) {
|
|
1301
|
-
ArtifactsManager.instance().addArtifact({type: 'network-request', request: networkRequest});
|
|
1302
|
-
return {result: {success: true}};
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
const syntheticRequest =
|
|
1307
|
-
Trace.Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().syntheticEventForRawEventIndex(
|
|
1308
|
-
Number(_params.eventKey));
|
|
1309
|
-
|
|
1310
|
-
if (syntheticRequest && Trace.Types.Events.isSyntheticNetworkRequest(syntheticRequest)) {
|
|
1311
|
-
ArtifactsManager.instance().addArtifact({
|
|
1312
|
-
type: 'network-request',
|
|
1313
|
-
request: syntheticRequest,
|
|
1314
|
-
});
|
|
1315
|
-
return {result: {success: true}};
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
return {result: {error: 'Could not find network request'}};
|
|
1319
|
-
},
|
|
1320
|
-
});
|
|
1321
|
-
|
|
1322
|
-
this.declareFunction<{start: number, end: number}, object|{error: string}>('addFlameChartWidget', {
|
|
1323
|
-
description: 'Adds a flame chart widget to the response.',
|
|
1324
|
-
parameters: {
|
|
1325
|
-
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
1326
|
-
description: '',
|
|
1327
|
-
nullable: false,
|
|
1328
|
-
properties: {
|
|
1329
1273
|
start: {
|
|
1330
1274
|
type: Host.AidaClient.ParametersTypes.INTEGER,
|
|
1331
|
-
description: 'The start time
|
|
1332
|
-
nullable:
|
|
1275
|
+
description: 'The start time for the flame chart widget. Include for flame chart widgets.',
|
|
1276
|
+
nullable: true,
|
|
1333
1277
|
},
|
|
1334
1278
|
end: {
|
|
1335
1279
|
type: Host.AidaClient.ParametersTypes.INTEGER,
|
|
1336
|
-
description: 'The end time
|
|
1337
|
-
nullable:
|
|
1280
|
+
description: 'The end time for the flame chart widget. Include for flame chart widgets.',
|
|
1281
|
+
nullable: true,
|
|
1338
1282
|
},
|
|
1339
1283
|
},
|
|
1340
1284
|
},
|
|
1341
|
-
handler: async
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1285
|
+
handler: async params => {
|
|
1286
|
+
switch (params.type) {
|
|
1287
|
+
case 'insight':
|
|
1288
|
+
if (!params.insightType) {
|
|
1289
|
+
return {error: 'Missing insightType for insight widget'};
|
|
1290
|
+
}
|
|
1291
|
+
ArtifactsManager.instance().addArtifact({type: 'insight', insightType: params.insightType});
|
|
1292
|
+
return {result: {success: true}};
|
|
1293
|
+
case 'network-request': {
|
|
1294
|
+
if (!params.eventKey) {
|
|
1295
|
+
return {error: 'Missing eventKey for network-request widget'};
|
|
1296
|
+
}
|
|
1297
|
+
const rawTraceEvent =
|
|
1298
|
+
Trace.Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents().at(
|
|
1299
|
+
Number(params.eventKey));
|
|
1300
|
+
// Get the trace event object if it is available.
|
|
1301
|
+
// If the trace is uploaded, we need to use the synthetic event.
|
|
1302
|
+
if (rawTraceEvent && Trace.Types.Events.isSyntheticNetworkRequest(rawTraceEvent)) {
|
|
1303
|
+
const rawTraceEventId = rawTraceEvent?.args?.data?.requestId;
|
|
1304
|
+
const rawTraceEventUrl = rawTraceEvent?.args?.data?.url;
|
|
1305
|
+
const networkRequest = rawTraceEvent ? Logs.NetworkLog.NetworkLog.instance()
|
|
1306
|
+
.requestsForId(rawTraceEventId)
|
|
1307
|
+
.find(r => r.url() === rawTraceEventUrl) :
|
|
1308
|
+
null;
|
|
1309
|
+
if (networkRequest) {
|
|
1310
|
+
ArtifactsManager.instance().addArtifact({type: 'network-request', request: networkRequest});
|
|
1311
|
+
return {result: {success: true}};
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
const syntheticRequest = Trace.Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager()
|
|
1316
|
+
.syntheticEventForRawEventIndex(Number(params.eventKey));
|
|
1317
|
+
|
|
1318
|
+
if (syntheticRequest && Trace.Types.Events.isSyntheticNetworkRequest(syntheticRequest)) {
|
|
1319
|
+
ArtifactsManager.instance().addArtifact({
|
|
1320
|
+
type: 'network-request',
|
|
1321
|
+
request: syntheticRequest,
|
|
1322
|
+
});
|
|
1323
|
+
return {result: {success: true}};
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
return {result: {error: 'Could not find network request'}};
|
|
1327
|
+
}
|
|
1328
|
+
case 'flamechart':
|
|
1329
|
+
if (params.start === undefined || params.end === undefined) {
|
|
1330
|
+
return {error: 'Missing start or end for flamechart widget'};
|
|
1331
|
+
}
|
|
1332
|
+
ArtifactsManager.instance().addArtifact({
|
|
1333
|
+
type: 'flamechart',
|
|
1334
|
+
start: Trace.Types.Timing.Micro(params.start),
|
|
1335
|
+
end: Trace.Types.Timing.Micro(params.end),
|
|
1336
|
+
});
|
|
1337
|
+
return {result: {success: true}};
|
|
1338
|
+
default:
|
|
1339
|
+
return {error: 'Invalid widget type'};
|
|
1340
|
+
}
|
|
1348
1341
|
},
|
|
1349
1342
|
});
|
|
1350
1343
|
}
|
|
@@ -122,7 +122,7 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
122
122
|
this.#preferredSize = new Geometry.Size(1, 1);
|
|
123
123
|
this.#initialized = false;
|
|
124
124
|
this.#appliedDeviceSize = new Geometry.Size(1, 1);
|
|
125
|
-
this.#appliedDeviceScaleFactor =
|
|
125
|
+
this.#appliedDeviceScaleFactor = globalThis.devicePixelRatio;
|
|
126
126
|
this.#appliedUserAgentType = UA.DESKTOP;
|
|
127
127
|
|
|
128
128
|
this.#scaleSetting = Common.Settings.Settings.instance().createSetting('emulation.device-scale', 1);
|
|
@@ -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,
|