chrome-devtools-frontend 1.0.1512147 → 1.0.1513662
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/cookbook/release_management.md +15 -13
- package/docs/get_the_code.md +114 -35
- package/front_end/Images/src/ai-explorer-badge.svg +114 -0
- package/front_end/Images/src/code-whisperer-badge.svg +166 -0
- package/front_end/Images/src/devtools-user-badge.svg +129 -0
- package/front_end/Images/src/dom-detective-badge.svg +136 -0
- package/front_end/Images/src/speedster-badge.svg +166 -0
- package/front_end/core/common/Color.ts +40 -44
- package/front_end/core/common/Console.ts +4 -4
- package/front_end/core/common/ParsedURL.ts +14 -14
- package/front_end/core/common/ResourceType.ts +20 -20
- package/front_end/core/common/SegmentedRange.ts +13 -14
- package/front_end/core/common/Settings.ts +4 -4
- package/front_end/core/common/StringOutputStream.ts +4 -4
- package/front_end/core/host/GdpClient.ts +76 -2
- package/front_end/core/host/InspectorFrontendHost.ts +4 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
- package/front_end/core/host/ResourceLoader.ts +2 -2
- package/front_end/core/host/UserMetrics.ts +0 -2
- package/front_end/core/i18n/NumberFormatter.ts +7 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +9 -9
- package/front_end/core/root/Runtime.ts +5 -2
- package/front_end/core/sdk/AccessibilityModel.ts +48 -48
- package/front_end/core/sdk/AnimationModel.ts +78 -79
- package/front_end/core/sdk/CPUProfilerModel.ts +5 -5
- package/front_end/core/sdk/CPUThrottlingManager.ts +17 -17
- package/front_end/core/sdk/CSSMatchedStyles.ts +44 -44
- package/front_end/core/sdk/CSSMedia.ts +22 -22
- package/front_end/core/sdk/CSSModel.ts +4 -4
- package/front_end/core/sdk/CSSProperty.ts +9 -9
- package/front_end/core/sdk/CSSPropertyParser.ts +1 -2
- package/front_end/core/sdk/CSSRule.ts +3 -3
- package/front_end/core/sdk/CSSStyleDeclaration.ts +27 -28
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +13 -13
- package/front_end/core/sdk/CategorizedBreakpoint.ts +4 -4
- package/front_end/core/sdk/ChildTargetManager.ts +6 -6
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +4 -4
- package/front_end/core/sdk/ConsoleModel.ts +24 -24
- package/front_end/core/sdk/Cookie.ts +16 -16
- package/front_end/core/sdk/CookieParser.ts +6 -6
- package/front_end/core/sdk/DOMDebuggerModel.ts +88 -89
- package/front_end/core/sdk/DOMModel.ts +113 -113
- package/front_end/core/sdk/DebuggerModel.ts +102 -103
- package/front_end/core/sdk/EmulationModel.ts +6 -6
- package/front_end/core/sdk/EventBreakpointsModel.ts +5 -5
- package/front_end/core/sdk/HeapProfilerModel.ts +5 -5
- package/front_end/core/sdk/IsolateManager.ts +26 -26
- package/front_end/core/sdk/LayerTreeBase.ts +29 -30
- package/front_end/core/sdk/OverlayModel.ts +6 -6
- package/front_end/core/sdk/Resource.ts +43 -43
- package/front_end/core/sdk/ResourceTreeModel.ts +58 -61
- package/front_end/core/sdk/RuntimeModel.ts +12 -13
- package/front_end/core/sdk/SDKModel.ts +3 -3
- package/front_end/core/sdk/Script.ts +17 -17
- package/front_end/core/sdk/SecurityOriginManager.ts +14 -14
- package/front_end/core/sdk/ServerTiming.ts +2 -2
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +15 -15
- package/front_end/core/sdk/ServiceWorkerManager.ts +19 -24
- package/front_end/core/sdk/SourceMap.ts +10 -10
- package/front_end/core/sdk/StorageKeyManager.ts +12 -12
- package/front_end/core/sdk/Target.ts +33 -34
- package/front_end/core/sdk/TargetManager.ts +20 -20
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +8 -8
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +7 -7
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +7 -7
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +24 -24
- package/front_end/entrypoints/main/GlobalAiButton.ts +3 -3
- package/front_end/entrypoints/main/MainImpl.ts +16 -14
- package/front_end/entrypoints/main/main-meta.ts +1 -2
- package/front_end/generated/InspectorBackendCommands.js +3 -2
- package/front_end/generated/SupportedCSSProperties.js +20 -0
- 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 +20 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +18 -35
- package/front_end/models/ai_assistance/ai_assistance.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +7 -6
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +246 -119
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +187 -73
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +106 -100
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +20 -27
- package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +151 -0
- package/front_end/models/badges/AiExplorerBadge.ts +21 -0
- package/front_end/models/badges/Badge.ts +10 -9
- package/front_end/models/badges/CodeWhispererBadge.ts +21 -0
- package/front_end/models/badges/DOMDetectiveBadge.ts +21 -0
- package/front_end/models/badges/SpeedsterBadge.ts +7 -2
- package/front_end/models/badges/StarterBadge.ts +6 -1
- package/front_end/models/badges/UserBadges.ts +61 -9
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +6 -6
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +18 -18
- package/front_end/models/bindings/FileUtils.ts +15 -15
- package/front_end/models/bindings/ResourceScriptMapping.ts +14 -14
- package/front_end/models/elements/ElementUpdateRecord.ts +11 -11
- package/front_end/models/emulation/DeviceModeModel.ts +123 -131
- package/front_end/models/emulation/EmulatedDevices.ts +22 -22
- package/front_end/models/extensions/ExtensionPanel.ts +24 -24
- package/front_end/models/extensions/ExtensionServer.ts +4 -4
- package/front_end/models/javascript_metadata/NativeFunctions.js +14 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +18 -19
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +13 -13
- package/front_end/models/trace/EventsSerializer.ts +5 -5
- package/front_end/models/trace/LanternComputationData.ts +10 -10
- package/front_end/models/trace/ModelImpl.ts +32 -54
- package/front_end/models/trace/Processor.ts +28 -30
- package/front_end/models/trace/extras/FilmStrip.ts +6 -6
- package/front_end/models/trace/extras/StackTraceForEvent.ts +22 -25
- package/front_end/models/trace/extras/ThirdParties.ts +16 -17
- package/front_end/models/trace/extras/TraceFilter.ts +1 -1
- package/front_end/models/trace/handlers/Threads.ts +10 -10
- package/front_end/models/trace/handlers/helpers.ts +9 -9
- package/front_end/models/trace/handlers/types.ts +3 -3
- package/front_end/models/trace/insights/CLSCulprits.ts +12 -14
- package/front_end/models/trace/insights/Cache.ts +8 -4
- package/front_end/models/trace/insights/DOMSize.ts +8 -5
- package/front_end/models/trace/insights/DocumentLatency.ts +2 -2
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +3 -3
- package/front_end/models/trace/insights/FontDisplay.ts +3 -4
- package/front_end/models/trace/insights/ForcedReflow.ts +3 -3
- package/front_end/models/trace/insights/INPBreakdown.ts +2 -2
- package/front_end/models/trace/insights/ImageDelivery.ts +11 -11
- package/front_end/models/trace/insights/LCPBreakdown.ts +4 -4
- package/front_end/models/trace/insights/LCPDiscovery.ts +4 -4
- package/front_end/models/trace/insights/LegacyJavaScript.ts +2 -2
- package/front_end/models/trace/insights/ModernHTTP.ts +4 -5
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +12 -12
- package/front_end/models/trace/insights/RenderBlocking.ts +9 -10
- package/front_end/models/trace/insights/SlowCSSSelector.ts +2 -2
- package/front_end/models/trace/insights/ThirdParties.ts +4 -5
- package/front_end/models/trace/insights/Viewport.ts +8 -5
- package/front_end/models/trace/insights/types.ts +1 -0
- package/front_end/models/trace/lantern/testing/MetricTestUtils.ts +10 -10
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +52 -52
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +8 -8
- package/front_end/panels/animation/AnimationTimeline.ts +5 -5
- package/front_end/panels/animation/AnimationUI.ts +22 -23
- package/front_end/panels/application/ApplicationPanelSidebar.ts +12 -12
- package/front_end/panels/application/DOMStorageModel.ts +23 -23
- package/front_end/panels/application/ExtensionStorageModel.ts +31 -31
- package/front_end/panels/application/IndexedDBModel.ts +1 -0
- package/front_end/panels/application/PreloadingTreeElement.ts +8 -8
- package/front_end/panels/application/ServiceWorkersView.ts +0 -53
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +2 -2
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -2
- package/front_end/panels/common/BadgeNotification.ts +140 -10
- package/front_end/panels/common/GdpSignUpDialog.ts +5 -0
- package/front_end/panels/common/badgeNotification.css +30 -9
- package/front_end/panels/console/ConsoleContextSelector.ts +9 -9
- package/front_end/panels/console/ConsolePrompt.ts +8 -5
- package/front_end/panels/console/ConsoleView.ts +13 -13
- package/front_end/panels/console/ConsoleViewport.ts +29 -29
- package/front_end/panels/coverage/CoverageModel.ts +22 -22
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -1
- package/front_end/panels/elements/ComputedStyleModel.ts +17 -18
- package/front_end/panels/elements/DOMPath.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +13 -13
- package/front_end/panels/elements/ElementsTreeElement.ts +30 -18
- package/front_end/panels/elements/ElementsTreeOutline.ts +44 -48
- package/front_end/panels/elements/ShortcutTreeElement.ts +4 -4
- package/front_end/panels/elements/StylePropertiesSection.ts +7 -4
- package/front_end/panels/elements/StylePropertyTreeElement.ts +54 -50
- package/front_end/panels/elements/StylesSidebarPane.ts +19 -19
- package/front_end/panels/emulation/DeviceModeToolbar.ts +7 -7
- package/front_end/panels/emulation/DeviceModeView.ts +6 -6
- package/front_end/panels/emulation/MediaQueryInspector.ts +18 -18
- package/front_end/panels/event_listeners/EventListenersView.ts +13 -14
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +3 -3
- package/front_end/panels/layer_viewer/LayerViewHost.ts +13 -13
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +9 -10
- package/front_end/panels/layer_viewer/TransformController.ts +34 -36
- package/front_end/panels/layers/LayerTreeModel.ts +41 -40
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +13 -13
- package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -7
- package/front_end/panels/media/PlayerMessagesView.ts +5 -5
- package/front_end/panels/media/TickingFlameChart.ts +24 -24
- package/front_end/panels/media/TickingFlameChartHelpers.ts +32 -32
- package/front_end/panels/network/NetworkItemView.ts +4 -4
- package/front_end/panels/network/NetworkLogViewColumns.ts +29 -29
- package/front_end/panels/network/NetworkPanel.ts +8 -5
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +10 -10
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +3 -3
- package/front_end/panels/profiler/HeapProfileView.ts +1 -1
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +3 -4
- package/front_end/panels/profiler/ProfileHeader.ts +25 -25
- package/front_end/panels/profiler/ProfileLauncherView.ts +5 -6
- package/front_end/panels/recorder/components/ReplaySection.ts +3 -1
- package/front_end/panels/security/OriginTreeElement.ts +8 -8
- package/front_end/panels/security/SecurityPanel.ts +5 -5
- package/front_end/panels/settings/SettingsScreen.ts +18 -18
- package/front_end/panels/settings/components/SyncSection.ts +26 -8
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +3 -0
- package/front_end/panels/sources/DebuggerPausedMessage.ts +8 -9
- package/front_end/panels/sources/NavigatorView.ts +43 -46
- package/front_end/panels/sources/SourcesPanel.ts +35 -35
- package/front_end/panels/sources/SourcesView.ts +13 -13
- package/front_end/panels/sources/TabbedEditorContainer.ts +19 -22
- package/front_end/panels/sources/UISourceCodeFrame.ts +4 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +34 -36
- package/front_end/panels/timeline/AnimationsTrackAppender.ts +3 -3
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +8 -8
- package/front_end/panels/timeline/CountersGraph.ts +16 -16
- package/front_end/panels/timeline/EntriesFilter.ts +4 -3
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +3 -3
- package/front_end/panels/timeline/GPUTrackAppender.ts +3 -3
- package/front_end/panels/timeline/Initiators.ts +10 -10
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +5 -5
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +7 -7
- package/front_end/panels/timeline/ModificationsManager.ts +8 -15
- package/front_end/panels/timeline/TargetForEvent.ts +2 -2
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -1
- package/front_end/panels/timeline/ThreadAppender.ts +13 -13
- package/front_end/panels/timeline/TimelineDetailsView.ts +6 -14
- package/front_end/panels/timeline/TimelineEventOverview.ts +27 -26
- package/front_end/panels/timeline/TimelineFilters.ts +5 -5
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +54 -53
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +34 -34
- package/front_end/panels/timeline/TimelineFlameChartView.ts +18 -31
- package/front_end/panels/timeline/TimelineHistoryManager.ts +17 -18
- package/front_end/panels/timeline/TimelineMiniMap.ts +6 -6
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +6 -6
- package/front_end/panels/timeline/TimelinePanel.ts +73 -68
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +7 -5
- package/front_end/panels/timeline/TimelineTreeView.ts +10 -10
- package/front_end/panels/timeline/TimelineUIUtils.ts +47 -46
- package/front_end/panels/timeline/TimingsTrackAppender.ts +12 -12
- package/front_end/panels/timeline/TracingLayerTree.ts +43 -43
- package/front_end/panels/timeline/TrackConfigBanner.ts +6 -6
- package/front_end/panels/timeline/TrackConfiguration.ts +1 -1
- package/front_end/panels/timeline/components/DetailsView.ts +4 -4
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +12 -21
- package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -1
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +5 -5
- package/front_end/panels/timeline/components/Sidebar.ts +4 -14
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +13 -36
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +21 -19
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
- package/front_end/panels/timeline/components/insights/Cache.ts +4 -0
- package/front_end/panels/timeline/components/insights/DOMSize.ts +5 -1
- package/front_end/panels/timeline/components/insights/Helpers.ts +19 -0
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/panels/timeline/components/insights/Viewport.ts +4 -0
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
- package/front_end/panels/timeline/utils/AICallTree.ts +11 -11
- package/front_end/panels/timeline/utils/AIContext.ts +17 -19
- package/front_end/panels/timeline/utils/EntityMapper.ts +6 -5
- package/front_end/panels/timeline/utils/EntryName.ts +2 -2
- package/front_end/panels/timeline/utils/EntryNodes.ts +5 -5
- package/front_end/panels/timeline/utils/EntryStyles.ts +4 -4
- package/front_end/panels/timeline/utils/FreshRecording.ts +3 -3
- package/front_end/panels/timeline/utils/Helpers.ts +0 -18
- package/front_end/panels/timeline/utils/InsightAIContext.ts +6 -6
- package/front_end/panels/timeline/utils/SourceMapsResolver.ts +7 -7
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +1 -1
- package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
- package/front_end/third_party/json5/rebuild.sh +1 -1
- package/front_end/third_party/legacy-javascript/{update.sh → rebuild.sh} +1 -1
- package/front_end/third_party/lit/lib/decorators.d.ts +26 -9
- package/front_end/third_party/lit/lib/decorators.js +5 -5
- package/front_end/third_party/lit/lib/decorators.js.map +1 -1
- package/front_end/third_party/lit/lib/directive.js.map +1 -1
- package/front_end/third_party/lit/lib/directives.js +8 -13
- package/front_end/third_party/lit/lib/directives.js.map +1 -1
- package/front_end/third_party/lit/lib/lit.d.ts +26 -9
- package/front_end/third_party/lit/lib/lit.js +5 -5
- package/front_end/third_party/lit/lib/lit.js.map +1 -1
- package/front_end/third_party/lit/lib/static-html.js +2 -2
- package/front_end/third_party/lit/lib/static-html.js.map +1 -1
- package/front_end/third_party/lit/rebuild.sh +1 -1
- package/front_end/third_party/third-party-web/rebuild.sh +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +6 -7
- package/front_end/ui/legacy/ActionRegistration.ts +9 -9
- package/front_end/ui/legacy/DockController.ts +18 -18
- package/front_end/ui/legacy/FilterBar.ts +7 -7
- package/front_end/ui/legacy/Fragment.ts +4 -4
- package/front_end/ui/legacy/GlassPane.ts +12 -12
- package/front_end/ui/legacy/InspectorView.ts +5 -15
- package/front_end/ui/legacy/ListControl.ts +27 -27
- package/front_end/ui/legacy/ListWidget.ts +4 -4
- package/front_end/ui/legacy/PopoverHelper.ts +4 -4
- package/front_end/ui/legacy/ShortcutRegistry.ts +17 -17
- package/front_end/ui/legacy/TabbedPane.ts +74 -75
- package/front_end/ui/legacy/TextPrompt.ts +31 -31
- package/front_end/ui/legacy/Toolbar.ts +13 -14
- package/front_end/ui/legacy/ViewManager.ts +30 -31
- package/front_end/ui/legacy/Widget.ts +6 -6
- package/front_end/ui/legacy/XLink.ts +9 -9
- package/front_end/ui/legacy/ZoomManager.ts +9 -9
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +27 -27
- package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +30 -32
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +15 -15
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +64 -64
- package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +10 -11
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +12 -12
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +14 -14
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +8 -8
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -5
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +4 -4
- package/front_end/ui/legacy/filter.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +1 -1
- package/front_end/ui/legacy/softDropDownButton.css +1 -1
- package/front_end/ui/legacy/theme_support/ThemeSupport.ts +4 -4
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -2
- package/package.json +1 -1
- package/front_end/models/ai_assistance/data_formatters/Types.ts +0 -9
@@ -83,8 +83,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
83
83
|
|
84
84
|
export interface ViewInput {
|
85
85
|
event: Trace.Types.Events.SyntheticLayoutShift|Trace.Types.Events.SyntheticLayoutShiftCluster|null;
|
86
|
-
|
87
|
-
parsedTrace: Trace.Handlers.Types.ParsedTrace|null;
|
86
|
+
parsedTrace: Trace.TraceModel.ParsedTrace|null;
|
88
87
|
isFreshRecording: boolean;
|
89
88
|
togglePopover: (e: MouseEvent) => void;
|
90
89
|
onEventClick: (event: Trace.Types.Events.Event) => void;
|
@@ -93,8 +92,7 @@ export interface ViewInput {
|
|
93
92
|
export class LayoutShiftDetails extends UI.Widget.Widget {
|
94
93
|
#view: typeof DEFAULT_VIEW;
|
95
94
|
#event: Trace.Types.Events.SyntheticLayoutShift|Trace.Types.Events.SyntheticLayoutShiftCluster|null = null;
|
96
|
-
#
|
97
|
-
#parsedTrace: Trace.Handlers.Types.ParsedTrace|null = null;
|
95
|
+
#parsedTrace: Trace.TraceModel.ParsedTrace|null = null;
|
98
96
|
#isFreshRecording = false;
|
99
97
|
|
100
98
|
constructor(element?: HTMLElement, view = DEFAULT_VIEW) {
|
@@ -107,12 +105,7 @@ export class LayoutShiftDetails extends UI.Widget.Widget {
|
|
107
105
|
void this.requestUpdate();
|
108
106
|
}
|
109
107
|
|
110
|
-
set
|
111
|
-
this.#traceInsightsSets = traceInsightsSets;
|
112
|
-
void this.requestUpdate();
|
113
|
-
}
|
114
|
-
|
115
|
-
set parsedTrace(parsedTrace: Trace.Handlers.Types.ParsedTrace|null) {
|
108
|
+
set parsedTrace(parsedTrace: Trace.TraceModel.ParsedTrace|null) {
|
116
109
|
this.#parsedTrace = parsedTrace;
|
117
110
|
void this.requestUpdate();
|
118
111
|
}
|
@@ -154,7 +147,6 @@ export class LayoutShiftDetails extends UI.Widget.Widget {
|
|
154
147
|
this.#view(
|
155
148
|
{
|
156
149
|
event: this.#event,
|
157
|
-
traceInsightsSets: this.#traceInsightsSets,
|
158
150
|
parsedTrace: this.#parsedTrace,
|
159
151
|
isFreshRecording: this.#isFreshRecording,
|
160
152
|
togglePopover: e => this.#togglePopover(e),
|
@@ -189,9 +181,9 @@ export const DEFAULT_VIEW: (input: ViewInput, output: object, target: HTMLElemen
|
|
189
181
|
</div>
|
190
182
|
${Trace.Types.Events.isSyntheticLayoutShift(input.event) ?
|
191
183
|
renderLayoutShiftDetails(
|
192
|
-
input.event, input.
|
184
|
+
input.event, input.parsedTrace.insights, input.parsedTrace, input.isFreshRecording, input.onEventClick,
|
193
185
|
) : renderLayoutShiftClusterDetails(
|
194
|
-
input.event, input.
|
186
|
+
input.event, input.parsedTrace.insights, input.parsedTrace, input.onEventClick,
|
195
187
|
)}
|
196
188
|
</div>
|
197
189
|
</div>
|
@@ -201,7 +193,7 @@ export const DEFAULT_VIEW: (input: ViewInput, output: object, target: HTMLElemen
|
|
201
193
|
|
202
194
|
function renderLayoutShiftDetails(
|
203
195
|
layoutShift: Trace.Types.Events.SyntheticLayoutShift, traceInsightsSets: Trace.Insights.Types.TraceInsightSets|null,
|
204
|
-
parsedTrace: Trace.
|
196
|
+
parsedTrace: Trace.TraceModel.ParsedTrace, isFreshRecording: boolean,
|
205
197
|
onEventClick: (e: Trace.Types.Events.Event) => void): Lit.LitTemplate {
|
206
198
|
if (!traceInsightsSets) {
|
207
199
|
return Lit.nothing;
|
@@ -252,7 +244,7 @@ function renderLayoutShiftDetails(
|
|
252
244
|
|
253
245
|
function renderLayoutShiftClusterDetails(
|
254
246
|
cluster: Trace.Types.Events.SyntheticLayoutShiftCluster,
|
255
|
-
traceInsightsSets: Trace.Insights.Types.TraceInsightSets|null, parsedTrace: Trace.
|
247
|
+
traceInsightsSets: Trace.Insights.Types.TraceInsightSets|null, parsedTrace: Trace.TraceModel.ParsedTrace,
|
256
248
|
onEventClick: (e: Trace.Types.Events.Event) => void): Lit.LitTemplate {
|
257
249
|
if (!traceInsightsSets) {
|
258
250
|
return Lit.nothing;
|
@@ -303,7 +295,7 @@ function renderLayoutShiftClusterDetails(
|
|
303
295
|
|
304
296
|
function renderShiftRow(
|
305
297
|
currentShift: Trace.Types.Events.SyntheticLayoutShift, userHasSingleShiftSelected: boolean,
|
306
|
-
parsedTrace: Trace.
|
298
|
+
parsedTrace: Trace.TraceModel.ParsedTrace, elementsShifted: Trace.Types.Events.TraceImpactedNode[],
|
307
299
|
onEventClick: (e: Trace.Types.Events.Event) => void,
|
308
300
|
rootCauses: Trace.Insights.Models.CLSCulprits.LayoutShiftRootCausesData|undefined): Lit.LitTemplate {
|
309
301
|
const score = currentShift.args.data?.weighted_score_delta;
|
@@ -340,10 +332,10 @@ function renderShiftRow(
|
|
340
332
|
function renderStartTime(
|
341
333
|
shift: Trace.Types.Events.SyntheticLayoutShift,
|
342
334
|
userHasSingleShiftSelected: boolean,
|
343
|
-
parsedTrace: Trace.
|
335
|
+
parsedTrace: Trace.TraceModel.ParsedTrace,
|
344
336
|
onEventClick: (e: Trace.Types.Events.Event) => void,
|
345
337
|
): Lit.TemplateResult {
|
346
|
-
const ts = Trace.Types.Timing.Micro(shift.ts - parsedTrace.Meta.traceBounds.min);
|
338
|
+
const ts = Trace.Types.Timing.Micro(shift.ts - parsedTrace.data.Meta.traceBounds.min);
|
347
339
|
if (userHasSingleShiftSelected) {
|
348
340
|
return html`${i18n.TimeUtilities.preciseMillisToString(Helpers.Timing.microToMilli(ts))}`;
|
349
341
|
}
|
@@ -356,12 +348,11 @@ function renderStartTime(
|
|
356
348
|
|
357
349
|
function renderParentCluster(
|
358
350
|
cluster: Trace.Types.Events.SyntheticLayoutShiftCluster|undefined,
|
359
|
-
onEventClick: (e: Trace.Types.Events.Event) => void,
|
360
|
-
parsedTrace: Trace.Handlers.Types.ParsedTrace): Lit.LitTemplate {
|
351
|
+
onEventClick: (e: Trace.Types.Events.Event) => void, parsedTrace: Trace.TraceModel.ParsedTrace): Lit.LitTemplate {
|
361
352
|
if (!cluster) {
|
362
353
|
return Lit.nothing;
|
363
354
|
}
|
364
|
-
const ts = Trace.Types.Timing.Micro(cluster.ts - (parsedTrace
|
355
|
+
const ts = Trace.Types.Timing.Micro(cluster.ts - (parsedTrace.data.Meta.traceBounds.min ?? 0));
|
365
356
|
const clusterTs = i18n.TimeUtilities.formatMicroSecondsTime(ts);
|
366
357
|
|
367
358
|
// clang-format off
|
@@ -28,8 +28,9 @@ import * as UI from '../../../ui/legacy/legacy.js';
|
|
28
28
|
import * as Lit from '../../../ui/lit/lit.js';
|
29
29
|
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
|
30
30
|
import * as MobileThrottling from '../../mobile_throttling/mobile_throttling.js';
|
31
|
-
import {getThrottlingRecommendations
|
31
|
+
import {getThrottlingRecommendations} from '../utils/Helpers.js';
|
32
32
|
|
33
|
+
import {md} from './insights/Helpers.js';
|
33
34
|
import liveMetricsViewStyles from './liveMetricsView.css.js';
|
34
35
|
import type {MetricCardData} from './MetricCard.js';
|
35
36
|
import metricValueStyles from './metricValueStyles.css.js';
|
@@ -124,7 +124,7 @@ export class NetworkRequestDetails extends UI.Widget.Widget {
|
|
124
124
|
#target: SDK.Target.Target|null = null;
|
125
125
|
#linkifier: LegacyComponents.Linkifier.Linkifier|null = null;
|
126
126
|
#serverTimings: SDK.ServerTiming.ServerTiming[]|null = null;
|
127
|
-
#parsedTrace: Trace.
|
127
|
+
#parsedTrace: Trace.TraceModel.ParsedTrace|null = null;
|
128
128
|
|
129
129
|
constructor(element?: HTMLElement, view = DEFAULT_VIEW) {
|
130
130
|
super(element);
|
@@ -137,7 +137,7 @@ export class NetworkRequestDetails extends UI.Widget.Widget {
|
|
137
137
|
this.requestUpdate();
|
138
138
|
}
|
139
139
|
|
140
|
-
set parsedTrace(parsedTrace: Trace.
|
140
|
+
set parsedTrace(parsedTrace: Trace.TraceModel.ParsedTrace|null) {
|
141
141
|
this.#parsedTrace = parsedTrace;
|
142
142
|
this.requestUpdate();
|
143
143
|
}
|
@@ -192,7 +192,7 @@ export interface ViewInput {
|
|
192
192
|
entityMapper: TimelineUtils.EntityMapper.EntityMapper|null;
|
193
193
|
serverTimings: SDK.ServerTiming.ServerTiming[]|null;
|
194
194
|
linkifier: LegacyComponents.Linkifier.Linkifier|null;
|
195
|
-
parsedTrace: Trace.
|
195
|
+
parsedTrace: Trace.TraceModel.ParsedTrace|null;
|
196
196
|
}
|
197
197
|
|
198
198
|
export const DEFAULT_VIEW: (
|
@@ -428,7 +428,7 @@ function renderServerTimings(timings: SDK.ServerTiming.ServerTiming[]|null): Lit
|
|
428
428
|
}
|
429
429
|
function renderInitiatedBy(
|
430
430
|
request: Trace.Types.Events.SyntheticNetworkRequest,
|
431
|
-
parsedTrace: Trace.
|
431
|
+
parsedTrace: Trace.TraceModel.ParsedTrace|null,
|
432
432
|
target: SDK.Target.Target|null,
|
433
433
|
linkifier: LegacyComponents.Linkifier.Linkifier|null,
|
434
434
|
): Lit.LitTemplate {
|
@@ -451,7 +451,7 @@ function renderInitiatedBy(
|
|
451
451
|
}
|
452
452
|
}
|
453
453
|
// If we do not, we can see if the network handler found an initiator and try to link by URL
|
454
|
-
const initiator = parsedTrace?.NetworkRequests.eventToInitiator.get(request);
|
454
|
+
const initiator = parsedTrace?.data.NetworkRequests.eventToInitiator.get(request);
|
455
455
|
if (initiator) {
|
456
456
|
link = linkifier.maybeLinkifyScriptLocation(
|
457
457
|
target,
|
@@ -134,16 +134,11 @@ export class SidebarWidget extends UI.Widget.VBox {
|
|
134
134
|
this.#tabbedPane.setBadge('annotations', annotations.length > 0 ? annotations.length.toString() : null);
|
135
135
|
}
|
136
136
|
|
137
|
-
setParsedTrace(parsedTrace: Trace.
|
138
|
-
this.#insightsView.setParsedTrace(parsedTrace
|
139
|
-
}
|
140
|
-
|
141
|
-
setInsights(insights: Trace.Insights.Types.TraceInsightSets|null): void {
|
142
|
-
this.#insightsView.setInsights(insights);
|
143
|
-
|
137
|
+
setParsedTrace(parsedTrace: Trace.TraceModel.ParsedTrace|null): void {
|
138
|
+
this.#insightsView.setParsedTrace(parsedTrace);
|
144
139
|
this.#tabbedPane.setTabEnabled(
|
145
140
|
SidebarTabs.INSIGHTS,
|
146
|
-
insights
|
141
|
+
Boolean(parsedTrace?.insights && parsedTrace.insights.size > 0),
|
147
142
|
);
|
148
143
|
}
|
149
144
|
|
@@ -167,13 +162,8 @@ class InsightsView extends UI.Widget.VBox {
|
|
167
162
|
this.element.appendChild(this.#component);
|
168
163
|
}
|
169
164
|
|
170
|
-
setParsedTrace(parsedTrace: Trace.
|
165
|
+
setParsedTrace(parsedTrace: Trace.TraceModel.ParsedTrace|null): void {
|
171
166
|
this.#component.parsedTrace = parsedTrace;
|
172
|
-
this.#component.traceMetadata = metadata;
|
173
|
-
}
|
174
|
-
|
175
|
-
setInsights(data: Trace.Insights.Types.TraceInsightSets|null): void {
|
176
|
-
this.#component.insights = data;
|
177
167
|
}
|
178
168
|
|
179
169
|
getActiveInsight(): ActiveInsight|null {
|
@@ -20,9 +20,7 @@ const {html} = Lit;
|
|
20
20
|
|
21
21
|
export class SidebarInsightsTab extends HTMLElement {
|
22
22
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
23
|
-
#parsedTrace: Trace.
|
24
|
-
#traceMetadata: Trace.Types.File.MetaData|null = null;
|
25
|
-
#insights: Trace.Insights.Types.TraceInsightSets|null = null;
|
23
|
+
#parsedTrace: Trace.TraceModel.ParsedTrace|null = null;
|
26
24
|
#activeInsight: ActiveInsight|null = null;
|
27
25
|
#selectedCategory = Trace.Insights.Types.InsightCategory.ALL;
|
28
26
|
/**
|
@@ -35,39 +33,19 @@ export class SidebarInsightsTab extends HTMLElement {
|
|
35
33
|
|
36
34
|
// TODO(paulirish): add back a disconnectedCallback() to avoid memory leaks that doesn't cause b/372943062
|
37
35
|
|
38
|
-
set parsedTrace(data: Trace.
|
36
|
+
set parsedTrace(data: Trace.TraceModel.ParsedTrace|null) {
|
39
37
|
if (data === this.#parsedTrace) {
|
40
38
|
return;
|
41
39
|
}
|
42
|
-
this.#parsedTrace = data;
|
43
|
-
this.#selectedInsightSetKey = null;
|
44
|
-
|
45
|
-
void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
|
46
|
-
}
|
47
40
|
|
48
|
-
|
49
|
-
if (data === this.#traceMetadata) {
|
50
|
-
return;
|
51
|
-
}
|
52
|
-
this.#traceMetadata = data;
|
41
|
+
this.#parsedTrace = data;
|
53
42
|
this.#selectedInsightSetKey = null;
|
54
43
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
set insights(data: Trace.Insights.Types.TraceInsightSets|null) {
|
59
|
-
if (data === this.#insights) {
|
60
|
-
return;
|
61
|
-
}
|
62
|
-
|
63
|
-
this.#selectedInsightSetKey = null;
|
64
|
-
if (!data || !this.#parsedTrace) {
|
65
|
-
return;
|
44
|
+
if (this.#parsedTrace?.insights) {
|
45
|
+
/** Select the first set. Filtering out trivial sets was done back in {@link Trace.Processor.#computeInsightsForInitialTracePeriod} */
|
46
|
+
this.#selectedInsightSetKey = [...this.#parsedTrace.insights.keys()].at(0) ?? null;
|
66
47
|
}
|
67
48
|
|
68
|
-
this.#insights = new Map(data);
|
69
|
-
/** Select the first set. Filtering out trivial sets was done back in {@link Trace.Processor.#computeInsightsForInitialTracePeriod} */
|
70
|
-
this.#selectedInsightSetKey = [...this.#insights.keys()].at(0) ?? null;
|
71
49
|
void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
|
72
50
|
}
|
73
51
|
|
@@ -102,7 +80,7 @@ export class SidebarInsightsTab extends HTMLElement {
|
|
102
80
|
}
|
103
81
|
|
104
82
|
#insightSetHovered(id: string): void {
|
105
|
-
const data = this.#insights?.get(id);
|
83
|
+
const data = this.#parsedTrace?.insights?.get(id);
|
106
84
|
data && this.dispatchEvent(new Insights.SidebarInsight.InsightSetHovered(data.bounds));
|
107
85
|
}
|
108
86
|
|
@@ -112,7 +90,7 @@ export class SidebarInsightsTab extends HTMLElement {
|
|
112
90
|
|
113
91
|
#onZoomClick(event: Event, id: string): void {
|
114
92
|
event.stopPropagation();
|
115
|
-
const data = this.#insights?.get(id);
|
93
|
+
const data = this.#parsedTrace?.insights?.get(id);
|
116
94
|
if (!data) {
|
117
95
|
return;
|
118
96
|
}
|
@@ -170,27 +148,26 @@ export class SidebarInsightsTab extends HTMLElement {
|
|
170
148
|
}
|
171
149
|
|
172
150
|
#render(): void {
|
173
|
-
if (!this.#parsedTrace
|
151
|
+
if (!this.#parsedTrace?.insights) {
|
174
152
|
Lit.render(Lit.nothing, this.#shadow, {host: this});
|
175
153
|
return;
|
176
154
|
}
|
177
155
|
|
178
|
-
const
|
179
|
-
const
|
156
|
+
const insights = this.#parsedTrace.insights;
|
157
|
+
const hasMultipleInsightSets = insights.size > 1;
|
158
|
+
const labels = Utils.Helpers.createUrlLabels([...insights.values()].map(({url}) => url));
|
180
159
|
|
181
160
|
const contents =
|
182
161
|
// clang-format off
|
183
162
|
html`
|
184
163
|
<style>${sidebarInsightsTabStyles}</style>
|
185
164
|
<div class="insight-sets-wrapper">
|
186
|
-
${[...
|
165
|
+
${[...insights.values()].map(({id, url}, index) => {
|
187
166
|
const data: SidebarSingleInsightSetData = {
|
188
|
-
insights: this.#insights,
|
189
167
|
insightSetKey: id,
|
190
168
|
activeCategory: this.#selectedCategory,
|
191
169
|
activeInsight: this.#activeInsight,
|
192
170
|
parsedTrace: this.#parsedTrace,
|
193
|
-
traceMetadata: this.#traceMetadata,
|
194
171
|
};
|
195
172
|
|
196
173
|
const contents = html`
|
@@ -11,11 +11,10 @@ import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
11
11
|
import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
|
12
12
|
import * as Lit from '../../../ui/lit/lit.js';
|
13
13
|
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
|
14
|
-
import {md} from '../utils/Helpers.js';
|
15
14
|
import * as Utils from '../utils/utils.js';
|
16
15
|
|
17
16
|
import type {BaseInsightComponent} from './insights/BaseInsightComponent.js';
|
18
|
-
import {shouldRenderForCategory} from './insights/Helpers.js';
|
17
|
+
import {md, shouldRenderForCategory} from './insights/Helpers.js';
|
19
18
|
import * as Insights from './insights/insights.js';
|
20
19
|
import type {ActiveInsight} from './Sidebar.js';
|
21
20
|
import sidebarSingleInsightSetStyles from './sidebarSingleInsightSet.css.js';
|
@@ -74,12 +73,10 @@ const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/SidebarSing
|
|
74
73
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
75
74
|
|
76
75
|
export interface SidebarSingleInsightSetData {
|
77
|
-
insights: Trace.Insights.Types.TraceInsightSets|null;
|
78
76
|
insightSetKey: Trace.Types.Events.NavigationId|null;
|
79
77
|
activeCategory: Trace.Insights.Types.InsightCategory;
|
80
78
|
activeInsight: ActiveInsight|null;
|
81
|
-
parsedTrace: Trace.
|
82
|
-
traceMetadata: Trace.Types.File.MetaData|null;
|
79
|
+
parsedTrace: Trace.TraceModel.ParsedTrace|null;
|
83
80
|
}
|
84
81
|
|
85
82
|
type InsightNameToComponentMapping =
|
@@ -122,12 +119,10 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
122
119
|
#activeInsightElement: BaseInsightComponent<Trace.Insights.Types.InsightModel>|null = null;
|
123
120
|
|
124
121
|
#data: SidebarSingleInsightSetData = {
|
125
|
-
insights: null,
|
126
122
|
insightSetKey: null,
|
127
123
|
activeCategory: Trace.Insights.Types.InsightCategory.ALL,
|
128
124
|
activeInsight: null,
|
129
125
|
parsedTrace: null,
|
130
|
-
traceMetadata: null,
|
131
126
|
};
|
132
127
|
|
133
128
|
#dismissedFieldMismatchNotice = false;
|
@@ -225,7 +220,11 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
225
220
|
|
226
221
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
227
222
|
#getLocalMetrics(insightSetKey: string) {
|
228
|
-
|
223
|
+
if (!this.#data.parsedTrace) {
|
224
|
+
return {};
|
225
|
+
}
|
226
|
+
|
227
|
+
const insightSet = this.#data.parsedTrace.insights?.get(insightSetKey);
|
229
228
|
if (!insightSet) {
|
230
229
|
return {};
|
231
230
|
}
|
@@ -238,13 +237,17 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
238
237
|
}
|
239
238
|
|
240
239
|
#getFieldMetrics(insightSetKey: string): Trace.Insights.Common.CrUXFieldMetricResults|null {
|
241
|
-
|
240
|
+
if (!this.#data.parsedTrace) {
|
241
|
+
return null;
|
242
|
+
}
|
243
|
+
|
244
|
+
const insightSet = this.#data.parsedTrace.insights?.get(insightSetKey);
|
242
245
|
if (!insightSet) {
|
243
246
|
return null;
|
244
247
|
}
|
245
248
|
|
246
249
|
const fieldMetricsResults = Trace.Insights.Common.getFieldMetricsForInsightSet(
|
247
|
-
insightSet, this.#data.
|
250
|
+
insightSet, this.#data.parsedTrace.metadata, CrUXManager.CrUXManager.instance().getSelectedScope());
|
248
251
|
if (!fieldMetricsResults) {
|
249
252
|
return null;
|
250
253
|
}
|
@@ -409,10 +412,10 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
409
412
|
}
|
410
413
|
|
411
414
|
#renderInsights(
|
412
|
-
|
415
|
+
insights: Trace.Insights.Types.TraceInsightSets|null,
|
413
416
|
insightSetKey: string,
|
414
417
|
): Lit.LitTemplate {
|
415
|
-
const insightSet =
|
418
|
+
const insightSet = insights?.get(insightSetKey);
|
416
419
|
if (!insightSet) {
|
417
420
|
return Lit.nothing;
|
418
421
|
}
|
@@ -420,19 +423,18 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
420
423
|
const fieldMetrics = this.#getFieldMetrics(insightSetKey);
|
421
424
|
const {shownInsights: shownInsightsData, passedInsights: passedInsightsData} =
|
422
425
|
SidebarSingleInsightSet.categorizeInsights(
|
423
|
-
|
426
|
+
insights,
|
424
427
|
insightSetKey,
|
425
428
|
this.#data.activeCategory,
|
426
429
|
);
|
427
430
|
|
428
431
|
const renderInsightComponent = (insightData: CategorizedInsightData): Lit.TemplateResult => {
|
429
432
|
const {componentClass, model} = insightData;
|
430
|
-
if (!this.#data.parsedTrace
|
433
|
+
if (!this.#data.parsedTrace?.insights) {
|
431
434
|
return html``;
|
432
435
|
}
|
433
436
|
|
434
|
-
const agentFocus = Utils.AIContext.AgentFocus.fromInsight(
|
435
|
-
this.#data.parsedTrace, this.#data.insights, this.#data.traceMetadata, model);
|
437
|
+
const agentFocus = Utils.AIContext.AgentFocus.fromInsight(this.#data.parsedTrace, model);
|
436
438
|
// clang-format off
|
437
439
|
return html`<div>
|
438
440
|
<${componentClass.litTagName}
|
@@ -472,10 +474,10 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
472
474
|
|
473
475
|
#render(): void {
|
474
476
|
const {
|
475
|
-
|
477
|
+
parsedTrace,
|
476
478
|
insightSetKey,
|
477
479
|
} = this.#data;
|
478
|
-
if (!insights || !insightSetKey) {
|
480
|
+
if (!parsedTrace?.insights || !insightSetKey) {
|
479
481
|
Lit.render(html``, this.#shadow, {host: this});
|
480
482
|
return;
|
481
483
|
}
|
@@ -485,7 +487,7 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
485
487
|
<style>${sidebarSingleInsightSetStyles}</style>
|
486
488
|
<div class="navigation">
|
487
489
|
${this.#renderMetrics(insightSetKey)}
|
488
|
-
${this.#renderInsights(insights, insightSetKey)}
|
490
|
+
${this.#renderInsights(parsedTrace.insights, insightSetKey)}
|
489
491
|
</div>
|
490
492
|
`, this.#shadow, {host: this});
|
491
493
|
// clang-format on
|
@@ -15,10 +15,10 @@ import * as UI from '../../../../ui/legacy/legacy.js';
|
|
15
15
|
import * as Lit from '../../../../ui/lit/lit.js';
|
16
16
|
import * as VisualLogging from '../../../../ui/visual_logging/visual_logging.js';
|
17
17
|
import type * as Overlays from '../../overlays/overlays.js';
|
18
|
-
import {md} from '../../utils/Helpers.js';
|
19
18
|
import * as Utils from '../../utils/utils.js';
|
20
19
|
|
21
20
|
import baseInsightComponentStyles from './baseInsightComponent.css.js';
|
21
|
+
import {md} from './Helpers.js';
|
22
22
|
import * as SidebarInsight from './SidebarInsight.js';
|
23
23
|
import type {TableState} from './Table.js';
|
24
24
|
|
@@ -21,6 +21,10 @@ export class Cache extends BaseInsightComponent<CacheInsightModel> {
|
|
21
21
|
static override readonly litTagName = Lit.StaticHtml.literal`devtools-performance-cache`;
|
22
22
|
override internalName = 'cache';
|
23
23
|
|
24
|
+
protected override hasAskAiSupport(): boolean {
|
25
|
+
return true;
|
26
|
+
}
|
27
|
+
|
24
28
|
mapToRow(req: Trace.Insights.Models.Cache.CacheableRequest): TableDataRow {
|
25
29
|
return {
|
26
30
|
values: [eventRef(req.request), i18n.TimeUtilities.secondsToString(req.ttl)],
|
@@ -10,10 +10,10 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
10
10
|
import type {DOMSizeInsightModel} from '../../../../models/trace/insights/DOMSize.js';
|
11
11
|
import * as Trace from '../../../../models/trace/trace.js';
|
12
12
|
import * as Lit from '../../../../ui/lit/lit.js';
|
13
|
-
import {md} from '../../utils/Helpers.js';
|
14
13
|
|
15
14
|
import {BaseInsightComponent} from './BaseInsightComponent.js';
|
16
15
|
import {eventRef} from './EventRef.js';
|
16
|
+
import {md} from './Helpers.js';
|
17
17
|
import type * as NodeLink from './NodeLink.js';
|
18
18
|
import type {TableData, TableDataRow} from './Table.js';
|
19
19
|
|
@@ -25,6 +25,10 @@ export class DOMSize extends BaseInsightComponent<DOMSizeInsightModel> {
|
|
25
25
|
static override readonly litTagName = Lit.StaticHtml.literal`devtools-performance-dom-size`;
|
26
26
|
override internalName = 'dom-size';
|
27
27
|
|
28
|
+
protected override hasAskAiSupport(): boolean {
|
29
|
+
return true;
|
30
|
+
}
|
31
|
+
|
28
32
|
#renderNodeTable(domStatsData: Trace.Types.Events.DOMStats['args']['data']): Lit.LitTemplate {
|
29
33
|
const rows: TableData['rows'] = [];
|
30
34
|
|
@@ -2,7 +2,14 @@
|
|
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 '../../../../ui/components/markdown_view/markdown_view.js';
|
6
|
+
|
7
|
+
import type * as Common from '../../../../core/common/common.js';
|
5
8
|
import * as Trace from '../../../../models/trace/trace.js';
|
9
|
+
import * as Marked from '../../../../third_party/marked/marked.js';
|
10
|
+
import * as Lit from '../../../../ui/lit/lit.js';
|
11
|
+
|
12
|
+
const {html} = Lit;
|
6
13
|
|
7
14
|
export function shouldRenderForCategory(options: {
|
8
15
|
activeCategory: Trace.Insights.Types.InsightCategory,
|
@@ -11,3 +18,15 @@ export function shouldRenderForCategory(options: {
|
|
11
18
|
return options.activeCategory === Trace.Insights.Types.InsightCategory.ALL ||
|
12
19
|
options.activeCategory === options.insightCategory;
|
13
20
|
}
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Returns a rendered MarkdownView component.
|
24
|
+
*
|
25
|
+
* This should only be used for markdown that is guaranteed to be valid,
|
26
|
+
* and not contain any user-generated content.
|
27
|
+
*/
|
28
|
+
export function md(markdown: Common.UIString.LocalizedString): Lit.TemplateResult {
|
29
|
+
const tokens = Marked.Marked.lexer(markdown);
|
30
|
+
const data = {tokens};
|
31
|
+
return html`<devtools-markdown-view .data=${data}></devtools-markdown-view>`;
|
32
|
+
}
|
@@ -12,10 +12,10 @@ import type {
|
|
12
12
|
'../../../../models/trace/insights/NetworkDependencyTree.js';
|
13
13
|
import * as Trace from '../../../../models/trace/trace.js';
|
14
14
|
import * as Lit from '../../../../ui/lit/lit.js';
|
15
|
-
import {md} from '../../utils/Helpers.js';
|
16
15
|
|
17
16
|
import {BaseInsightComponent} from './BaseInsightComponent.js';
|
18
17
|
import {eventRef} from './EventRef.js';
|
18
|
+
import {md} from './Helpers.js';
|
19
19
|
import networkDependencyTreeInsightStyles from './networkDependencyTreeInsight.css.js';
|
20
20
|
import type {NodeLinkData} from './NodeLink.js';
|
21
21
|
import {renderOthersLabel, type TableData, type TableDataRow} from './Table.js';
|
@@ -16,6 +16,10 @@ export class Viewport extends BaseInsightComponent<ViewportInsightModel> {
|
|
16
16
|
static override readonly litTagName = Lit.StaticHtml.literal`devtools-performance-viewport`;
|
17
17
|
override internalName = 'viewport';
|
18
18
|
|
19
|
+
protected override hasAskAiSupport(): boolean {
|
20
|
+
return true;
|
21
|
+
}
|
22
|
+
|
19
23
|
override getEstimatedSavingsTime(): Trace.Types.Timing.Milli|null {
|
20
24
|
return this.model?.metricSavings?.INP ?? null;
|
21
25
|
}
|
@@ -204,7 +204,7 @@ export interface TimelineCharts {
|
|
204
204
|
}
|
205
205
|
|
206
206
|
export interface OverlayEntryQueries {
|
207
|
-
parsedTrace: () => Trace.
|
207
|
+
parsedTrace: () => Trace.TraceModel.ParsedTrace | null;
|
208
208
|
isEntryCollapsedByUser: (entry: Trace.Types.Events.Event) => boolean;
|
209
209
|
firstVisibleParentForEntry: (entry: Trace.Types.Events.Event) => Trace.Types.Events.Event | null;
|
210
210
|
}
|
@@ -22,7 +22,7 @@ function depthFirstWalk(
|
|
22
22
|
|
23
23
|
export interface FromTimeOnThreadOptions {
|
24
24
|
thread: {pid: Trace.Types.Events.ProcessID, tid: Trace.Types.Events.ThreadID};
|
25
|
-
parsedTrace: Trace.
|
25
|
+
parsedTrace: Trace.TraceModel.ParsedTrace;
|
26
26
|
bounds: Trace.Types.Timing.TraceWindowMicro;
|
27
27
|
}
|
28
28
|
|
@@ -30,13 +30,12 @@ export class AICallTree {
|
|
30
30
|
constructor(
|
31
31
|
public selectedNode: Trace.Extras.TraceTree.Node|null,
|
32
32
|
public rootNode: Trace.Extras.TraceTree.TopDownRootNode,
|
33
|
-
|
34
|
-
public parsedTrace: Trace.Handlers.Types.ParsedTrace,
|
33
|
+
public parsedTrace: Trace.TraceModel.ParsedTrace,
|
35
34
|
) {
|
36
35
|
}
|
37
36
|
|
38
37
|
static findEventsForThread({thread, parsedTrace, bounds}: FromTimeOnThreadOptions): Trace.Types.Events.Event[]|null {
|
39
|
-
const threadEvents = parsedTrace.Renderer.processes.get(thread.pid)?.threads.get(thread.tid)?.entries;
|
38
|
+
const threadEvents = parsedTrace.data.Renderer.processes.get(thread.pid)?.threads.get(thread.tid)?.entries;
|
40
39
|
if (!threadEvents) {
|
41
40
|
return null;
|
42
41
|
}
|
@@ -46,7 +45,7 @@ export class AICallTree {
|
|
46
45
|
|
47
46
|
static findMainThreadTasks({thread, parsedTrace, bounds}: FromTimeOnThreadOptions):
|
48
47
|
Trace.Types.Events.RunTask[]|null {
|
49
|
-
const threadEvents = parsedTrace.Renderer.processes.get(thread.pid)?.threads.get(thread.tid)?.entries;
|
48
|
+
const threadEvents = parsedTrace.data.Renderer.processes.get(thread.pid)?.threads.get(thread.tid)?.entries;
|
50
49
|
if (!threadEvents) {
|
51
50
|
return null;
|
52
51
|
}
|
@@ -100,7 +99,7 @@ export class AICallTree {
|
|
100
99
|
* This filters out other events we make such as SyntheticLayoutShifts which are not valid
|
101
100
|
* If the event is not valid, or there is an unexpected error building the tree, `null` is returned.
|
102
101
|
*/
|
103
|
-
static fromEvent(selectedEvent: Trace.Types.Events.Event, parsedTrace: Trace.
|
102
|
+
static fromEvent(selectedEvent: Trace.Types.Events.Event, parsedTrace: Trace.TraceModel.ParsedTrace): AICallTree
|
104
103
|
|null {
|
105
104
|
// Special case: performance.mark events are shown on the main thread
|
106
105
|
// technically, but because they are instant events they are shown with a
|
@@ -117,7 +116,7 @@ export class AICallTree {
|
|
117
116
|
}
|
118
117
|
|
119
118
|
// First: check that the selected event is on the thread we have identified as the main thread.
|
120
|
-
const threads = Trace.Handlers.Threads.threadsInTrace(parsedTrace);
|
119
|
+
const threads = Trace.Handlers.Threads.threadsInTrace(parsedTrace.data);
|
121
120
|
const thread = threads.find(t => t.pid === selectedEvent.pid && t.tid === selectedEvent.tid);
|
122
121
|
if (!thread) {
|
123
122
|
return null;
|
@@ -139,7 +138,8 @@ export class AICallTree {
|
|
139
138
|
// information such as Layout Shift clusters.
|
140
139
|
// We check Renderer + Samples to ensure we support CPU Profiles (which do
|
141
140
|
// not populate the Renderer Handler)
|
142
|
-
|
141
|
+
const data = parsedTrace.data;
|
142
|
+
if (!data.Renderer.entryToNode.has(selectedEvent) && !data.Samples.entryToNode.has(selectedEvent)) {
|
143
143
|
return null;
|
144
144
|
}
|
145
145
|
|
@@ -147,10 +147,10 @@ export class AICallTree {
|
|
147
147
|
const {startTime, endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(selectedEvent);
|
148
148
|
const selectedEventBounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(
|
149
149
|
Trace.Helpers.Timing.milliToMicro(startTime), Trace.Helpers.Timing.milliToMicro(endTime));
|
150
|
-
let threadEvents =
|
150
|
+
let threadEvents = data.Renderer.processes.get(selectedEvent.pid)?.threads.get(selectedEvent.tid)?.entries;
|
151
151
|
if (!threadEvents) {
|
152
152
|
// None from the renderer: try the samples handler, this might be a CPU trace.
|
153
|
-
threadEvents =
|
153
|
+
threadEvents = data.Samples.profilesInProcess.get(selectedEvent.pid)?.get(selectedEvent.tid)?.profileCalls;
|
154
154
|
}
|
155
155
|
|
156
156
|
if (!threadEvents) {
|
@@ -300,7 +300,7 @@ export class AICallTree {
|
|
300
300
|
* - This node is the selected node (S marker)
|
301
301
|
*/
|
302
302
|
stringifyNode(
|
303
|
-
node: Trace.Extras.TraceTree.Node, nodeId: number, parsedTrace: Trace.
|
303
|
+
node: Trace.Extras.TraceTree.Node, nodeId: number, parsedTrace: Trace.TraceModel.ParsedTrace,
|
304
304
|
selectedNode: Trace.Extras.TraceTree.Node|null, allUrls: string[], childStartingNodeIndex?: number): string {
|
305
305
|
const event = node.event;
|
306
306
|
if (!event) {
|