chrome-devtools-frontend 1.0.1550444 → 1.0.1553956
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/styleguide/ux/components.md +34 -8
- package/eslint.config.mjs +7 -0
- package/front_end/Images/generate-css-vars.js +8 -4
- package/front_end/core/common/Settings.ts +20 -8
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/i18n/collect-ui-strings.js +19 -10
- package/front_end/core/i18n/generate-locales-js.js +4 -4
- package/front_end/core/protocol_client/CDPConnection.ts +1 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +5 -1
- package/front_end/core/root/Runtime.ts +0 -12
- package/front_end/core/sdk/DOMModel.ts +38 -3
- package/front_end/core/sdk/DebuggerModel.ts +9 -4
- package/front_end/core/sdk/IsolateManager.ts +7 -0
- package/front_end/core/sdk/PageResourceLoader.ts +3 -3
- package/front_end/core/sdk/RehydratingConnection.ts +5 -2
- package/front_end/entrypoints/main/MainImpl.ts +28 -10
- package/front_end/generated/SupportedCSSProperties.js +14 -0
- package/front_end/models/ai_assistance/AiConversation.ts +94 -4
- package/front_end/models/ai_assistance/agents/AiAgent.ts +30 -15
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +179 -41
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +5 -0
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +62 -0
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +2 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +1 -7
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +124 -12
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +125 -30
- package/front_end/models/ai_assistance/performance/AICallTree.ts +42 -0
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +12 -0
- package/front_end/models/issues_manager/Issue.ts +1 -0
- package/front_end/models/issues_manager/IssueAggregator.ts +9 -0
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/PermissionElementIssue.ts +262 -0
- package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabled.md +7 -0
- package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
- package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
- package/front_end/models/issues_manager/descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementFencedFrameDisallowed.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementFontSizeTooLarge.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementFontSizeTooSmall.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementGeolocationDeprecated.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidDisplayStyle.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidSizeValue.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidType.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidTypeActivation.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementLowContrast.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementNonOpaqueColor.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
- package/front_end/models/issues_manager/descriptions/permissionElementPaddingRightUnsupported.md +6 -0
- package/front_end/models/issues_manager/descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementRegistrationFailed.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementRequestInProgress.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementSecurityChecksFailed.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementTypeNotSupported.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementUntrustedEvent.md +7 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
- package/front_end/models/stack_trace/StackTraceModel.ts +37 -18
- package/front_end/models/trace/Processor.ts +14 -15
- package/front_end/models/trace/insights/Common.ts +2 -8
- package/front_end/models/trace/insights/types.ts +12 -2
- package/front_end/models/trace/types/TraceEvents.ts +4 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +28 -6
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +9 -23
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +78 -2
- package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +71 -0
- package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +126 -0
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +131 -2
- package/front_end/panels/ai_assistance/components/chatView.css +28 -0
- package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +33 -0
- package/front_end/panels/application/AppManifestView.ts +1007 -521
- package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -17
- package/front_end/panels/application/ExtensionStorageItemsView.ts +3 -5
- package/front_end/panels/application/KeyValueStorageItemsView.ts +3 -2
- package/front_end/panels/application/components/BackForwardCacheView.ts +2 -2
- package/front_end/panels/application/preloading/PreloadingView.ts +46 -45
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +80 -75
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +169 -133
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +74 -93
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +142 -117
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +51 -11
- package/front_end/panels/application/preloading/components/components.ts +0 -2
- package/front_end/panels/common/Annotation.ts +184 -0
- package/front_end/panels/common/AnnotationManager.ts +148 -11
- package/front_end/panels/common/ExtensionView.ts +47 -0
- package/front_end/panels/common/PersistenceUtils.ts +22 -25
- package/front_end/panels/common/annotation.css +40 -0
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsoleInsightTeaser.ts +187 -5
- package/front_end/panels/console/ConsolePinPane.ts +437 -217
- package/front_end/panels/console/ConsolePrompt.ts +32 -223
- package/front_end/panels/console/ConsoleView.ts +67 -66
- package/front_end/panels/console/ConsoleViewMessage.ts +8 -3
- package/front_end/panels/console/consoleInsightTeaser.css +23 -0
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +89 -0
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +2 -2
- package/front_end/panels/elements/ComputedStyleWidget.ts +16 -5
- package/front_end/panels/elements/ElementsPanel.ts +38 -12
- package/front_end/panels/elements/ElementsSidebarPane.ts +1 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +313 -353
- package/front_end/panels/elements/ElementsTreeOutline.ts +39 -13
- package/front_end/panels/elements/StylePropertyTreeElement.ts +15 -14
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/emulation/MediaQueryInspector.ts +171 -125
- package/front_end/panels/explain/components/ConsoleInsight.ts +175 -150
- package/front_end/panels/explain/components/consoleInsight.css +348 -347
- package/front_end/panels/issues/AffectedPermissionElementsView.ts +46 -0
- package/front_end/panels/issues/IssueView.ts +2 -0
- package/front_end/panels/issues/IssuesPane.ts +6 -0
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +165 -149
- package/front_end/panels/layer_viewer/Layers3DView.ts +131 -78
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +149 -100
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +90 -64
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +25 -34
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +60 -44
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +170 -151
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +50 -51
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterDisplay.css +0 -13
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterSettings.css +20 -18
- package/front_end/panels/mobile_throttling/CalibrationController.ts +3 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +14 -6
- package/front_end/panels/network/NetworkItemView.ts +42 -3
- package/front_end/panels/network/NetworkLogView.ts +10 -11
- package/front_end/panels/network/NetworkPanel.ts +63 -1
- package/front_end/panels/network/RequestInitiatorView.ts +146 -113
- package/front_end/panels/network/components/RequestHeaderSection.css +51 -50
- package/front_end/panels/network/components/RequestHeaderSection.ts +81 -71
- package/front_end/panels/network/components/RequestHeadersView.css +1 -1
- package/front_end/panels/network/components/RequestHeadersView.ts +26 -11
- package/front_end/panels/network/components/RequestTrustTokensView.css +24 -14
- package/front_end/panels/network/components/RequestTrustTokensView.ts +144 -140
- package/front_end/panels/profiler/IsolateSelector.ts +2 -1
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +49 -33
- package/front_end/panels/recorder/RecorderController.ts +2 -3
- package/front_end/panels/recorder/components/ControlButton.ts +68 -34
- package/front_end/panels/recorder/components/CreateRecordingView.ts +9 -6
- package/front_end/panels/recorder/components/RecordingView.ts +81 -88
- package/front_end/panels/recorder/components/ReplaySection.ts +226 -145
- package/front_end/panels/recorder/{controllers → components}/SelectorPicker.ts +129 -52
- package/front_end/panels/recorder/components/StepEditor.ts +21 -67
- package/front_end/panels/recorder/components/StepView.ts +222 -180
- package/front_end/panels/recorder/components/TimelineSection.ts +69 -48
- package/front_end/panels/recorder/components/components.ts +2 -2
- package/front_end/panels/recorder/components/selectorPicker.css +14 -0
- package/front_end/panels/recorder/components/stepEditor.css +0 -5
- package/front_end/panels/recorder/components/stepView.css +196 -198
- package/front_end/panels/recorder/extensions/ExtensionManager.ts +4 -48
- package/front_end/panels/recorder/models/ScreenshotUtils.ts +17 -11
- package/front_end/panels/security/CookieControlsView.ts +9 -16
- package/front_end/panels/settings/components/SyncSection.ts +0 -1
- package/front_end/panels/sources/CSSPlugin.ts +3 -3
- package/front_end/panels/sources/CallStackSidebarPane.ts +60 -75
- package/front_end/panels/sources/SourcesPanel.ts +1 -11
- package/front_end/panels/sources/TabbedEditorContainer.ts +11 -8
- package/front_end/panels/sources/ThreadsSidebarPane.ts +96 -101
- package/front_end/panels/sources/threadsSidebarPane.css +6 -5
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +2 -3
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +23 -33
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +4 -3
- package/front_end/panels/timeline/TimelineFlameChartView.ts +12 -0
- package/front_end/panels/timeline/TimelinePanel.ts +3 -5
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +164 -142
- package/front_end/panels/timeline/components/InteractionBreakdown.ts +48 -28
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +18 -23
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +98 -73
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +9 -12
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +262 -291
- package/front_end/panels/timeline/components/Utils.ts +25 -0
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +210 -146
- package/front_end/panels/timeline/components/insights/CLSCulprits.ts +8 -20
- package/front_end/panels/timeline/components/insights/Cache.ts +0 -9
- package/front_end/panels/timeline/components/insights/DOMSize.ts +11 -33
- package/front_end/panels/timeline/components/insights/DocumentLatency.ts +0 -9
- package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +0 -9
- package/front_end/panels/timeline/components/insights/EventRef.ts +47 -109
- package/front_end/panels/timeline/components/insights/FontDisplay.ts +0 -9
- package/front_end/panels/timeline/components/insights/ForcedReflow.ts +0 -9
- package/front_end/panels/timeline/components/insights/INPBreakdown.ts +0 -9
- package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -10
- package/front_end/panels/timeline/components/insights/ImageRef.ts +112 -0
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +91 -0
- package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +0 -9
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +4 -11
- package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +0 -9
- package/front_end/panels/timeline/components/insights/ModernHTTP.ts +0 -9
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +6 -21
- package/front_end/panels/timeline/components/insights/NodeLink.ts +68 -43
- package/front_end/panels/timeline/components/insights/README.md +2 -3
- package/front_end/panels/timeline/components/insights/RenderBlocking.ts +0 -9
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +0 -9
- package/front_end/panels/timeline/components/insights/ThirdParties.ts +0 -9
- package/front_end/panels/timeline/components/insights/Viewport.ts +7 -19
- package/front_end/panels/timeline/components/insights/baseInsightComponent.css +5 -0
- package/front_end/panels/timeline/components/insights/insights.ts +2 -0
- package/front_end/panels/timeline/components/interactionBreakdown.css +15 -13
- package/front_end/panels/timeline/enable-easter-egg.js +7 -3
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts +96 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +87 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +2 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +5 -24
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js +42 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +4 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js +90 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +4 -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 +5 -2
- 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 +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +14 -2
- 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/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js +30 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +5 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +22 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +4 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +2 -0
- 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 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js +8 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +30 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +15 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -13
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +5 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.js +17 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +221 -4
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +182 -95
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts +96 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +87 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +2 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +4 -22
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.js +38 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +4 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js +85 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +4 -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 +5 -2
- 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 +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +14 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.js +26 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +5 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +22 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +2 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +2 -0
- 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 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js +8 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +31 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +15 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -13
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +5 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.js +16 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +221 -4
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/BluetoothEmulation.ts +103 -0
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +96 -1
- package/front_end/third_party/puppeteer/package/src/api/DeviceRequestPrompt.ts +2 -10
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +6 -0
- package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/BluetoothEmulation.ts +52 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +15 -0
- package/front_end/third_party/puppeteer/package/src/bidi/DeviceRequestPrompt.ts +138 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +7 -3
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +10 -2
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +30 -2
- package/front_end/third_party/puppeteer/package/src/bidi/util.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/BluetoothEmulation.ts +47 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +33 -3
- package/front_end/third_party/puppeteer/package/src/cdp/CdpSession.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/DeviceRequestPrompt.ts +3 -8
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +9 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +8 -3
- package/front_end/third_party/puppeteer/package/src/cdp/cdp.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +45 -1
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +20 -0
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +5 -17
- package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +23 -7
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +4 -0
- package/front_end/ui/components/annotations/AnnotationRepository.ts +153 -13
- package/front_end/ui/components/snackbars/Snackbars.docs.ts +0 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaserPlaceholder.ts +12 -3
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +182 -0
- package/front_end/ui/components/text_editor/text_editor.ts +1 -0
- package/front_end/ui/helpers/OpenInNewTab.ts +5 -1
- package/front_end/ui/i18n/i18n.ts +9 -9
- package/front_end/ui/kit/icons/Icon.docs.ts +22 -65
- package/front_end/ui/kit/kit.ts +1 -0
- package/front_end/ui/kit/link/Link.docs.ts +15 -0
- package/front_end/ui/kit/link/Link.ts +151 -0
- package/front_end/ui/kit/link/link.css +27 -0
- package/front_end/ui/legacy/EmptyWidget.ts +6 -0
- package/front_end/ui/legacy/Floaty.ts +442 -0
- package/front_end/ui/legacy/InspectorView.ts +12 -0
- package/front_end/ui/legacy/ReportView.ts +1 -1
- package/front_end/ui/legacy/SelectMenu.docs.ts +0 -1
- package/front_end/ui/legacy/TabbedPane.ts +131 -53
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +36 -36
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +22 -37
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +31 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -2
- package/front_end/ui/legacy/components/utils/Linkifier.ts +7 -11
- package/front_end/ui/legacy/floaty.css +77 -0
- package/front_end/ui/legacy/legacy.ts +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +6 -0
- package/inspector_overlay/loadCSS.rollup.js +5 -4
- package/package.json +2 -2
- package/front_end/panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts +0 -99
- package/front_end/panels/recorder/components/SelectButton.ts +0 -304
- package/front_end/panels/recorder/controllers/controllers.ts +0 -7
- package/front_end/ui/components/chrome_link/ChromeLink.ts +0 -76
- package/front_end/ui/components/chrome_link/chromeLink.css +0 -12
- package/front_end/ui/components/chrome_link/chrome_link.ts +0 -9
- /package/front_end/panels/recorder/components/{selectButton.css → replaySection.css} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2024 The Chromium Authors
|
|
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
|
-
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
4
|
|
|
6
5
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
6
|
import * as Platform from '../../../core/platform/platform.js';
|
|
@@ -9,17 +8,15 @@ import * as AIAssistance from '../../../models/ai_assistance/ai_assistance.js';
|
|
|
9
8
|
import * as CrUXManager from '../../../models/crux-manager/crux-manager.js';
|
|
10
9
|
import * as Trace from '../../../models/trace/trace.js';
|
|
11
10
|
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
12
|
-
import * as
|
|
11
|
+
import * as UI from '../../../ui/legacy/legacy.js';
|
|
13
12
|
import * as Lit from '../../../ui/lit/lit.js';
|
|
14
|
-
import {nothing} from '../../../ui/lit/lit.js';
|
|
15
13
|
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
|
|
16
14
|
|
|
17
|
-
import type {BaseInsightComponent} from './insights/BaseInsightComponent.js';
|
|
18
15
|
import {md, shouldRenderForCategory} from './insights/Helpers.js';
|
|
19
16
|
import * as Insights from './insights/insights.js';
|
|
20
17
|
import type {ActiveInsight} from './Sidebar.js';
|
|
21
18
|
import sidebarSingleInsightSetStyles from './sidebarSingleInsightSet.css.js';
|
|
22
|
-
import {
|
|
19
|
+
import {isFieldWorseThanLocal, NumberWithUnit} from './Utils.js';
|
|
23
20
|
|
|
24
21
|
const {html} = Lit.StaticHtml;
|
|
25
22
|
|
|
@@ -70,6 +67,7 @@ const UIStrings = {
|
|
|
70
67
|
'There are many reasons why local and field metrics [may not match](https://web.dev/articles/lab-and-field-data-differences). ' +
|
|
71
68
|
'Adjust [throttling settings and device emulation](https://developer.chrome.com/docs/devtools/device-mode) to analyze traces more similar to the average user\'s environment.',
|
|
72
69
|
} as const;
|
|
70
|
+
|
|
73
71
|
const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/SidebarSingleInsightSet.ts', UIStrings);
|
|
74
72
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
75
73
|
|
|
@@ -80,96 +78,124 @@ export interface SidebarSingleInsightSetData {
|
|
|
80
78
|
parsedTrace: Trace.TraceModel.ParsedTrace|null;
|
|
81
79
|
}
|
|
82
80
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
interface CategorizedInsightData {
|
|
87
|
-
componentClass: typeof Insights.BaseInsightComponent.BaseInsightComponent<Trace.Insights.Types.InsightModel>;
|
|
81
|
+
interface InsightData {
|
|
82
|
+
insightName: string;
|
|
88
83
|
model: Trace.Insights.Types.InsightModel;
|
|
89
84
|
}
|
|
90
85
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const INSIGHT_NAME_TO_COMPONENT: InsightNameToComponentMapping = {
|
|
97
|
-
Cache: Insights.Cache.Cache,
|
|
98
|
-
CLSCulprits: Insights.CLSCulprits.CLSCulprits,
|
|
99
|
-
DocumentLatency: Insights.DocumentLatency.DocumentLatency,
|
|
100
|
-
DOMSize: Insights.DOMSize.DOMSize,
|
|
101
|
-
DuplicatedJavaScript: Insights.DuplicatedJavaScript.DuplicatedJavaScript,
|
|
102
|
-
FontDisplay: Insights.FontDisplay.FontDisplay,
|
|
103
|
-
ForcedReflow: Insights.ForcedReflow.ForcedReflow,
|
|
104
|
-
ImageDelivery: Insights.ImageDelivery.ImageDelivery,
|
|
105
|
-
INPBreakdown: Insights.INPBreakdown.INPBreakdown,
|
|
106
|
-
LCPDiscovery: Insights.LCPDiscovery.LCPDiscovery,
|
|
107
|
-
LCPBreakdown: Insights.LCPBreakdown.LCPBreakdown,
|
|
108
|
-
LegacyJavaScript: Insights.LegacyJavaScript.LegacyJavaScript,
|
|
109
|
-
ModernHTTP: Insights.ModernHTTP.ModernHTTP,
|
|
110
|
-
NetworkDependencyTree: Insights.NetworkDependencyTree.NetworkDependencyTree,
|
|
111
|
-
RenderBlocking: Insights.RenderBlocking.RenderBlocking,
|
|
112
|
-
SlowCSSSelector: Insights.SlowCSSSelector.SlowCSSSelector,
|
|
113
|
-
ThirdParties: Insights.ThirdParties.ThirdParties,
|
|
114
|
-
Viewport: Insights.Viewport.Viewport,
|
|
115
|
-
};
|
|
86
|
+
interface LocalMetrics {
|
|
87
|
+
lcp: {value: Trace.Types.Timing.Micro, event: Trace.Types.Events.LargestContentfulPaintCandidate}|null;
|
|
88
|
+
cls: {value: number, worstClusterEvent: Trace.Types.Events.Event|null};
|
|
89
|
+
inp: {value: Trace.Types.Timing.Micro, event: Trace.Types.Events.SyntheticInteractionPair}|null;
|
|
90
|
+
}
|
|
116
91
|
|
|
117
|
-
|
|
118
|
-
|
|
92
|
+
interface ViewInput {
|
|
93
|
+
shownInsights: InsightData[];
|
|
94
|
+
passedInsights: InsightData[];
|
|
95
|
+
local: LocalMetrics|null;
|
|
96
|
+
field: Trace.Insights.Common.CrUXFieldMetricResults|null;
|
|
97
|
+
activeCategory: Trace.Insights.Types.InsightCategory;
|
|
98
|
+
showFieldMismatchNotice: boolean;
|
|
99
|
+
onDismisFieldMismatchNotice: () => void;
|
|
100
|
+
onClickMetric: (traceEvent: Trace.Types.Events.Event) => void;
|
|
101
|
+
renderInsightComponent: (insightData: InsightData) => Lit.LitTemplate;
|
|
102
|
+
}
|
|
119
103
|
|
|
120
|
-
|
|
104
|
+
type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
105
|
+
|
|
106
|
+
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
107
|
+
const {
|
|
108
|
+
shownInsights,
|
|
109
|
+
passedInsights,
|
|
110
|
+
local,
|
|
111
|
+
field,
|
|
112
|
+
activeCategory,
|
|
113
|
+
showFieldMismatchNotice,
|
|
114
|
+
onDismisFieldMismatchNotice,
|
|
115
|
+
onClickMetric,
|
|
116
|
+
renderInsightComponent,
|
|
117
|
+
} = input;
|
|
118
|
+
|
|
119
|
+
function renderMetrics(): Lit.TemplateResult {
|
|
120
|
+
const lcpEl = renderMetricValue('LCP', local?.lcp?.value ?? null, local?.lcp?.event ?? null);
|
|
121
|
+
const inpEl = renderMetricValue('INP', local?.inp?.value ?? null, local?.inp?.event ?? null);
|
|
122
|
+
const clsEl = renderMetricValue('CLS', local?.cls?.value ?? null, local?.cls?.worstClusterEvent ?? null);
|
|
121
123
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
const localMetricsTemplateResult = html`
|
|
125
|
+
<div class="metrics-row">
|
|
126
|
+
<span>${lcpEl}</span>
|
|
127
|
+
<span>${inpEl}</span>
|
|
128
|
+
<span>${clsEl}</span>
|
|
129
|
+
<span class="row-label">Local</span>
|
|
130
|
+
</div>
|
|
131
|
+
<span class="row-border"></span>
|
|
132
|
+
`;
|
|
128
133
|
|
|
129
|
-
|
|
130
|
-
|
|
134
|
+
let fieldMetricsTemplateResult;
|
|
135
|
+
if (field) {
|
|
136
|
+
const {lcp, inp, cls} = field;
|
|
131
137
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
connectedCallback(): void {
|
|
137
|
-
this.#render();
|
|
138
|
-
}
|
|
138
|
+
const lcpEl = renderMetricValue('LCP', lcp?.value ?? null, null);
|
|
139
|
+
const inpEl = renderMetricValue('INP', inp?.value ?? null, null);
|
|
140
|
+
const clsEl = renderMetricValue('CLS', cls?.value ?? null, null);
|
|
139
141
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
142
|
+
let scope = i18nString(UIStrings.originOption);
|
|
143
|
+
if (lcp?.pageScope === 'url' || inp?.pageScope === 'url') {
|
|
144
|
+
scope = i18nString(UIStrings.urlOption);
|
|
145
|
+
}
|
|
143
146
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
// clang-format off
|
|
148
|
+
fieldMetricsTemplateResult = html`
|
|
149
|
+
<div class="metrics-row">
|
|
150
|
+
<span>${lcpEl}</span>
|
|
151
|
+
<span>${inpEl}</span>
|
|
152
|
+
<span>${clsEl}</span>
|
|
153
|
+
<span class="row-label">${i18nString(UIStrings.fieldScoreLabel, {PH1: scope})}</span>
|
|
154
|
+
</div>
|
|
155
|
+
<span class="row-border"></span>
|
|
156
|
+
`;
|
|
157
|
+
// clang-format on
|
|
147
158
|
}
|
|
148
|
-
// First clear any existing highlight that is going on.
|
|
149
|
-
this.#activeInsightElement.removeAttribute('highlight-insight');
|
|
150
|
-
window.clearTimeout(this.#activeHighlightTimeout);
|
|
151
159
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
let fieldIsDifferentEl;
|
|
161
|
+
if (showFieldMismatchNotice) {
|
|
162
|
+
// clang-format off
|
|
163
|
+
fieldIsDifferentEl = html`
|
|
164
|
+
<div class="field-mismatch-notice" jslog=${VisualLogging.section('timeline.insights.field-mismatch')}>
|
|
165
|
+
<h3>${i18nString(UIStrings.fieldMismatchTitle)}</h3>
|
|
166
|
+
<devtools-button
|
|
167
|
+
title=${i18nString(UIStrings.dismissTitle)}
|
|
168
|
+
.iconName=${'cross'}
|
|
169
|
+
.variant=${Buttons.Button.Variant.ICON}
|
|
170
|
+
.jslogContext=${'timeline.insights.dismiss-field-mismatch'}
|
|
171
|
+
@click=${onDismisFieldMismatchNotice}
|
|
172
|
+
></devtools-button>
|
|
173
|
+
<div class="field-mismatch-notice__body">${md(i18nString(UIStrings.fieldMismatchNotice))}</div>
|
|
174
|
+
</div>
|
|
175
|
+
`;
|
|
176
|
+
// clang-format on
|
|
163
177
|
}
|
|
164
|
-
return label === this.#data.activeCategory;
|
|
165
|
-
}
|
|
166
178
|
|
|
167
|
-
|
|
168
|
-
|
|
179
|
+
const classes = {metrics: true, 'metrics--field': Boolean(fieldMetricsTemplateResult)};
|
|
180
|
+
const metricsTableEl = html`<div class=${Lit.Directives.classMap(classes)}>
|
|
181
|
+
<div class="metrics-row">
|
|
182
|
+
<span class="metric-label">LCP</span>
|
|
183
|
+
<span class="metric-label">INP</span>
|
|
184
|
+
<span class="metric-label">CLS</span>
|
|
185
|
+
<span class="row-label"></span>
|
|
186
|
+
</div>
|
|
187
|
+
${localMetricsTemplateResult}
|
|
188
|
+
${fieldMetricsTemplateResult}
|
|
189
|
+
</div>`;
|
|
190
|
+
|
|
191
|
+
return html`
|
|
192
|
+
${metricsTableEl}
|
|
193
|
+
${fieldIsDifferentEl}
|
|
194
|
+
`;
|
|
169
195
|
}
|
|
170
196
|
|
|
171
|
-
|
|
172
|
-
Lit.LitTemplate {
|
|
197
|
+
function renderMetricValue(
|
|
198
|
+
metric: 'LCP'|'CLS'|'INP', value: number|null, relevantEvent: Trace.Types.Events.Event|null): Lit.LitTemplate {
|
|
173
199
|
let valueText: string;
|
|
174
200
|
let valueDisplay: HTMLElement|string;
|
|
175
201
|
let classification;
|
|
@@ -207,9 +233,9 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
|
207
233
|
i18nString(UIStrings.metricScore, {PH1: metric, PH2: valueText, PH3: classification}) :
|
|
208
234
|
i18nString(UIStrings.metricScoreUnavailable, {PH1: metric});
|
|
209
235
|
|
|
210
|
-
return
|
|
236
|
+
return metricIsVisible(activeCategory, metric) ? html`
|
|
211
237
|
<button class="metric"
|
|
212
|
-
@click=${relevantEvent ?
|
|
238
|
+
@click=${relevantEvent ? onClickMetric.bind(relevantEvent) : null}
|
|
213
239
|
title=${title}
|
|
214
240
|
aria-label=${title}
|
|
215
241
|
>
|
|
@@ -219,15 +245,103 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
|
219
245
|
// clang-format on
|
|
220
246
|
}
|
|
221
247
|
|
|
222
|
-
|
|
223
|
-
|
|
248
|
+
function renderInsights(): Lit.LitTemplate {
|
|
249
|
+
const shownInsightTemplates = shownInsights.map(renderInsightComponent);
|
|
250
|
+
const passedInsightsTemplates = passedInsights.map(renderInsightComponent);
|
|
251
|
+
|
|
252
|
+
// clang-format off
|
|
253
|
+
return html`
|
|
254
|
+
${shownInsightTemplates}
|
|
255
|
+
${passedInsightsTemplates.length ? html`
|
|
256
|
+
<details class="passed-insights-section">
|
|
257
|
+
<summary>${i18nString(UIStrings.passedInsights, {
|
|
258
|
+
PH1: passedInsightsTemplates.length,
|
|
259
|
+
})}</summary>
|
|
260
|
+
${passedInsightsTemplates}
|
|
261
|
+
</details>
|
|
262
|
+
` : Lit.nothing}
|
|
263
|
+
`;
|
|
264
|
+
// clang-format on
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// clang-format off
|
|
268
|
+
Lit.render(html`
|
|
269
|
+
<style>${sidebarSingleInsightSetStyles}</style>
|
|
270
|
+
<div class="navigation">
|
|
271
|
+
${renderMetrics()}
|
|
272
|
+
${renderInsights()}
|
|
273
|
+
</div>
|
|
274
|
+
`, target);
|
|
275
|
+
// clang-format on
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
function metricIsVisible(activeCategory: Trace.Insights.Types.InsightCategory, label: 'LCP'|'CLS'|'INP'): boolean {
|
|
279
|
+
if (activeCategory === Trace.Insights.Types.InsightCategory.ALL) {
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return label === activeCategory;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export class SidebarSingleInsightSet extends UI.Widget.Widget {
|
|
287
|
+
#view: View;
|
|
288
|
+
#insightRenderer = new Insights.InsightRenderer.InsightRenderer();
|
|
289
|
+
#activeInsightElement: HTMLElement|null = null;
|
|
290
|
+
#activeHighlightTimeout = -1;
|
|
291
|
+
|
|
292
|
+
#data: SidebarSingleInsightSetData = {
|
|
293
|
+
insightSetKey: null,
|
|
294
|
+
activeCategory: Trace.Insights.Types.InsightCategory.ALL,
|
|
295
|
+
activeInsight: null,
|
|
296
|
+
parsedTrace: null,
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
#didDismissFieldMismatchNotice = false;
|
|
300
|
+
|
|
301
|
+
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
302
|
+
super(element, {useShadowDom: true});
|
|
303
|
+
this.#view = view;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
set data(data: SidebarSingleInsightSetData) {
|
|
307
|
+
this.#data = data;
|
|
308
|
+
this.requestUpdate();
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
override willHide(): void {
|
|
312
|
+
super.willHide();
|
|
313
|
+
window.clearTimeout(this.#activeHighlightTimeout);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
highlightActiveInsight(): void {
|
|
317
|
+
if (!this.#activeInsightElement) {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// First clear any existing highlight that is going on.
|
|
322
|
+
this.#activeInsightElement.removeAttribute('highlight-insight');
|
|
323
|
+
window.clearTimeout(this.#activeHighlightTimeout);
|
|
324
|
+
|
|
325
|
+
requestAnimationFrame(() => {
|
|
326
|
+
this.#activeInsightElement?.setAttribute('highlight-insight', 'true');
|
|
327
|
+
this.#activeHighlightTimeout = window.setTimeout(() => {
|
|
328
|
+
this.#activeInsightElement?.removeAttribute('highlight-insight');
|
|
329
|
+
}, 2_000);
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
#onClickMetric(traceEvent: Trace.Types.Events.Event): void {
|
|
334
|
+
this.element.dispatchEvent(new Insights.EventRef.EventReferenceClick(traceEvent));
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
#getLocalMetrics(insightSetKey: string): LocalMetrics|null {
|
|
224
338
|
if (!this.#data.parsedTrace) {
|
|
225
|
-
return
|
|
339
|
+
return null;
|
|
226
340
|
}
|
|
227
341
|
|
|
228
342
|
const insightSet = this.#data.parsedTrace.insights?.get(insightSetKey);
|
|
229
343
|
if (!insightSet) {
|
|
230
|
-
return
|
|
344
|
+
return null;
|
|
231
345
|
}
|
|
232
346
|
|
|
233
347
|
const lcp = Trace.Insights.Common.getLCP(insightSet);
|
|
@@ -256,251 +370,108 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
|
256
370
|
return fieldMetricsResults;
|
|
257
371
|
}
|
|
258
372
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
* CLS is ignored because the guidance of applying throttling or device emulation doesn't
|
|
263
|
-
* correlate as much with observing a more average user experience.
|
|
264
|
-
*/
|
|
265
|
-
#isFieldWorseThanLocal(local: {lcp?: Trace.Types.Timing.Milli, inp?: Trace.Types.Timing.Milli}, field: {
|
|
266
|
-
lcp?: Trace.Types.Timing.Milli,
|
|
267
|
-
inp?: Trace.Types.Timing.Milli,
|
|
268
|
-
}): boolean {
|
|
269
|
-
if (local.lcp !== undefined && field.lcp !== undefined) {
|
|
270
|
-
if (determineCompareRating('LCP', local.lcp, field.lcp) === 'better') {
|
|
271
|
-
return true;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
if (local.inp !== undefined && field.inp !== undefined) {
|
|
276
|
-
if (determineCompareRating('LCP', local.inp, field.inp) === 'better') {
|
|
277
|
-
return true;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
return false;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
#dismissFieldMismatchNotice(): void {
|
|
285
|
-
this.#dismissedFieldMismatchNotice = true;
|
|
286
|
-
this.#render();
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
#renderMetrics(insightSetKey: string): Lit.TemplateResult {
|
|
290
|
-
const local = this.#getLocalMetrics(insightSetKey);
|
|
291
|
-
const field = this.#getFieldMetrics(insightSetKey);
|
|
292
|
-
|
|
293
|
-
const lcpEl = this.#renderMetricValue('LCP', local.lcp?.value ?? null, local.lcp?.event ?? null);
|
|
294
|
-
const inpEl = this.#renderMetricValue('INP', local.inp?.value ?? null, local.inp?.event ?? null);
|
|
295
|
-
const clsEl = this.#renderMetricValue('CLS', local.cls?.value ?? null, local.cls?.worstClusterEvent ?? null);
|
|
296
|
-
|
|
297
|
-
const localMetricsTemplateResult = html`
|
|
298
|
-
<div class="metrics-row">
|
|
299
|
-
<span>${lcpEl}</span>
|
|
300
|
-
<span>${inpEl}</span>
|
|
301
|
-
<span>${clsEl}</span>
|
|
302
|
-
<span class="row-label">Local</span>
|
|
303
|
-
</div>
|
|
304
|
-
<span class="row-border"></span>
|
|
305
|
-
`;
|
|
306
|
-
|
|
307
|
-
let fieldMetricsTemplateResult;
|
|
308
|
-
if (field) {
|
|
309
|
-
const {lcp, inp, cls} = field;
|
|
310
|
-
|
|
311
|
-
const lcpEl = this.#renderMetricValue('LCP', lcp?.value ?? null, null);
|
|
312
|
-
const inpEl = this.#renderMetricValue('INP', inp?.value ?? null, null);
|
|
313
|
-
const clsEl = this.#renderMetricValue('CLS', cls?.value ?? null, null);
|
|
314
|
-
|
|
315
|
-
let scope = i18nString(UIStrings.originOption);
|
|
316
|
-
if (lcp?.pageScope === 'url' || inp?.pageScope === 'url') {
|
|
317
|
-
scope = i18nString(UIStrings.urlOption);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// clang-format off
|
|
321
|
-
fieldMetricsTemplateResult = html`
|
|
322
|
-
<div class="metrics-row">
|
|
323
|
-
<span>${lcpEl}</span>
|
|
324
|
-
<span>${inpEl}</span>
|
|
325
|
-
<span>${clsEl}</span>
|
|
326
|
-
<span class="row-label">${i18nString(UIStrings.fieldScoreLabel, {PH1: scope})}</span>
|
|
327
|
-
</div>
|
|
328
|
-
<span class="row-border"></span>
|
|
329
|
-
`;
|
|
330
|
-
// clang-format on
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
const localValues = {
|
|
334
|
-
lcp: local.lcp?.value !== undefined ? Trace.Helpers.Timing.microToMilli(local.lcp.value) : undefined,
|
|
335
|
-
inp: local.inp?.value !== undefined ? Trace.Helpers.Timing.microToMilli(local.inp.value) : undefined,
|
|
336
|
-
};
|
|
337
|
-
const fieldValues = field && {
|
|
338
|
-
lcp: field.lcp?.value !== undefined ? Trace.Helpers.Timing.microToMilli(field.lcp.value) : undefined,
|
|
339
|
-
inp: field.inp?.value !== undefined ? Trace.Helpers.Timing.microToMilli(field.inp.value) : undefined,
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
let fieldIsDifferentEl;
|
|
343
|
-
if (!this.#dismissedFieldMismatchNotice && fieldValues && this.#isFieldWorseThanLocal(localValues, fieldValues)) {
|
|
344
|
-
// clang-format off
|
|
345
|
-
fieldIsDifferentEl = html`
|
|
346
|
-
<div class="field-mismatch-notice" jslog=${VisualLogging.section('timeline.insights.field-mismatch')}>
|
|
347
|
-
<h3>${i18nString(UIStrings.fieldMismatchTitle)}</h3>
|
|
348
|
-
<devtools-button
|
|
349
|
-
title=${i18nString(UIStrings.dismissTitle)}
|
|
350
|
-
.iconName=${'cross'}
|
|
351
|
-
.variant=${Buttons.Button.Variant.ICON}
|
|
352
|
-
.jslogContext=${'timeline.insights.dismiss-field-mismatch'}
|
|
353
|
-
@click=${this.#dismissFieldMismatchNotice}
|
|
354
|
-
></devtools-button>
|
|
355
|
-
<div class="field-mismatch-notice__body">${md(i18nString(UIStrings.fieldMismatchNotice))}</div>
|
|
356
|
-
</div>
|
|
357
|
-
`;
|
|
358
|
-
// clang-format on
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
const classes = {metrics: true, 'metrics--field': Boolean(fieldMetricsTemplateResult)};
|
|
362
|
-
const metricsTableEl = html`<div class=${Lit.Directives.classMap(classes)}>
|
|
363
|
-
<div class="metrics-row">
|
|
364
|
-
<span class="metric-label">LCP</span>
|
|
365
|
-
<span class="metric-label">INP</span>
|
|
366
|
-
<span class="metric-label">CLS</span>
|
|
367
|
-
<span class="row-label"></span>
|
|
368
|
-
</div>
|
|
369
|
-
${localMetricsTemplateResult}
|
|
370
|
-
${fieldMetricsTemplateResult}
|
|
371
|
-
</div>`;
|
|
372
|
-
|
|
373
|
-
return html`
|
|
374
|
-
${metricsTableEl}
|
|
375
|
-
${fieldIsDifferentEl}
|
|
376
|
-
`;
|
|
373
|
+
#onDismisFieldMismatchNotice(): void {
|
|
374
|
+
this.#didDismissFieldMismatchNotice = true;
|
|
375
|
+
this.requestUpdate();
|
|
377
376
|
}
|
|
378
377
|
|
|
379
378
|
static categorizeInsights(
|
|
380
379
|
insightSets: Trace.Insights.Types.TraceInsightSets|null,
|
|
381
380
|
insightSetKey: string,
|
|
382
381
|
activeCategory: Trace.Insights.Types.InsightCategory,
|
|
383
|
-
): {shownInsights:
|
|
382
|
+
): {shownInsights: InsightData[], passedInsights: InsightData[]} {
|
|
384
383
|
const insightSet = insightSets?.get(insightSetKey);
|
|
385
384
|
if (!insightSet) {
|
|
386
385
|
return {shownInsights: [], passedInsights: []};
|
|
387
386
|
}
|
|
388
387
|
|
|
389
|
-
const shownInsights:
|
|
390
|
-
const passedInsights:
|
|
391
|
-
|
|
392
|
-
for (const [name, model] of Object.entries(insightSet.model)) {
|
|
393
|
-
const componentClass = INSIGHT_NAME_TO_COMPONENT[name as keyof Trace.Insights.Types.InsightModels];
|
|
394
|
-
if (!componentClass) {
|
|
395
|
-
continue;
|
|
396
|
-
}
|
|
388
|
+
const shownInsights: InsightData[] = [];
|
|
389
|
+
const passedInsights: InsightData[] = [];
|
|
397
390
|
|
|
391
|
+
for (const [insightName, model] of Object.entries(insightSet.model)) {
|
|
398
392
|
if (!model || !shouldRenderForCategory({activeCategory, insightCategory: model.category})) {
|
|
399
393
|
continue;
|
|
400
394
|
}
|
|
401
395
|
|
|
402
|
-
if (model instanceof Error) {
|
|
403
|
-
continue;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
396
|
if (model.state === 'pass') {
|
|
407
|
-
passedInsights.push({
|
|
397
|
+
passedInsights.push({insightName, model});
|
|
408
398
|
} else {
|
|
409
|
-
shownInsights.push({
|
|
399
|
+
shownInsights.push({insightName, model});
|
|
410
400
|
}
|
|
411
401
|
}
|
|
412
402
|
return {shownInsights, passedInsights};
|
|
413
403
|
}
|
|
414
404
|
|
|
415
|
-
#
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
const insightSet = insights?.get(insightSetKey);
|
|
420
|
-
if (!insightSet) {
|
|
405
|
+
#renderInsightComponent(
|
|
406
|
+
insightSet: Trace.Insights.Types.InsightSet, insightData: InsightData,
|
|
407
|
+
fieldMetrics: Trace.Insights.Common.CrUXFieldMetricResults|null): Lit.LitTemplate {
|
|
408
|
+
if (!this.#data.parsedTrace) {
|
|
421
409
|
return Lit.nothing;
|
|
422
410
|
}
|
|
423
411
|
|
|
424
|
-
const
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
insights,
|
|
428
|
-
insightSetKey,
|
|
429
|
-
this.#data.activeCategory,
|
|
430
|
-
);
|
|
431
|
-
|
|
432
|
-
const renderInsightComponent = (insightData: CategorizedInsightData): Lit.LitTemplate => {
|
|
433
|
-
const {componentClass, model} = insightData;
|
|
434
|
-
if (!this.#data.parsedTrace?.insights) {
|
|
435
|
-
return nothing;
|
|
436
|
-
}
|
|
412
|
+
const {insightName, model} = insightData;
|
|
413
|
+
const activeInsight = this.#data.activeInsight;
|
|
414
|
+
const agentFocus = AIAssistance.AIContext.AgentFocus.fromInsight(this.#data.parsedTrace, model);
|
|
437
415
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
${Lit.Directives.ref(elem => {
|
|
445
|
-
if(this.#data.activeInsight?.model === model && elem) {
|
|
446
|
-
this.#activeInsightElement = elem as BaseInsightComponent<Trace.Insights.Types.InsightModel>;
|
|
447
|
-
}
|
|
448
|
-
})}
|
|
449
|
-
.model=${model}
|
|
450
|
-
.bounds=${insightSet.bounds}
|
|
451
|
-
.insightSetKey=${insightSetKey}
|
|
452
|
-
.agentFocus=${agentFocus}
|
|
453
|
-
.fieldMetrics=${fieldMetrics}>
|
|
454
|
-
</${componentClass.litTagName}>
|
|
455
|
-
</div>`;
|
|
456
|
-
/* eslint-enable lit/binding-positions,lit/no-invalid-html */
|
|
457
|
-
// clang-format on
|
|
458
|
-
};
|
|
416
|
+
const widgetElement =
|
|
417
|
+
this.#insightRenderer.renderInsightToWidgetElement(this.#data.parsedTrace, insightSet, model, insightName, {
|
|
418
|
+
selected: activeInsight?.model === model,
|
|
419
|
+
agentFocus,
|
|
420
|
+
fieldMetrics,
|
|
421
|
+
});
|
|
459
422
|
|
|
460
|
-
|
|
461
|
-
|
|
423
|
+
if (activeInsight?.model === model) {
|
|
424
|
+
this.#activeInsightElement = widgetElement;
|
|
425
|
+
}
|
|
462
426
|
|
|
463
|
-
|
|
464
|
-
return html`
|
|
465
|
-
${shownInsights}
|
|
466
|
-
${passedInsights.length ? html`
|
|
467
|
-
<details class="passed-insights-section">
|
|
468
|
-
<summary>${i18nString(UIStrings.passedInsights, {
|
|
469
|
-
PH1: passedInsights.length,
|
|
470
|
-
})}</summary>
|
|
471
|
-
${passedInsights}
|
|
472
|
-
</details>
|
|
473
|
-
` : Lit.nothing}
|
|
474
|
-
`;
|
|
475
|
-
// clang-format on
|
|
427
|
+
return html`${widgetElement}`;
|
|
476
428
|
}
|
|
477
429
|
|
|
478
|
-
|
|
430
|
+
override performUpdate(): void {
|
|
479
431
|
const {
|
|
480
432
|
parsedTrace,
|
|
481
433
|
insightSetKey,
|
|
482
434
|
} = this.#data;
|
|
435
|
+
|
|
483
436
|
if (!parsedTrace?.insights || !insightSetKey) {
|
|
484
|
-
Lit.render(Lit.nothing, this.#shadow, {host: this});
|
|
485
437
|
return;
|
|
486
438
|
}
|
|
487
439
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
440
|
+
const insightSet = parsedTrace.insights.get(insightSetKey);
|
|
441
|
+
if (!insightSet) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
const local = this.#getLocalMetrics(insightSetKey);
|
|
446
|
+
const field = this.#getFieldMetrics(insightSetKey);
|
|
447
|
+
const {shownInsights, passedInsights} = SidebarSingleInsightSet.categorizeInsights(
|
|
448
|
+
parsedTrace.insights,
|
|
449
|
+
insightSetKey,
|
|
450
|
+
this.#data.activeCategory,
|
|
451
|
+
);
|
|
499
452
|
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
453
|
+
const localValues = {
|
|
454
|
+
lcp: local?.lcp?.value !== undefined ? Trace.Helpers.Timing.microToMilli(local?.lcp.value) : undefined,
|
|
455
|
+
inp: local?.inp?.value !== undefined ? Trace.Helpers.Timing.microToMilli(local?.inp.value) : undefined,
|
|
456
|
+
};
|
|
457
|
+
const fieldValues = field && {
|
|
458
|
+
lcp: field.lcp?.value !== undefined ? Trace.Helpers.Timing.microToMilli(field.lcp.value) : undefined,
|
|
459
|
+
inp: field.inp?.value !== undefined ? Trace.Helpers.Timing.microToMilli(field.inp.value) : undefined,
|
|
460
|
+
};
|
|
461
|
+
const showFieldMismatchNotice =
|
|
462
|
+
!this.#didDismissFieldMismatchNotice && !!fieldValues && isFieldWorseThanLocal(localValues, fieldValues);
|
|
463
|
+
|
|
464
|
+
const input: ViewInput = {
|
|
465
|
+
shownInsights,
|
|
466
|
+
passedInsights,
|
|
467
|
+
local,
|
|
468
|
+
field,
|
|
469
|
+
activeCategory: this.#data.activeCategory,
|
|
470
|
+
showFieldMismatchNotice,
|
|
471
|
+
onDismisFieldMismatchNotice: this.#onDismisFieldMismatchNotice.bind(this),
|
|
472
|
+
onClickMetric: this.#onClickMetric.bind(this),
|
|
473
|
+
renderInsightComponent: insightData => this.#renderInsightComponent(insightSet, insightData, field),
|
|
474
|
+
};
|
|
475
|
+
this.#view(input, undefined, this.contentElement);
|
|
503
476
|
}
|
|
504
477
|
}
|
|
505
|
-
|
|
506
|
-
customElements.define('devtools-performance-sidebar-single-navigation', SidebarSingleInsightSet);
|