chrome-devtools-frontend 1.0.1515446 → 1.0.1515988
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/infrastructure.md +131 -82
- package/front_end/Tests.js +3 -29
- package/front_end/core/common/Progress.ts +73 -55
- package/front_end/core/host/UserMetrics.ts +0 -1
- package/front_end/core/protocol_client/InspectorBackend.ts +2 -0
- package/front_end/core/root/Runtime.ts +0 -1
- package/front_end/core/sdk/CSSMatchedStyles.ts +12 -10
- package/front_end/core/sdk/CSSModel.ts +1 -31
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +27 -7
- package/front_end/core/sdk/DebuggerModel.ts +1 -31
- package/front_end/core/sdk/EnhancedTracesParser.ts +81 -50
- package/front_end/core/sdk/NetworkManager.ts +1 -31
- package/front_end/core/sdk/NetworkRequest.ts +1 -31
- package/front_end/core/sdk/RehydratingConnection.snapshot.txt +1003 -0
- package/front_end/core/sdk/RehydratingConnection.ts +13 -18
- package/front_end/core/sdk/RehydratingObject.ts +8 -31
- package/front_end/core/sdk/RemoteObject.ts +1 -31
- package/front_end/core/sdk/ResourceTreeModel.ts +1 -31
- package/front_end/core/sdk/RuntimeModel.ts +1 -31
- package/front_end/core/sdk/ServiceWorkerManager.ts +1 -31
- package/front_end/core/sdk/SourceMap.ts +1 -31
- package/front_end/core/sdk/TraceObject.ts +8 -3
- package/front_end/entrypoints/main/MainImpl.ts +0 -2
- package/front_end/entrypoints/main/main-meta.ts +2 -2
- package/front_end/generated/InspectorBackendCommands.js +4 -4
- package/front_end/generated/SupportedCSSProperties.js +12 -0
- package/front_end/generated/protocol.ts +10 -1
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -3
- package/front_end/models/ai_assistance/ConversationHandler.ts +4 -6
- package/front_end/models/ai_assistance/agents/AiAgent.ts +4 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +107 -72
- package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +178 -85
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +308 -218
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +161 -97
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +78 -58
- package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +10 -1
- package/front_end/models/ai_assistance/performance/AIContext.ts +19 -21
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +123 -55
- package/front_end/models/bindings/ContentProviderBasedProject.ts +6 -4
- package/front_end/models/breakpoints/BreakpointManager.ts +3 -3
- package/front_end/models/har/Writer.ts +11 -11
- package/front_end/models/javascript_metadata/NativeFunctions.js +7 -7
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +3 -3
- package/front_end/models/persistence/IsolatedFileSystem.ts +4 -4
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +7 -7
- package/front_end/models/persistence/PersistenceImpl.ts +8 -8
- package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
- package/front_end/models/text_utils/TextUtils.ts +26 -0
- package/front_end/models/trace/ModelImpl.ts +2 -16
- package/front_end/models/trace/Processor.ts +14 -8
- package/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +4 -4
- package/front_end/models/trace/handlers/FramesHandler.ts +2 -2
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +7 -10
- package/front_end/models/trace/handlers/MetaHandler.ts +11 -9
- package/front_end/models/trace/handlers/ScreenshotsHandler.ts +1 -1
- package/front_end/models/trace/handlers/ScriptsHandler.ts +5 -5
- package/front_end/models/trace/handlers/UserInteractionsHandler.ts +2 -14
- package/front_end/models/trace/handlers/UserTimingsHandler.ts +3 -4
- package/front_end/models/trace/insights/CLSCulprits.ts +1 -1
- package/front_end/models/trace/insights/DocumentLatency.ts +8 -7
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -1
- package/front_end/models/trace/insights/INPBreakdown.ts +1 -1
- package/front_end/models/trace/insights/ImageDelivery.ts +1 -1
- package/front_end/models/trace/insights/LCPBreakdown.ts +1 -1
- package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +1 -1
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
- package/front_end/models/trace/insights/types.ts +2 -0
- package/front_end/models/trace/types/Configuration.ts +12 -0
- package/front_end/models/trace/types/TraceEvents.ts +41 -64
- package/front_end/models/trace_source_maps_resolver/trace_source_maps_resolver.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +21 -99
- package/front_end/panels/application/ServiceWorkersView.ts +0 -1
- package/front_end/panels/application/components/BackForwardCacheStrings.ts +8 -2
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +2 -3
- package/front_end/panels/common/BadgeNotification.ts +10 -8
- package/front_end/panels/common/GdpSignUpDialog.ts +30 -14
- package/front_end/panels/common/gdpSignUpDialog.css +4 -0
- package/front_end/panels/console/ConsoleView.ts +23 -28
- package/front_end/panels/console/ConsoleViewport.ts +2 -2
- package/front_end/panels/console/consoleView.css +11 -1
- package/front_end/panels/coverage/CoverageView.ts +2 -2
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
- package/front_end/panels/elements/StyleEditorWidget.ts +8 -19
- package/front_end/panels/elements/StylePropertyTreeElement.ts +39 -25
- package/front_end/panels/elements/StylesSidebarPane.ts +2 -2
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +4 -3
- package/front_end/panels/layer_viewer/Layers3DView.ts +2 -2
- package/front_end/panels/layers/LayerTreeModel.ts +3 -3
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +4 -4
- package/front_end/panels/network/NetworkLogView.ts +1 -1
- package/front_end/panels/network/NetworkLogViewColumns.ts +3 -3
- package/front_end/panels/network/NetworkSearchScope.ts +6 -6
- package/front_end/panels/search/SearchView.ts +220 -159
- package/front_end/panels/settings/components/SyncSection.ts +64 -10
- package/front_end/panels/settings/components/syncSection.css +6 -0
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +1 -4
- package/front_end/panels/sources/SourcesSearchScope.ts +4 -4
- package/front_end/panels/sources/TabbedEditorContainer.ts +5 -5
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +10 -5
- package/front_end/panels/timeline/TimelineFlameChartView.ts +18 -15
- package/front_end/panels/timeline/TimelinePanel.ts +41 -22
- package/front_end/panels/timeline/TracingLayerTree.ts +4 -5
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +37 -22
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +17 -7
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
- package/front_end/third_party/axe-core/README.chromium +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror/README.chromium +1 -0
- package/front_end/third_party/codemirror.next/README.chromium +1 -0
- package/front_end/third_party/csp_evaluator/README.chromium +1 -0
- package/front_end/third_party/diff/README.chromium +1 -0
- package/front_end/third_party/i18n/README.chromium +1 -0
- package/front_end/third_party/intl-messageformat/README.chromium +1 -0
- package/front_end/third_party/json5/README.chromium +1 -0
- package/front_end/third_party/legacy-javascript/README.chromium +1 -0
- package/front_end/third_party/lighthouse/README.chromium +1 -0
- package/front_end/third_party/lit/README.chromium +1 -0
- package/front_end/third_party/marked/README.chromium +1 -0
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/README.md +6 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +11 -1
- 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 +2 -2
- 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/Page.d.ts +5 -1
- 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 +30 -8
- 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.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +1 -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/Realm.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js +8 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +5 -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 +8 -2
- 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/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +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/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +5 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.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/es5-iife/puppeteer-core-browser.d.ts +12 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +22 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +11 -1
- 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 +2 -2
- 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/Page.d.ts +5 -1
- 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 +30 -8
- 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.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +1 -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/cdp/NetworkManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js +8 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +5 -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 +8 -2
- 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/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +5 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +12 -2
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +13 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +50 -8
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +0 -1
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +8 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +21 -5
- package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +12 -0
- package/front_end/third_party/puppeteer-replay/README.chromium +1 -0
- package/front_end/third_party/third-party-web/README.chromium +1 -0
- package/front_end/third_party/vscode.web-custom-data/README.chromium +1 -0
- package/front_end/third_party/wasmparser/README.chromium +1 -0
- package/front_end/third_party/web-vitals/README.chromium +1 -0
- package/front_end/ui/components/text_editor/config.ts +66 -16
- package/front_end/ui/components/tooltips/Tooltip.ts +17 -1
- package/front_end/ui/legacy/ContextMenu.ts +2 -2
- package/front_end/ui/legacy/GlassPane.ts +7 -3
- package/front_end/ui/legacy/ProgressIndicator.ts +33 -21
- package/front_end/ui/legacy/TabbedPane.ts +2 -2
- package/front_end/ui/legacy/Treeoutline.ts +10 -5
- package/front_end/ui/legacy/UIUtils.ts +42 -10
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +14 -14
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +6 -6
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +4 -2
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +3 -29
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +14 -14
- package/front_end/ui/visual_logging/Debugging.ts +24 -12
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/inspector_overlay/highlight_common.ts +1 -27
- package/inspector_overlay/highlight_grid_common.ts +1 -27
- package/inspector_overlay/tool_highlight.ts +1 -27
- package/inspector_overlay/tool_persistent.ts +1 -27
- package/inspector_overlay/tool_source_order.ts +1 -27
- package/package.json +3 -3
@@ -62,7 +62,7 @@ export const UIStrings = {
|
|
62
62
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/LCPDiscovery.ts', UIStrings);
|
63
63
|
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
64
64
|
|
65
|
-
export function
|
65
|
+
export function isLCPDiscoveryInsight(model: InsightModel): model is LCPDiscoveryInsightModel {
|
66
66
|
return model.insightKey === 'LCPDiscovery';
|
67
67
|
}
|
68
68
|
export type LCPDiscoveryInsightModel = InsightModel<typeof UIStrings, {
|
@@ -50,7 +50,7 @@ export type ModernHTTPInsightModel = InsightModel<typeof UIStrings, {
|
|
50
50
|
http1Requests: Types.Events.SyntheticNetworkRequest[],
|
51
51
|
}>;
|
52
52
|
|
53
|
-
export function
|
53
|
+
export function isModernHTTPInsight(model: InsightModel): model is ModernHTTPInsightModel {
|
54
54
|
return model.insightKey === InsightKeys.MODERN_HTTP;
|
55
55
|
}
|
56
56
|
|
@@ -666,7 +666,7 @@ export function generatePreconnectCandidates(
|
|
666
666
|
return preconnectCandidates.slice(0, TOO_MANY_PRECONNECTS_THRESHOLD);
|
667
667
|
}
|
668
668
|
|
669
|
-
export function
|
669
|
+
export function isNetworkDependencyTreeInsight(model: InsightModel): model is NetworkDependencyTreeInsightModel {
|
670
670
|
return model.insightKey === InsightKeys.NETWORK_DEPENDENCY_TREE;
|
671
671
|
}
|
672
672
|
|
@@ -48,7 +48,7 @@ export const UIStrings = {
|
|
48
48
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/RenderBlocking.ts', UIStrings);
|
49
49
|
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
50
50
|
|
51
|
-
export function
|
51
|
+
export function isRenderBlockingInsight(insight: InsightModel): insight is RenderBlockingInsightModel {
|
52
52
|
return insight.insightKey === 'RenderBlocking';
|
53
53
|
}
|
54
54
|
|
@@ -14,12 +14,14 @@ import type * as Models from './Models.js';
|
|
14
14
|
export type InsightSetContext = InsightSetContextWithoutNavigation|InsightSetContextWithNavigation;
|
15
15
|
|
16
16
|
export interface InsightSetContextWithoutNavigation {
|
17
|
+
options: Types.Configuration.ParseOptions;
|
17
18
|
bounds: Types.Timing.TraceWindowMicro;
|
18
19
|
frameId: string;
|
19
20
|
navigation?: never;
|
20
21
|
}
|
21
22
|
|
22
23
|
export interface InsightSetContextWithNavigation {
|
24
|
+
options: Types.Configuration.ParseOptions;
|
23
25
|
bounds: Types.Timing.TraceWindowMicro;
|
24
26
|
frameId: string;
|
25
27
|
navigation: Types.Events.NavigationStart;
|
@@ -8,6 +8,7 @@ import type * as Protocol from '../../../generated/protocol.js';
|
|
8
8
|
import type * as Lantern from '../lantern/lantern.js';
|
9
9
|
|
10
10
|
import type * as File from './File.js';
|
11
|
+
import type {Milli} from './Timing.js';
|
11
12
|
|
12
13
|
export interface Configuration {
|
13
14
|
/**
|
@@ -83,6 +84,17 @@ export interface ParseOptions {
|
|
83
84
|
end: (id: string) => void,
|
84
85
|
};
|
85
86
|
lanternSettings?: Omit<Lantern.Types.Simulation.Settings, 'networkAnalysis'>;
|
87
|
+
/**
|
88
|
+
* Used when an Insight needs to format a time to string as part of its
|
89
|
+
* output. By default we use the i18n.TimeUtilities in DevTools but this
|
90
|
+
* enables it to be overridden, which is useful if you are consuming the trace
|
91
|
+
* engine outside of DevTools.
|
92
|
+
*/
|
93
|
+
insightTimeFormatters?: InsightTimeFormatters;
|
94
|
+
}
|
95
|
+
|
96
|
+
export interface InsightTimeFormatters {
|
97
|
+
milli: (x: Milli) => string;
|
86
98
|
}
|
87
99
|
|
88
100
|
export interface ResolveSourceMapParams {
|
@@ -3,6 +3,7 @@
|
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
5
|
import type * as Platform from '../../../core/platform/platform.js';
|
6
|
+
import type * as SDK from '../../../core/sdk/sdk.js';
|
6
7
|
import type * as Protocol from '../../../generated/protocol.js';
|
7
8
|
|
8
9
|
import type {Micro, Milli, Seconds, TraceWindowMicro} from './Timing.js';
|
@@ -207,7 +208,7 @@ export interface RunTask extends Complete {
|
|
207
208
|
name: Name.RUN_TASK;
|
208
209
|
}
|
209
210
|
export function isRunTask(event: Event): event is RunTask {
|
210
|
-
return event.name === Name.RUN_TASK;
|
211
|
+
return event.name === Name.RUN_TASK && event.ph === Phase.COMPLETE;
|
211
212
|
}
|
212
213
|
|
213
214
|
export interface FireIdleCallback extends Complete {
|
@@ -2072,7 +2073,7 @@ export function isEnd(event: Event): event is End {
|
|
2072
2073
|
}
|
2073
2074
|
|
2074
2075
|
export function isDispatch(event: Event): event is Dispatch {
|
2075
|
-
return event.name === 'EventDispatch';
|
2076
|
+
return event.name === 'EventDispatch' && event.ph === Phase.COMPLETE;
|
2076
2077
|
}
|
2077
2078
|
|
2078
2079
|
export function isInstant(event: Event): event is Instant {
|
@@ -2084,7 +2085,7 @@ export function isRendererEvent(event: Event): event is RendererEvent {
|
|
2084
2085
|
}
|
2085
2086
|
|
2086
2087
|
export function isFireIdleCallback(event: Event): event is FireIdleCallback {
|
2087
|
-
return event.name === 'FireIdleCallback';
|
2088
|
+
return event.name === 'FireIdleCallback' && event.ph === Phase.COMPLETE;
|
2088
2089
|
}
|
2089
2090
|
|
2090
2091
|
export function isSchedulePostMessage(event: Event): event is SchedulePostMessage {
|
@@ -2092,7 +2093,7 @@ export function isSchedulePostMessage(event: Event): event is SchedulePostMessag
|
|
2092
2093
|
}
|
2093
2094
|
|
2094
2095
|
export function isHandlePostMessage(event: Event): event is HandlePostMessage {
|
2095
|
-
return event.name === Name.HANDLE_POST_MESSAGE;
|
2096
|
+
return event.name === Name.HANDLE_POST_MESSAGE && event.ph === Phase.COMPLETE;
|
2096
2097
|
}
|
2097
2098
|
|
2098
2099
|
export function isUpdateCounters(event: Event): event is UpdateCounters {
|
@@ -2213,7 +2214,7 @@ export function isProfile(event: Event): event is Profile {
|
|
2213
2214
|
}
|
2214
2215
|
|
2215
2216
|
export function isSyntheticCpuProfile(event: Event): event is SyntheticCpuProfile {
|
2216
|
-
return event.name === Name.CPU_PROFILE;
|
2217
|
+
return event.name === Name.CPU_PROFILE && event.ph === Phase.COMPLETE;
|
2217
2218
|
}
|
2218
2219
|
|
2219
2220
|
export function isProfileChunk(event: Event): event is ProfileChunk {
|
@@ -2308,7 +2309,7 @@ export interface DidCommitSameDocumentNavigation extends Complete {
|
|
2308
2309
|
}
|
2309
2310
|
|
2310
2311
|
export function isDidCommitSameDocumentNavigation(event: Event): event is DidCommitSameDocumentNavigation {
|
2311
|
-
return event.name === 'RenderFrameHostImpl::DidCommitSameDocumentNavigation';
|
2312
|
+
return event.name === 'RenderFrameHostImpl::DidCommitSameDocumentNavigation' && event.ph === Phase.COMPLETE;
|
2312
2313
|
}
|
2313
2314
|
|
2314
2315
|
export function isMainFrameViewport(
|
@@ -2400,7 +2401,7 @@ export function isProfileCall(event: Event): event is SyntheticProfileCall {
|
|
2400
2401
|
return 'callFrame' in event;
|
2401
2402
|
}
|
2402
2403
|
|
2403
|
-
export interface Paint extends
|
2404
|
+
export interface Paint extends Event {
|
2404
2405
|
name: Name.PAINT;
|
2405
2406
|
args: Args&{
|
2406
2407
|
data: ArgsData & {
|
@@ -2444,7 +2445,7 @@ export interface PaintImage extends Complete {
|
|
2444
2445
|
};
|
2445
2446
|
}
|
2446
2447
|
export function isPaintImage(event: Event): event is PaintImage {
|
2447
|
-
return event.name === Name.PAINT_IMAGE;
|
2448
|
+
return event.name === Name.PAINT_IMAGE && event.ph === Phase.COMPLETE;
|
2448
2449
|
}
|
2449
2450
|
|
2450
2451
|
export interface ScrollLayer extends Complete {
|
@@ -2457,7 +2458,7 @@ export interface ScrollLayer extends Complete {
|
|
2457
2458
|
};
|
2458
2459
|
}
|
2459
2460
|
export function isScrollLayer(event: Event): event is ScrollLayer {
|
2460
|
-
return event.name === Name.SCROLL_LAYER;
|
2461
|
+
return event.name === Name.SCROLL_LAYER && event.ph === Phase.COMPLETE;
|
2461
2462
|
}
|
2462
2463
|
|
2463
2464
|
export interface SetLayerTreeId extends Instant {
|
@@ -2472,7 +2473,7 @@ export interface SetLayerTreeId extends Instant {
|
|
2472
2473
|
export function isSetLayerId(event: Event): event is SetLayerTreeId {
|
2473
2474
|
return event.name === Name.SET_LAYER_TREE_ID;
|
2474
2475
|
}
|
2475
|
-
export interface UpdateLayer extends
|
2476
|
+
export interface UpdateLayer extends Event {
|
2476
2477
|
name: Name.UPDATE_LAYER;
|
2477
2478
|
args: Args&{
|
2478
2479
|
layerId: number,
|
@@ -2571,7 +2572,7 @@ export interface FireAnimationFrame extends Complete {
|
|
2571
2572
|
}
|
2572
2573
|
|
2573
2574
|
export function isFireAnimationFrame(event: Event): event is FireAnimationFrame {
|
2574
|
-
return event.name === Name.FIRE_ANIMATION_FRAME;
|
2575
|
+
return event.name === Name.FIRE_ANIMATION_FRAME && event.ph === Phase.COMPLETE;
|
2575
2576
|
}
|
2576
2577
|
|
2577
2578
|
export interface RequestAnimationFrame extends Instant {
|
@@ -2611,7 +2612,7 @@ export interface TimerFire extends Complete {
|
|
2611
2612
|
};
|
2612
2613
|
}
|
2613
2614
|
export function isTimerFire(event: Event): event is TimerFire {
|
2614
|
-
return event.name === Name.TIMER_FIRE;
|
2615
|
+
return event.name === Name.TIMER_FIRE && event.ph === Phase.COMPLETE;
|
2615
2616
|
}
|
2616
2617
|
|
2617
2618
|
export interface RequestIdleCallback extends Instant {
|
@@ -2773,7 +2774,7 @@ export interface V8Compile extends Complete {
|
|
2773
2774
|
};
|
2774
2775
|
}
|
2775
2776
|
export function isV8Compile(event: Event): event is V8Compile {
|
2776
|
-
return event.name === Name.COMPILE;
|
2777
|
+
return event.name === Name.COMPILE && event.ph === Phase.COMPLETE;
|
2777
2778
|
}
|
2778
2779
|
|
2779
2780
|
export interface FunctionCall extends Complete {
|
@@ -2781,11 +2782,12 @@ export interface FunctionCall extends Complete {
|
|
2781
2782
|
args: Args&{
|
2782
2783
|
data?: Partial<CallFrame>& {
|
2783
2784
|
frame?: string,
|
2785
|
+
isolate?: number,
|
2784
2786
|
},
|
2785
2787
|
};
|
2786
2788
|
}
|
2787
2789
|
export function isFunctionCall(event: Event): event is FunctionCall {
|
2788
|
-
return event.name === Name.FUNCTION_CALL;
|
2790
|
+
return event.name === Name.FUNCTION_CALL && event.ph === Phase.COMPLETE;
|
2789
2791
|
}
|
2790
2792
|
|
2791
2793
|
export interface SchedulePostTaskCallback extends Instant {
|
@@ -2816,7 +2818,7 @@ export interface RunPostTaskCallback extends Complete {
|
|
2816
2818
|
};
|
2817
2819
|
}
|
2818
2820
|
export function isRunPostTaskCallback(event: Event): event is RunPostTaskCallback {
|
2819
|
-
return event.name === Name.RUN_POST_TASK_CALLBACK;
|
2821
|
+
return event.name === Name.RUN_POST_TASK_CALLBACK && event.ph === Phase.COMPLETE;
|
2820
2822
|
}
|
2821
2823
|
|
2822
2824
|
export interface AbortPostTaskCallback extends Complete {
|
@@ -2830,7 +2832,7 @@ export interface AbortPostTaskCallback extends Complete {
|
|
2830
2832
|
};
|
2831
2833
|
}
|
2832
2834
|
export function isAbortPostTaskCallback(event: Event): event is RunPostTaskCallback {
|
2833
|
-
return event.name === Name.ABORT_POST_TASK_CALLBACK;
|
2835
|
+
return event.name === Name.ABORT_POST_TASK_CALLBACK && event.ph === Phase.COMPLETE;
|
2834
2836
|
}
|
2835
2837
|
|
2836
2838
|
/**
|
@@ -2894,7 +2896,7 @@ export interface ParseAuthorStyleSheet extends Complete {
|
|
2894
2896
|
}
|
2895
2897
|
|
2896
2898
|
export function isParseAuthorStyleSheetEvent(event: Event): event is ParseAuthorStyleSheet {
|
2897
|
-
return event.name === Name.PARSE_AUTHOR_STYLE_SHEET;
|
2899
|
+
return event.name === Name.PARSE_AUTHOR_STYLE_SHEET && event.ph === Phase.COMPLETE;
|
2898
2900
|
}
|
2899
2901
|
|
2900
2902
|
/**
|
@@ -3177,75 +3179,51 @@ export interface LegacyLayerPaintEventPicture {
|
|
3177
3179
|
serializedPicture: string;
|
3178
3180
|
}
|
3179
3181
|
|
3180
|
-
|
3182
|
+
/** Same as `TraceEventTargetRundown` in `EnhancedTracesParser` */
|
3183
|
+
export interface RundownScriptCompiled extends Event {
|
3181
3184
|
cat: 'disabled-by-default-devtools.target-rundown';
|
3182
|
-
name: '
|
3185
|
+
name: SDK.EnhancedTracesParser.RundownScriptCompiled['name'];
|
3183
3186
|
args: Args&{
|
3184
|
-
data?:
|
3185
|
-
frame: Protocol.Page.FrameId,
|
3186
|
-
frameType: string,
|
3187
|
-
url: string,
|
3188
|
-
isolate: string,
|
3189
|
-
v8context: string,
|
3190
|
-
origin: string,
|
3191
|
-
scriptId: number,
|
3192
|
-
isDefault?: boolean,
|
3193
|
-
contextType?: string,
|
3194
|
-
},
|
3187
|
+
data?: SDK.EnhancedTracesParser.RundownScriptCompiled['args']['data'],
|
3195
3188
|
};
|
3196
3189
|
}
|
3197
3190
|
|
3198
|
-
export function
|
3199
|
-
return event.cat === 'disabled-by-default-devtools.target-rundown'
|
3191
|
+
export function isRundownScriptCompiled(event: Event): event is RundownScriptCompiled {
|
3192
|
+
return event.cat === 'disabled-by-default-devtools.target-rundown';
|
3200
3193
|
}
|
3201
3194
|
|
3202
|
-
|
3195
|
+
/** Same as `TraceEventScriptRundown` in `EnhancedTracesParser` */
|
3196
|
+
export interface RundownScript extends Event {
|
3203
3197
|
cat: 'disabled-by-default-devtools.v8-source-rundown';
|
3204
|
-
name: '
|
3198
|
+
name: SDK.EnhancedTracesParser.RundownScript['name'];
|
3205
3199
|
args: Args&{
|
3206
|
-
data:
|
3207
|
-
isolate: string,
|
3208
|
-
executionContextId: Protocol.Runtime.ExecutionContextId,
|
3209
|
-
scriptId: number,
|
3210
|
-
hash: string,
|
3211
|
-
isModule: boolean,
|
3212
|
-
hasSourceUrl: boolean,
|
3213
|
-
url?: string,
|
3214
|
-
sourceUrl?: string,
|
3215
|
-
sourceMapUrl?: string,
|
3216
|
-
sourceMapUrlElided?: boolean,
|
3217
|
-
},
|
3200
|
+
data: SDK.EnhancedTracesParser.RundownScript['args']['data'],
|
3218
3201
|
};
|
3219
3202
|
}
|
3220
3203
|
|
3221
|
-
export function
|
3204
|
+
export function isRundownScript(event: Event): event is RundownScript {
|
3222
3205
|
return event.cat === 'disabled-by-default-devtools.v8-source-rundown' && event.name === 'ScriptCatchup';
|
3223
3206
|
}
|
3224
3207
|
|
3225
|
-
|
3208
|
+
/** Same as `TraceEventScriptRundownSource` in `EnhancedTracesParser` */
|
3209
|
+
export interface RundownScriptSource extends Event {
|
3226
3210
|
cat: 'disabled-by-default-devtools.v8-source-rundown-sources';
|
3227
3211
|
name: 'ScriptCatchup';
|
3228
3212
|
args: Args&{
|
3229
|
-
data:
|
3230
|
-
isolate: string,
|
3231
|
-
scriptId: number,
|
3232
|
-
length: number,
|
3233
|
-
sourceText: string,
|
3234
|
-
},
|
3213
|
+
data: SDK.EnhancedTracesParser.RundownScriptSource['args']['data'],
|
3235
3214
|
};
|
3236
3215
|
}
|
3237
3216
|
|
3238
|
-
export function
|
3239
|
-
event is V8SourceRundownSourcesScriptCatchupEvent {
|
3217
|
+
export function isRundownScriptSource(event: Event): event is RundownScriptSource {
|
3240
3218
|
return event.cat === 'disabled-by-default-devtools.v8-source-rundown-sources' && event.name === 'ScriptCatchup';
|
3241
3219
|
}
|
3242
3220
|
|
3243
|
-
export interface
|
3221
|
+
export interface RundownScriptSourceLarge extends Event {
|
3244
3222
|
cat: 'disabled-by-default-devtools.v8-source-rundown-sources';
|
3245
3223
|
name: 'LargeScriptCatchup';
|
3246
3224
|
args: Args&{
|
3247
3225
|
data: {
|
3248
|
-
isolate:
|
3226
|
+
isolate: number,
|
3249
3227
|
scriptId: number,
|
3250
3228
|
splitIndex: number,
|
3251
3229
|
splitCount: number,
|
@@ -3254,23 +3232,22 @@ export interface V8SourceRundownSourcesLargeScriptCatchupEvent extends Event {
|
|
3254
3232
|
};
|
3255
3233
|
}
|
3256
3234
|
|
3257
|
-
export function
|
3258
|
-
event is V8SourceRundownSourcesLargeScriptCatchupEvent {
|
3235
|
+
export function isRundownScriptSourceLarge(event: Event): event is RundownScriptSourceLarge {
|
3259
3236
|
return event.cat === 'disabled-by-default-devtools.v8-source-rundown-sources' && event.name === 'LargeScriptCatchup';
|
3260
3237
|
}
|
3261
3238
|
|
3262
|
-
export interface
|
3239
|
+
export interface RundownScriptStub extends Event {
|
3263
3240
|
cat: 'disabled-by-default-devtools.v8-source-rundown-sources';
|
3264
3241
|
name: 'StubScriptCatchup';
|
3265
3242
|
args: Args&{
|
3266
3243
|
data: {
|
3267
|
-
isolate:
|
3244
|
+
isolate: number,
|
3268
3245
|
scriptId: number,
|
3269
3246
|
},
|
3270
3247
|
};
|
3271
3248
|
}
|
3272
3249
|
|
3273
|
-
export function
|
3274
|
-
|
3250
|
+
export function isAnyScriptSourceEvent(event: Event): event is RundownScriptSource|RundownScriptSourceLarge|
|
3251
|
+
RundownScriptStub {
|
3275
3252
|
return event.cat === 'disabled-by-default-devtools.v8-source-rundown-sources';
|
3276
3253
|
}
|
@@ -132,10 +132,6 @@ const UIStringsNotTranslate = {
|
|
132
132
|
* @description Placeholder text for the chat UI input.
|
133
133
|
*/
|
134
134
|
inputPlaceholderForFile: 'Ask a question about the selected file',
|
135
|
-
/**
|
136
|
-
* @description Placeholder text for the chat UI input.
|
137
|
-
*/
|
138
|
-
inputPlaceholderForPerformance: 'Ask a question about the selected item and its call tree',
|
139
135
|
/**
|
140
136
|
* @description Placeholder text for the chat UI input.
|
141
137
|
*/
|
@@ -152,18 +148,6 @@ const UIStringsNotTranslate = {
|
|
152
148
|
* @description Placeholder text for the chat UI input when there is no context selected.
|
153
149
|
*/
|
154
150
|
inputPlaceholderForFileNoContext: 'Select a file to ask a question',
|
155
|
-
/**
|
156
|
-
* @description Placeholder text for the chat UI input when there is no context selected.
|
157
|
-
*/
|
158
|
-
inputPlaceholderForPerformanceNoContext: 'Select an item to ask a question',
|
159
|
-
/**
|
160
|
-
* @description Placeholder text for the chat UI input.
|
161
|
-
*/
|
162
|
-
inputPlaceholderForPerformanceInsights: 'Ask a question about the selected performance insight',
|
163
|
-
/**
|
164
|
-
* @description Placeholder text for the chat UI input.
|
165
|
-
*/
|
166
|
-
inputPlaceholderForPerformanceInsightsNoContext: 'Select a performance insight to ask a question',
|
167
151
|
/**
|
168
152
|
* @description Placeholder text for the chat UI input.
|
169
153
|
*/
|
@@ -171,7 +155,7 @@ const UIStringsNotTranslate = {
|
|
171
155
|
/**
|
172
156
|
*@description Placeholder text for the chat UI input.
|
173
157
|
*/
|
174
|
-
inputPlaceholderForPerformanceTraceNoContext: '
|
158
|
+
inputPlaceholderForPerformanceTraceNoContext: 'Record or select a performance trace to ask a question',
|
175
159
|
/**
|
176
160
|
* @description Disclaimer text right after the chat input.
|
177
161
|
*/
|
@@ -236,7 +220,7 @@ function selectedElementFilter(maybeNode: SDK.DOMModel.DOMNode|null): SDK.DOMMod
|
|
236
220
|
|
237
221
|
async function getEmptyStateSuggestions(
|
238
222
|
context: AiAssistanceModel.ConversationContext<unknown>|null,
|
239
|
-
|
223
|
+
conversation?: AiAssistanceModel.Conversation): Promise<AiAssistanceModel.ConversationSuggestion[]> {
|
240
224
|
if (context) {
|
241
225
|
const specialSuggestions = await context.getSuggestions();
|
242
226
|
|
@@ -245,11 +229,11 @@ async function getEmptyStateSuggestions(
|
|
245
229
|
}
|
246
230
|
}
|
247
231
|
|
248
|
-
if (!
|
232
|
+
if (!conversation?.type || conversation.isReadOnly) {
|
249
233
|
return [];
|
250
234
|
}
|
251
235
|
|
252
|
-
switch (
|
236
|
+
switch (conversation.type) {
|
253
237
|
case AiAssistanceModel.ConversationType.STYLING:
|
254
238
|
return [
|
255
239
|
{title: 'What can you help me with?', jslogContext: 'styling-default'},
|
@@ -268,28 +252,14 @@ async function getEmptyStateSuggestions(
|
|
268
252
|
{title: 'Are there any security headers present?', jslogContext: 'network-default'},
|
269
253
|
{title: 'Why is the request failing?', jslogContext: 'network-default'},
|
270
254
|
];
|
271
|
-
case AiAssistanceModel.ConversationType.
|
255
|
+
case AiAssistanceModel.ConversationType.PERFORMANCE: {
|
272
256
|
return [
|
273
257
|
{title: 'What performance issues exist with my page?', jslogContext: 'performance-default'},
|
274
258
|
];
|
275
|
-
case AiAssistanceModel.ConversationType.PERFORMANCE_INSIGHT:
|
276
|
-
case AiAssistanceModel.ConversationType.PERFORMANCE_CALL_TREE: {
|
277
|
-
const focus = context?.getItem() as AiAssistanceModel.AgentFocus | null;
|
278
|
-
if (focus?.data.type === 'call-tree') {
|
279
|
-
return [
|
280
|
-
{title: 'What\'s the purpose of this work?', jslogContext: 'performance-default'},
|
281
|
-
{title: 'Where is time being spent?', jslogContext: 'performance-default'},
|
282
|
-
{title: 'How can I optimize this?', jslogContext: 'performance-default'},
|
283
|
-
];
|
284
|
-
}
|
285
|
-
|
286
|
-
return [
|
287
|
-
{title: 'Help me optimize my page load performance', jslogContext: 'performance-insights-default'},
|
288
|
-
];
|
289
259
|
}
|
290
260
|
|
291
261
|
default:
|
292
|
-
Platform.assertNever(
|
262
|
+
Platform.assertNever(conversation.type, 'Unknown conversation type');
|
293
263
|
}
|
294
264
|
}
|
295
265
|
|
@@ -619,15 +589,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
619
589
|
const isSourcesPanelVisible = viewManager.isViewVisible('sources');
|
620
590
|
const isPerformancePanelVisible = viewManager.isViewVisible('timeline');
|
621
591
|
|
622
|
-
// Check if the user has an insight expanded in the performance panel sidebar.
|
623
|
-
// If they have, we default to the Insights agent; otherwise we fallback to
|
624
|
-
// the regular Performance agent.
|
625
|
-
// Note that we do not listen to this flavor changing; this code is here to
|
626
|
-
// ensure that by default we do not pick the Insights agent if the user has
|
627
|
-
// just imported a trace and not done anything else. It doesn't make sense
|
628
|
-
// to select the Insights AI agent in that case.
|
629
|
-
const userHasExpandedPerfInsight =
|
630
|
-
Boolean(UI.Context.Context.instance().flavor(TimelinePanel.TimelinePanel.SelectedInsight));
|
631
592
|
let targetConversationType: AiAssistanceModel.ConversationType|undefined = undefined;
|
632
593
|
if (isElementsPanelVisible && hostConfig.devToolsFreestyler?.enabled) {
|
633
594
|
targetConversationType = AiAssistanceModel.ConversationType.STYLING;
|
@@ -635,12 +596,8 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
635
596
|
targetConversationType = AiAssistanceModel.ConversationType.NETWORK;
|
636
597
|
} else if (isSourcesPanelVisible && hostConfig.devToolsAiAssistanceFileAgent?.enabled) {
|
637
598
|
targetConversationType = AiAssistanceModel.ConversationType.FILE;
|
638
|
-
} else if (
|
639
|
-
isPerformancePanelVisible && hostConfig.devToolsAiAssistancePerformanceAgent?.enabled &&
|
640
|
-
hostConfig.devToolsAiAssistancePerformanceAgent?.insightsEnabled && userHasExpandedPerfInsight) {
|
641
|
-
targetConversationType = AiAssistanceModel.ConversationType.PERFORMANCE_INSIGHT;
|
642
599
|
} else if (isPerformancePanelVisible && hostConfig.devToolsAiAssistancePerformanceAgent?.enabled) {
|
643
|
-
targetConversationType = AiAssistanceModel.ConversationType.
|
600
|
+
targetConversationType = AiAssistanceModel.ConversationType.PERFORMANCE;
|
644
601
|
}
|
645
602
|
|
646
603
|
if (this.#conversation?.type === targetConversationType) {
|
@@ -845,25 +802,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
845
802
|
this.#selectedPerformanceTrace =
|
846
803
|
Boolean(ev.data) ? new AiAssistanceModel.PerformanceTraceContext(ev.data) : null;
|
847
804
|
|
848
|
-
let conversationType: AiAssistanceModel.ConversationType|undefined;
|
849
|
-
if (ev.data) {
|
850
|
-
if (ev.data.data.type === 'full') {
|
851
|
-
conversationType = AiAssistanceModel.ConversationType.PERFORMANCE_FULL;
|
852
|
-
} else if (ev.data.data.type === 'insight') {
|
853
|
-
conversationType = AiAssistanceModel.ConversationType.PERFORMANCE_INSIGHT;
|
854
|
-
} else if (ev.data.data.type === 'call-tree') {
|
855
|
-
conversationType = AiAssistanceModel.ConversationType.PERFORMANCE_CALL_TREE;
|
856
|
-
} else {
|
857
|
-
Platform.assertNever(ev.data.data, 'Unknown agent focus');
|
858
|
-
}
|
859
|
-
}
|
860
|
-
|
861
|
-
let agent = this.#conversationAgent;
|
862
|
-
if (conversationType && agent instanceof AiAssistanceModel.PerformanceAgent &&
|
863
|
-
agent.getConversationType() !== conversationType) {
|
864
|
-
agent = this.#conversationHandler.createAgent(conversationType);
|
865
|
-
}
|
866
|
-
|
867
805
|
this.#updateConversationState({agent: this.#conversationAgent});
|
868
806
|
};
|
869
807
|
|
@@ -898,7 +836,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
898
836
|
}
|
899
837
|
|
900
838
|
override async performUpdate(): Promise<void> {
|
901
|
-
const emptyStateSuggestions = await getEmptyStateSuggestions(this.#selectedContext, this.#conversation
|
839
|
+
const emptyStateSuggestions = await getEmptyStateSuggestions(this.#selectedContext, this.#conversation);
|
902
840
|
|
903
841
|
this.view(
|
904
842
|
{
|
@@ -1039,21 +977,16 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
1039
977
|
case AiAssistanceModel.ConversationType.NETWORK:
|
1040
978
|
return this.#selectedContext ? lockedString(UIStringsNotTranslate.inputPlaceholderForNetwork) :
|
1041
979
|
lockedString(UIStringsNotTranslate.inputPlaceholderForNetworkNoContext);
|
1042
|
-
case AiAssistanceModel.ConversationType.
|
980
|
+
case AiAssistanceModel.ConversationType.PERFORMANCE: {
|
1043
981
|
const perfPanel = UI.Context.Context.instance().flavor(TimelinePanel.TimelinePanel.TimelinePanel);
|
1044
982
|
if (perfPanel?.hasActiveTrace()) {
|
1045
|
-
return this.#selectedContext ?
|
1046
|
-
|
983
|
+
return this.#selectedContext ?
|
984
|
+
lockedString(UIStringsNotTranslate.inputPlaceholderForPerformanceTrace) :
|
985
|
+
lockedString(UIStringsNotTranslate.inputPlaceholderForPerformanceTraceNoContext);
|
1047
986
|
}
|
987
|
+
|
1048
988
|
return lockedString(UIStringsNotTranslate.inputPlaceholderForPerformanceWithNoRecording);
|
1049
989
|
}
|
1050
|
-
case AiAssistanceModel.ConversationType.PERFORMANCE_INSIGHT:
|
1051
|
-
return this.#selectedContext ?
|
1052
|
-
lockedString(UIStringsNotTranslate.inputPlaceholderForPerformanceInsights) :
|
1053
|
-
lockedString(UIStringsNotTranslate.inputPlaceholderForPerformanceInsightsNoContext);
|
1054
|
-
case AiAssistanceModel.ConversationType.PERFORMANCE_FULL:
|
1055
|
-
return this.#selectedContext ? lockedString(UIStringsNotTranslate.inputPlaceholderForPerformanceTrace) :
|
1056
|
-
lockedString(UIStringsNotTranslate.inputPlaceholderForPerformanceTraceNoContext);
|
1057
990
|
}
|
1058
991
|
}
|
1059
992
|
|
@@ -1084,9 +1017,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
1084
1017
|
|
1085
1018
|
// It is deliberate that both Performance agents use the same disclaimer
|
1086
1019
|
// text and this has been approved by Privacy.
|
1087
|
-
case AiAssistanceModel.ConversationType.
|
1088
|
-
case AiAssistanceModel.ConversationType.PERFORMANCE_CALL_TREE:
|
1089
|
-
case AiAssistanceModel.ConversationType.PERFORMANCE_INSIGHT:
|
1020
|
+
case AiAssistanceModel.ConversationType.PERFORMANCE:
|
1090
1021
|
if (noLogging) {
|
1091
1022
|
return lockedString(UIStringsNotTranslate.inputDisclaimerForPerformanceEnterpriseNoLogging);
|
1092
1023
|
}
|
@@ -1121,18 +1052,14 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
1121
1052
|
}
|
1122
1053
|
if (context instanceof AiAssistanceModel.PerformanceTraceContext) {
|
1123
1054
|
const focus = context.getItem().data;
|
1124
|
-
if (focus.
|
1125
|
-
return;
|
1126
|
-
}
|
1127
|
-
if (focus.type === 'call-tree') {
|
1055
|
+
if (focus.callTree) {
|
1128
1056
|
const event = focus.callTree.selectedNode?.event ?? focus.callTree.rootNode.event;
|
1129
1057
|
const trace = new SDK.TraceObject.RevealableEvent(event);
|
1130
1058
|
return Common.Revealer.reveal(trace);
|
1131
1059
|
}
|
1132
|
-
if (focus.
|
1060
|
+
if (focus.insight) {
|
1133
1061
|
return Common.Revealer.reveal(focus.insight);
|
1134
1062
|
}
|
1135
|
-
Platform.assertNever(focus, 'Unknown agent focus');
|
1136
1063
|
}
|
1137
1064
|
// Node picker is using linkifier.
|
1138
1065
|
}
|
@@ -1169,17 +1096,17 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
1169
1096
|
}
|
1170
1097
|
case 'drjones.performance-panel-context': {
|
1171
1098
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiAssistanceOpenedFromPerformancePanelCallTree);
|
1172
|
-
targetConversationType = AiAssistanceModel.ConversationType.
|
1099
|
+
targetConversationType = AiAssistanceModel.ConversationType.PERFORMANCE;
|
1173
1100
|
break;
|
1174
1101
|
}
|
1175
1102
|
case 'drjones.performance-insight-context': {
|
1176
1103
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiAssistanceOpenedFromPerformanceInsight);
|
1177
|
-
targetConversationType = AiAssistanceModel.ConversationType.
|
1104
|
+
targetConversationType = AiAssistanceModel.ConversationType.PERFORMANCE;
|
1178
1105
|
break;
|
1179
1106
|
}
|
1180
1107
|
case 'drjones.performance-panel-full-context': {
|
1181
1108
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiAssistanceOpenedFromPerformanceFullButton);
|
1182
|
-
targetConversationType = AiAssistanceModel.ConversationType.
|
1109
|
+
targetConversationType = AiAssistanceModel.ConversationType.PERFORMANCE;
|
1183
1110
|
break;
|
1184
1111
|
}
|
1185
1112
|
case 'drjones.sources-floating-button': {
|
@@ -1200,10 +1127,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
1200
1127
|
|
1201
1128
|
let agent = this.#conversationAgent;
|
1202
1129
|
if (!this.#conversation || !this.#conversationAgent || this.#conversation.type !== targetConversationType ||
|
1203
|
-
this.#conversation?.isEmpty
|
1204
|
-
targetConversationType === AiAssistanceModel.ConversationType.PERFORMANCE_CALL_TREE ||
|
1205
|
-
(agent instanceof AiAssistanceModel.PerformanceAgent &&
|
1206
|
-
agent.getConversationType() !== targetConversationType)) {
|
1130
|
+
this.#conversation?.isEmpty) {
|
1207
1131
|
agent = this.#conversationHandler.createAgent(targetConversationType, this.#changeManager);
|
1208
1132
|
}
|
1209
1133
|
this.#updateConversationState({agent});
|
@@ -1448,9 +1372,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
1448
1372
|
case AiAssistanceModel.ConversationType.NETWORK:
|
1449
1373
|
context = this.#selectedRequest;
|
1450
1374
|
break;
|
1451
|
-
case AiAssistanceModel.ConversationType.
|
1452
|
-
case AiAssistanceModel.ConversationType.PERFORMANCE_CALL_TREE:
|
1453
|
-
case AiAssistanceModel.ConversationType.PERFORMANCE_INSIGHT:
|
1375
|
+
case AiAssistanceModel.ConversationType.PERFORMANCE:
|
1454
1376
|
context = this.#selectedPerformanceTrace;
|
1455
1377
|
break;
|
1456
1378
|
}
|
@@ -487,7 +487,6 @@ export class Section {
|
|
487
487
|
this.routerView = new ApplicationComponents.ServiceWorkerRouterView.ServiceWorkerRouterView();
|
488
488
|
this.networkRequests = new Buttons.Button.Button();
|
489
489
|
this.networkRequests.data = {
|
490
|
-
iconName: 'bottom-panel-open',
|
491
490
|
variant: Buttons.Button.Variant.TEXT,
|
492
491
|
title: i18nString(UIStrings.networkRequests),
|
493
492
|
jslogContext: 'show-network-requests',
|