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
|
@@ -37,25 +37,12 @@ export class StackTraceModel extends SDK.SDKModel.SDKModel<unknown> {
|
|
|
37
37
|
|
|
38
38
|
async createFromProtocolRuntime(stackTrace: Protocol.Runtime.StackTrace, rawFramesToUIFrames: TranslateRawFrames):
|
|
39
39
|
Promise<StackTrace.StackTrace.StackTrace> {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const asyncFragments: AsyncFragmentImpl[] = [];
|
|
46
|
-
const debuggerModel = this.target().model(SDK.DebuggerModel.DebuggerModel);
|
|
47
|
-
if (debuggerModel) {
|
|
48
|
-
for await (const {stackTrace: asyncStackTrace, target} of debuggerModel.iterateAsyncParents(stackTrace)) {
|
|
49
|
-
const model = StackTraceModel.#modelForTarget(target);
|
|
50
|
-
const asyncFragment = model.#createFragment(asyncStackTrace.callFrames);
|
|
51
|
-
translatePromises.push(model.#translateFragment(asyncFragment, rawFramesToUIFrames));
|
|
52
|
-
asyncFragments.push(new AsyncFragmentImpl(asyncStackTrace.description ?? '', asyncFragment));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
40
|
+
const [syncFragment, asyncFragments] = await Promise.all([
|
|
41
|
+
this.#createSyncFragment(stackTrace, rawFramesToUIFrames),
|
|
42
|
+
this.#createAsyncFragments(stackTrace, rawFramesToUIFrames),
|
|
43
|
+
]);
|
|
55
44
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return new StackTraceImpl(fragment, asyncFragments);
|
|
45
|
+
return new StackTraceImpl(syncFragment, asyncFragments);
|
|
59
46
|
}
|
|
60
47
|
|
|
61
48
|
/** Trigger re-translation of all fragments with the provide script in their call stack */
|
|
@@ -81,6 +68,38 @@ export class StackTraceModel extends SDK.SDKModel.SDKModel<unknown> {
|
|
|
81
68
|
}
|
|
82
69
|
}
|
|
83
70
|
|
|
71
|
+
async #createSyncFragment(stackTrace: Protocol.Runtime.StackTrace, rawFramesToUIFrames: TranslateRawFrames):
|
|
72
|
+
Promise<FragmentImpl> {
|
|
73
|
+
const fragment = this.#createFragment(stackTrace.callFrames);
|
|
74
|
+
await this.#translateFragment(fragment, rawFramesToUIFrames);
|
|
75
|
+
return fragment;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async #createAsyncFragments(
|
|
79
|
+
stackTraceOrPausedEvent: Protocol.Runtime.StackTrace|Protocol.Debugger.PausedEvent,
|
|
80
|
+
rawFramesToUIFrames: TranslateRawFrames): Promise<AsyncFragmentImpl[]> {
|
|
81
|
+
const asyncFragments: AsyncFragmentImpl[] = [];
|
|
82
|
+
const translatePromises: Array<Promise<unknown>> = [];
|
|
83
|
+
|
|
84
|
+
const debuggerModel = this.target().model(SDK.DebuggerModel.DebuggerModel);
|
|
85
|
+
if (debuggerModel) {
|
|
86
|
+
for await (
|
|
87
|
+
const {stackTrace: asyncStackTrace, target} of debuggerModel.iterateAsyncParents(stackTraceOrPausedEvent)) {
|
|
88
|
+
if (asyncStackTrace.callFrames.length === 0) {
|
|
89
|
+
// Skip empty async fragments, they don't add value.
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const model = StackTraceModel.#modelForTarget(target);
|
|
93
|
+
const fragment = model.#createFragment(asyncStackTrace.callFrames);
|
|
94
|
+
translatePromises.push(model.#translateFragment(fragment, rawFramesToUIFrames));
|
|
95
|
+
asyncFragments.push(new AsyncFragmentImpl(asyncStackTrace.description ?? '', fragment));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
await Promise.all(translatePromises);
|
|
100
|
+
return asyncFragments;
|
|
101
|
+
}
|
|
102
|
+
|
|
84
103
|
#createFragment(frames: RawFrame[]): FragmentImpl {
|
|
85
104
|
return FragmentImpl.getOrCreate(this.#trie.insert(frames));
|
|
86
105
|
}
|
|
@@ -376,10 +376,10 @@ export class TraceProcessor extends EventTarget {
|
|
|
376
376
|
const observedClsScore = Insights.Common.evaluateCLSMetricScore(observedCls);
|
|
377
377
|
|
|
378
378
|
const insightToSortingRank = new Map<string, number>();
|
|
379
|
-
for (const [name,
|
|
380
|
-
const lcp =
|
|
381
|
-
const inp =
|
|
382
|
-
const cls =
|
|
379
|
+
for (const [name, insight] of Object.entries(insightSet.model)) {
|
|
380
|
+
const lcp = insight.metricSavings?.LCP ?? 0;
|
|
381
|
+
const inp = insight.metricSavings?.INP ?? 0;
|
|
382
|
+
const cls = insight.metricSavings?.CLS ?? 0;
|
|
383
383
|
|
|
384
384
|
const lcpPostSavings =
|
|
385
385
|
observedLcp !== undefined ? Math.max(0, observedLcp - lcp) as Types.Timing.Milli : undefined;
|
|
@@ -445,13 +445,13 @@ export class TraceProcessor extends EventTarget {
|
|
|
445
445
|
urlString = data.Meta.finalDisplayUrlByNavigationId.get('') ?? data.Meta.mainFrameURL;
|
|
446
446
|
}
|
|
447
447
|
|
|
448
|
-
const insightSetModel = {} as Insights.Types.
|
|
448
|
+
const insightSetModel = {} as Insights.Types.InsightModels;
|
|
449
|
+
const insightSetModelErrors: Insights.Types.InsightModelErrors = {};
|
|
449
450
|
|
|
450
451
|
for (const [name, insight] of Object.entries(TraceProcessor.getInsightRunners())) {
|
|
451
|
-
let model: Insights.Types.InsightModel|Error;
|
|
452
452
|
try {
|
|
453
453
|
logger?.start(`insights:${name}`);
|
|
454
|
-
model = insight.generateInsight(data, context);
|
|
454
|
+
const model = insight.generateInsight(data, context);
|
|
455
455
|
model.frameId = context.frameId;
|
|
456
456
|
const navId = context.navigation?.args.data?.navigationId;
|
|
457
457
|
if (navId) {
|
|
@@ -461,12 +461,12 @@ export class TraceProcessor extends EventTarget {
|
|
|
461
461
|
// @ts-expect-error: model is a union of all possible insight model types.
|
|
462
462
|
return insight.createOverlays(model);
|
|
463
463
|
};
|
|
464
|
+
Object.assign(insightSetModel, {[name]: model});
|
|
464
465
|
} catch (err) {
|
|
465
|
-
|
|
466
|
+
Object.assign(insightSetModelErrors, {[name]: err});
|
|
466
467
|
} finally {
|
|
467
468
|
logger?.end(`insights:${name}`);
|
|
468
469
|
}
|
|
469
|
-
Object.assign(insightSetModel, {[name]: model});
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
// We may choose to exclude the insightSet if it's trivial. Trivial means:
|
|
@@ -477,13 +477,11 @@ export class TraceProcessor extends EventTarget {
|
|
|
477
477
|
// Generally, these cases are the short time ranges before a page reload starts.
|
|
478
478
|
const isNavigation = id === Types.Events.NO_NAVIGATION;
|
|
479
479
|
const trivialThreshold = Helpers.Timing.milliToMicro(Types.Timing.Milli(5000));
|
|
480
|
-
const everyInsightPasses = Object.values(insightSetModel)
|
|
481
|
-
.filter(model => !(model instanceof Error))
|
|
482
|
-
.every(model => model.state === 'pass');
|
|
480
|
+
const everyInsightPasses = Object.values(insightSetModel).every(model => model && model.state === 'pass');
|
|
483
481
|
|
|
484
|
-
const noLcp = !insightSetModel.LCPBreakdown
|
|
485
|
-
const noInp = !insightSetModel.INPBreakdown
|
|
486
|
-
const noLayoutShifts = insightSetModel.CLSCulprits
|
|
482
|
+
const noLcp = !insightSetModel.LCPBreakdown?.lcpEvent;
|
|
483
|
+
const noInp = !insightSetModel.INPBreakdown?.longestInteractionEvent;
|
|
484
|
+
const noLayoutShifts = insightSetModel.CLSCulprits?.shifts?.size === 0;
|
|
487
485
|
const shouldExclude = isNavigation && context.bounds.range < trivialThreshold && everyInsightPasses && noLcp &&
|
|
488
486
|
noInp && noLayoutShifts;
|
|
489
487
|
if (shouldExclude) {
|
|
@@ -506,6 +504,7 @@ export class TraceProcessor extends EventTarget {
|
|
|
506
504
|
frameId: context.frameId,
|
|
507
505
|
bounds: context.bounds,
|
|
508
506
|
model: insightSetModel,
|
|
507
|
+
modelErrors: insightSetModelErrors,
|
|
509
508
|
};
|
|
510
509
|
this.#insights.set(insightSet.id, insightSet);
|
|
511
510
|
this.sortInsightSet(insightSet, context.options.metadata ?? null);
|
|
@@ -22,14 +22,8 @@ import {
|
|
|
22
22
|
const GRAPH_SAVINGS_PRECISION = 50;
|
|
23
23
|
|
|
24
24
|
export function getInsight<InsightName extends keyof InsightModels>(
|
|
25
|
-
insightName: InsightName, insightSet: InsightSet): InsightModels[InsightName]
|
|
26
|
-
|
|
27
|
-
if (insight instanceof Error) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// For some reason typescript won't narrow the type by removing Error, so do it manually.
|
|
32
|
-
return insight;
|
|
25
|
+
insightName: InsightName, insightSet: InsightSet): InsightModels[InsightName] {
|
|
26
|
+
return insightSet.model[insightName];
|
|
33
27
|
}
|
|
34
28
|
|
|
35
29
|
export function getLCP(insightSet: InsightSet):
|
|
@@ -116,15 +116,25 @@ export interface InsightSet {
|
|
|
116
116
|
url: URL;
|
|
117
117
|
frameId: string;
|
|
118
118
|
bounds: Types.Timing.TraceWindowMicro;
|
|
119
|
+
/** Contains results for all non-errored insights. */
|
|
119
120
|
model: InsightModels;
|
|
121
|
+
/** Contains errors for all insights that had an internal error. */
|
|
122
|
+
modelErrors: InsightModelErrors;
|
|
120
123
|
navigation?: Types.Events.NavigationStart;
|
|
121
124
|
}
|
|
122
125
|
|
|
123
126
|
/**
|
|
124
|
-
* Contains insights for a specific insight set.
|
|
127
|
+
* Contains insights for a specific insight set. If missing, it error'd.
|
|
125
128
|
*/
|
|
126
129
|
export type InsightModels = {
|
|
127
|
-
[I in keyof InsightModelsType]
|
|
130
|
+
[I in keyof InsightModelsType]?: ReturnType<InsightModelsType[I]['generateInsight']>;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Contains an internal error for each insight in a specific insight set.
|
|
135
|
+
*/
|
|
136
|
+
export type InsightModelErrors = {
|
|
137
|
+
[I in keyof InsightModelsType]?: Error;
|
|
128
138
|
};
|
|
129
139
|
|
|
130
140
|
/**
|
|
@@ -85,6 +85,9 @@ export interface Event {
|
|
|
85
85
|
tdur?: Micro;
|
|
86
86
|
dur?: Micro;
|
|
87
87
|
}
|
|
88
|
+
export function objectIsEvent(obj: object): obj is Event {
|
|
89
|
+
return 'cat' in obj && 'name' in obj && 'ts' in obj;
|
|
90
|
+
}
|
|
88
91
|
|
|
89
92
|
export interface Args {
|
|
90
93
|
data?: ArgsData;
|
|
@@ -954,7 +957,7 @@ export interface TraceImpactedNode {
|
|
|
954
957
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
955
958
|
}
|
|
956
959
|
|
|
957
|
-
type LayoutShiftData = ArgsData&{
|
|
960
|
+
export type LayoutShiftData = ArgsData&{
|
|
958
961
|
// These keys come from the trace data, so we have to use underscores.
|
|
959
962
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
960
963
|
cumulative_score: number,
|
|
@@ -2,7 +2,7 @@
|
|
|
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/
|
|
5
|
+
import '../../ui/kit/kit.js';
|
|
6
6
|
|
|
7
7
|
import * as Common from '../../core/common/common.js';
|
|
8
8
|
import * as Host from '../../core/host/host.js';
|
|
@@ -15,6 +15,7 @@ import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js'
|
|
|
15
15
|
import * as Badges from '../../models/badges/badges.js';
|
|
16
16
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
17
17
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
18
|
+
import * as Annotations from '../../ui/components/annotations/annotations.js';
|
|
18
19
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
19
20
|
import * as Snackbars from '../../ui/components/snackbars/snackbars.js';
|
|
20
21
|
import * as UIHelpers from '../../ui/helpers/helpers.js';
|
|
@@ -276,7 +277,7 @@ function getMarkdownRenderer(
|
|
|
276
277
|
if (!context.external) {
|
|
277
278
|
const focus = context.getItem();
|
|
278
279
|
return new PerformanceAgentMarkdownRenderer(
|
|
279
|
-
focus.parsedTrace.data.Meta.mainFrameId, focus.lookupEvent.bind(focus));
|
|
280
|
+
focus.parsedTrace.data.Meta.mainFrameId, focus.lookupEvent.bind(focus), focus.parsedTrace);
|
|
280
281
|
}
|
|
281
282
|
} else if (conversation?.type === AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE) {
|
|
282
283
|
// Handle historical conversations (can't linkify anything).
|
|
@@ -364,12 +365,12 @@ function toolbarView(input: ToolbarViewInput): Lit.LitTemplate {
|
|
|
364
365
|
: Lit.nothing}
|
|
365
366
|
</devtools-toolbar>
|
|
366
367
|
<devtools-toolbar class="freestyler-right-toolbar" role="presentation">
|
|
367
|
-
<
|
|
368
|
-
class="toolbar-feedback-link
|
|
368
|
+
<devtools-link
|
|
369
|
+
class="toolbar-feedback-link"
|
|
369
370
|
title=${i18nString(UIStrings.sendFeedback)}
|
|
370
371
|
href=${AI_ASSISTANCE_SEND_FEEDBACK}
|
|
371
|
-
|
|
372
|
-
>${i18nString(UIStrings.sendFeedback)}</
|
|
372
|
+
jslogcontext=${'freestyler.send-feedback'}
|
|
373
|
+
>${i18nString(UIStrings.sendFeedback)}</devtools-link>
|
|
373
374
|
<div class="toolbar-divider"></div>
|
|
374
375
|
<devtools-button
|
|
375
376
|
title=${i18nString(UIStrings.help)}
|
|
@@ -505,6 +506,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
505
506
|
#isTextInputEmpty = true;
|
|
506
507
|
#timelinePanelInstance: TimelinePanel.TimelinePanel.TimelinePanel|null = null;
|
|
507
508
|
#runAbortController = new AbortController();
|
|
509
|
+
#additionalContextItemsFromFloaty: UI.Floaty.FloatyContextSelection[] = [];
|
|
508
510
|
|
|
509
511
|
constructor(private view: View = defaultView, {aidaClient, aidaAvailability, syncInfo}: {
|
|
510
512
|
aidaClient: Host.AidaClient.AidaClient,
|
|
@@ -549,6 +551,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
549
551
|
return {
|
|
550
552
|
state: ViewState.CHAT_VIEW,
|
|
551
553
|
props: {
|
|
554
|
+
additionalFloatyContext: this.#additionalContextItemsFromFloaty,
|
|
552
555
|
blockedByCrossOrigin: this.#blockedByCrossOrigin,
|
|
553
556
|
isLoading: this.#isLoading,
|
|
554
557
|
messages: this.#messages,
|
|
@@ -649,6 +652,15 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
649
652
|
}
|
|
650
653
|
}
|
|
651
654
|
|
|
655
|
+
#bindFloatyListener(): void {
|
|
656
|
+
const additionalContexts = UI.Context.Context.instance().flavor(UI.Floaty.FloatyFlavor);
|
|
657
|
+
if (!additionalContexts) {
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
this.#additionalContextItemsFromFloaty = additionalContexts.selectedContexts;
|
|
661
|
+
this.requestUpdate();
|
|
662
|
+
}
|
|
663
|
+
|
|
652
664
|
#getDefaultConversationType(): AiAssistanceModel.AiHistoryStorage.ConversationType|undefined {
|
|
653
665
|
const {hostConfig} = Root.Runtime;
|
|
654
666
|
const viewManager = UI.ViewManager.ViewManager.instance();
|
|
@@ -765,6 +777,11 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
765
777
|
this.#selectDefaultAgentIfNeeded();
|
|
766
778
|
|
|
767
779
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiAssistancePanelOpened);
|
|
780
|
+
|
|
781
|
+
if (Root.Runtime.hostConfig.devToolsGreenDevUi?.enabled) {
|
|
782
|
+
UI.Context.Context.instance().addFlavorChangeListener(UI.Floaty.FloatyFlavor, this.#bindFloatyListener, this);
|
|
783
|
+
this.#bindFloatyListener();
|
|
784
|
+
}
|
|
768
785
|
}
|
|
769
786
|
|
|
770
787
|
override willHide(): void {
|
|
@@ -1236,6 +1253,10 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1236
1253
|
#handleNewChatRequest(): void {
|
|
1237
1254
|
this.#updateConversationState();
|
|
1238
1255
|
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.newChatCreated));
|
|
1256
|
+
|
|
1257
|
+
if (Annotations.AnnotationRepository.annotationsEnabled()) {
|
|
1258
|
+
Annotations.AnnotationRepository.instance().deleteAllAnnotations();
|
|
1259
|
+
}
|
|
1239
1260
|
}
|
|
1240
1261
|
|
|
1241
1262
|
async #handleTakeScreenshot(): Promise<void> {
|
|
@@ -1409,6 +1430,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1409
1430
|
text, {
|
|
1410
1431
|
signal,
|
|
1411
1432
|
selected: context,
|
|
1433
|
+
extraContext: this.#additionalContextItemsFromFloaty,
|
|
1412
1434
|
},
|
|
1413
1435
|
multimodalInput),
|
|
1414
1436
|
);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
7
|
import type * as Platform from '../../core/platform/platform.js';
|
|
8
|
-
import * as Root from '../../core/root/root.js';
|
|
8
|
+
import type * as Root from '../../core/root/root.js';
|
|
9
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
10
|
|
|
11
11
|
import type * as AiAssistance from './ai_assistance.js';
|
|
@@ -29,11 +29,6 @@ const UIStrings = {
|
|
|
29
29
|
* the settings tab.
|
|
30
30
|
*/
|
|
31
31
|
enableAiAssistance: 'Enable AI assistance',
|
|
32
|
-
/**
|
|
33
|
-
* @description Text of a tooltip to redirect to the AI assistance panel with
|
|
34
|
-
* the current element as context
|
|
35
|
-
*/
|
|
36
|
-
askAi: 'Ask AI',
|
|
37
32
|
/**
|
|
38
33
|
* @description Text of a context menu item to redirect to the AI assistance panel with
|
|
39
34
|
* the current context
|
|
@@ -104,21 +99,12 @@ function isAnyFeatureAvailable(config?: Root.Runtime.HostConfig): boolean {
|
|
|
104
99
|
isPerformanceAgentFeatureAvailable(config) || isFileAgentFeatureAvailable(config);
|
|
105
100
|
}
|
|
106
101
|
|
|
107
|
-
function titleForAiAssistanceActions(): Platform.UIString.LocalizedString {
|
|
108
|
-
if (Root.Runtime.hostConfig.devToolsAiDebugWithAi?.enabled ||
|
|
109
|
-
Root.Runtime.hostConfig.devToolsAiSubmenuPrompts?.enabled) {
|
|
110
|
-
return i18nLazyString(UIStrings.debugWithAi)();
|
|
111
|
-
}
|
|
112
|
-
return i18nLazyString(UIStrings.askAi)();
|
|
113
|
-
}
|
|
114
|
-
|
|
115
102
|
UI.ViewManager.registerViewExtension({
|
|
116
103
|
location: UI.ViewManager.ViewLocationValues.DRAWER_VIEW,
|
|
117
104
|
id: 'freestyler',
|
|
118
105
|
commandPrompt: i18nLazyString(UIStrings.showAiAssistance),
|
|
119
106
|
title: i18nLazyString(UIStrings.aiAssistance),
|
|
120
107
|
order: 10,
|
|
121
|
-
featurePromotionId: 'ai-assistance',
|
|
122
108
|
persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
|
|
123
109
|
hasToolbar: false,
|
|
124
110
|
condition: config => isAnyFeatureAvailable(config) && !isPolicyRestricted(config),
|
|
@@ -160,7 +146,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
160
146
|
return [];
|
|
161
147
|
},
|
|
162
148
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
163
|
-
title:
|
|
149
|
+
title: i18nLazyString(UIStrings.debugWithAi),
|
|
164
150
|
configurableBindings: false,
|
|
165
151
|
featurePromotionId: 'ai-assistance',
|
|
166
152
|
async loadActionDelegate() {
|
|
@@ -176,7 +162,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
176
162
|
return [];
|
|
177
163
|
},
|
|
178
164
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
179
|
-
title:
|
|
165
|
+
title: i18nLazyString(UIStrings.debugWithAi),
|
|
180
166
|
configurableBindings: false,
|
|
181
167
|
async loadActionDelegate() {
|
|
182
168
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -192,7 +178,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
192
178
|
return [];
|
|
193
179
|
},
|
|
194
180
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
195
|
-
title:
|
|
181
|
+
title: i18nLazyString(UIStrings.debugWithAi),
|
|
196
182
|
configurableBindings: false,
|
|
197
183
|
async loadActionDelegate() {
|
|
198
184
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -208,7 +194,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
208
194
|
return [];
|
|
209
195
|
},
|
|
210
196
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
211
|
-
title:
|
|
197
|
+
title: i18nLazyString(UIStrings.debugWithAi),
|
|
212
198
|
configurableBindings: false,
|
|
213
199
|
async loadActionDelegate() {
|
|
214
200
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -224,7 +210,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
224
210
|
return [];
|
|
225
211
|
},
|
|
226
212
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
227
|
-
title:
|
|
213
|
+
title: i18nLazyString(UIStrings.debugWithAi),
|
|
228
214
|
configurableBindings: false,
|
|
229
215
|
async loadActionDelegate() {
|
|
230
216
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -240,7 +226,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
240
226
|
return [];
|
|
241
227
|
},
|
|
242
228
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
243
|
-
title:
|
|
229
|
+
title: i18nLazyString(UIStrings.debugWithAi),
|
|
244
230
|
configurableBindings: false,
|
|
245
231
|
async loadActionDelegate() {
|
|
246
232
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -256,7 +242,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
256
242
|
return [];
|
|
257
243
|
},
|
|
258
244
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
259
|
-
title:
|
|
245
|
+
title: i18nLazyString(UIStrings.debugWithAi),
|
|
260
246
|
configurableBindings: false,
|
|
261
247
|
async loadActionDelegate() {
|
|
262
248
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -271,7 +257,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
271
257
|
return [];
|
|
272
258
|
},
|
|
273
259
|
category: UI.ActionRegistration.ActionCategory.GLOBAL,
|
|
274
|
-
title:
|
|
260
|
+
title: i18nLazyString(UIStrings.debugWithAi),
|
|
275
261
|
configurableBindings: false,
|
|
276
262
|
async loadActionDelegate() {
|
|
277
263
|
const AiAssistance = await loadAiAssistanceModule();
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export * from './AiAssistancePanel.js';
|
|
6
6
|
export * from './components/ChatView.js';
|
|
7
7
|
export * from './components/MarkdownRendererWithCodeBlock.js';
|
|
8
|
+
export * from './components/PerformanceAgentFlameChart.js';
|
|
8
9
|
export * from './SelectWorkspaceDialog.js';
|
|
9
10
|
export * as UserActionRow from './components/UserActionRow.js';
|
|
10
11
|
export * as ExploreWidget from './components/ExploreWidget.js';
|
|
@@ -8,9 +8,11 @@ import '../../../ui/components/spinners/spinners.js';
|
|
|
8
8
|
|
|
9
9
|
import * as Host from '../../../core/host/host.js';
|
|
10
10
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
11
|
-
import
|
|
11
|
+
import * as Platform from '../../../core/platform/platform.js';
|
|
12
|
+
import * as Root from '../../../core/root/root.js';
|
|
12
13
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
13
14
|
import * as AiAssistanceModel from '../../../models/ai_assistance/ai_assistance.js';
|
|
15
|
+
import * as Trace from '../../../models/trace/trace.js';
|
|
14
16
|
import * as Workspace from '../../../models/workspace/workspace.js';
|
|
15
17
|
import * as PanelsCommon from '../../../panels/common/common.js';
|
|
16
18
|
import * as PanelUtils from '../../../panels/utils/utils.js';
|
|
@@ -265,6 +267,7 @@ export interface Props {
|
|
|
265
267
|
isTextInputEmpty: boolean;
|
|
266
268
|
uploadImageInputEnabled?: boolean;
|
|
267
269
|
markdownRenderer: MarkdownLitRenderer;
|
|
270
|
+
additionalFloatyContext: UI.Floaty.FloatyContextSelection[];
|
|
268
271
|
}
|
|
269
272
|
|
|
270
273
|
export class ChatView extends HTMLElement {
|
|
@@ -517,7 +520,8 @@ export class ChatView extends HTMLElement {
|
|
|
517
520
|
onTakeScreenshot: this.#props.onTakeScreenshot,
|
|
518
521
|
onRemoveImageInput: this.#props.onRemoveImageInput,
|
|
519
522
|
onTextInputChange: this.#props.onTextInputChange,
|
|
520
|
-
onImageUpload: this.#handleImageUpload
|
|
523
|
+
onImageUpload: this.#handleImageUpload,
|
|
524
|
+
additionalFloatyContext: this.#props.additionalFloatyContext,
|
|
521
525
|
});
|
|
522
526
|
};
|
|
523
527
|
|
|
@@ -1347,6 +1351,7 @@ function renderChatInput({
|
|
|
1347
1351
|
isTextInputEmpty,
|
|
1348
1352
|
uploadImageInputEnabled,
|
|
1349
1353
|
disclaimerText,
|
|
1354
|
+
additionalFloatyContext,
|
|
1350
1355
|
onContextClick,
|
|
1351
1356
|
onInspectElementClick,
|
|
1352
1357
|
onSubmit,
|
|
@@ -1365,6 +1370,7 @@ function renderChatInput({
|
|
|
1365
1370
|
selectedContext: AiAssistanceModel.AiAgent.ConversationContext<unknown>|null,
|
|
1366
1371
|
inspectElementToggled: boolean,
|
|
1367
1372
|
isTextInputEmpty: boolean,
|
|
1373
|
+
additionalFloatyContext: UI.Floaty.FloatyContextSelection[],
|
|
1368
1374
|
disclaimerText: string,
|
|
1369
1375
|
onContextClick: () => void,
|
|
1370
1376
|
onInspectElementClick: () => void,
|
|
@@ -1389,6 +1395,7 @@ function renderChatInput({
|
|
|
1389
1395
|
|
|
1390
1396
|
// clang-format off
|
|
1391
1397
|
return html` <form class="input-form" @submit=${onSubmit}>
|
|
1398
|
+
${renderFloatyExtraContext(additionalFloatyContext)}
|
|
1392
1399
|
<div class=${chatInputContainerCls}>
|
|
1393
1400
|
${renderImageInput({
|
|
1394
1401
|
multimodalInputEnabled,
|
|
@@ -1463,6 +1470,75 @@ function renderChatInput({
|
|
|
1463
1470
|
// clang-format on
|
|
1464
1471
|
}
|
|
1465
1472
|
|
|
1473
|
+
function renderFloatyExtraContext(contexts: UI.Floaty.FloatyContextSelection[]): Lit.LitTemplate {
|
|
1474
|
+
if (!Root.Runtime.hostConfig.devToolsGreenDevUi?.enabled) {
|
|
1475
|
+
return Lit.nothing;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
// clang-format off
|
|
1479
|
+
return html`
|
|
1480
|
+
<ul class="floaty">
|
|
1481
|
+
${contexts.map(c => {
|
|
1482
|
+
function onDelete(e: MouseEvent): void {
|
|
1483
|
+
e.preventDefault();
|
|
1484
|
+
UI.Floaty.onFloatyContextDelete(c);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
return html`<li>
|
|
1488
|
+
<span class="context-item">
|
|
1489
|
+
${renderFloatyContext(c)}
|
|
1490
|
+
</span>
|
|
1491
|
+
<devtools-button
|
|
1492
|
+
class="floaty-delete-button"
|
|
1493
|
+
@click=${onDelete}
|
|
1494
|
+
.data=${{
|
|
1495
|
+
variant: Buttons.Button.Variant.ICON,
|
|
1496
|
+
iconName: 'cross',
|
|
1497
|
+
title: 'Delete',
|
|
1498
|
+
size: Buttons.Button.Size.SMALL,
|
|
1499
|
+
} as Buttons.Button.ButtonData}
|
|
1500
|
+
></devtools-button>
|
|
1501
|
+
</li>`;
|
|
1502
|
+
})}
|
|
1503
|
+
<li class="open-floaty">
|
|
1504
|
+
<devtools-button
|
|
1505
|
+
class="floaty-add-button"
|
|
1506
|
+
@click=${UI.Floaty.onFloatyOpen}
|
|
1507
|
+
.data=${{
|
|
1508
|
+
variant: Buttons.Button.Variant.ICON,
|
|
1509
|
+
iconName: 'select-element',
|
|
1510
|
+
title: 'Open context picker',
|
|
1511
|
+
size: Buttons.Button.Size.SMALL,
|
|
1512
|
+
} as Buttons.Button.ButtonData}
|
|
1513
|
+
></devtools-button>
|
|
1514
|
+
</li>
|
|
1515
|
+
</ul>
|
|
1516
|
+
`;
|
|
1517
|
+
// clang-format on
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
function renderFloatyContext(context: UI.Floaty.FloatyContextSelection): Lit.TemplateResult {
|
|
1521
|
+
if (context instanceof SDK.NetworkRequest.NetworkRequest) {
|
|
1522
|
+
return html`${context.url()}`;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
if (context instanceof SDK.DOMModel.DOMNode) {
|
|
1526
|
+
return html`<devtools-widget .widgetConfig=${
|
|
1527
|
+
UI.Widget.widgetConfig(PanelsCommon.DOMLinkifier.DOMNodeLink, {node: context})}>`;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
if ('insight' in context) {
|
|
1531
|
+
return html`${context.insight.title}`;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
if ('event' in context && 'traceStartTime' in context) {
|
|
1535
|
+
const time = Trace.Types.Timing.Micro(context.event.ts - context.traceStartTime);
|
|
1536
|
+
return html`${context.event.name} @ ${i18n.TimeUtilities.formatMicroSecondsAsMillisFixed(time)}`;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
Platform.assertNever(context, 'Unsupported context');
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1466
1542
|
function renderMainContents({
|
|
1467
1543
|
messages,
|
|
1468
1544
|
isLoading,
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Copyright 2025 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
6
|
+
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
7
|
+
import * as Lit from '../../../ui/lit/lit.js';
|
|
8
|
+
|
|
9
|
+
import styles from './collapsibleAssistanceContentWidget.css.js';
|
|
10
|
+
|
|
11
|
+
const {render, html} = Lit;
|
|
12
|
+
|
|
13
|
+
export interface CollapsibleAssistanceContentWidgetData {
|
|
14
|
+
headerText: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class CollapsibleAssistanceContentWidget extends HTMLElement {
|
|
18
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
19
|
+
#isCollapsed = true;
|
|
20
|
+
#headerText = 'Details';
|
|
21
|
+
|
|
22
|
+
set data(data: CollapsibleAssistanceContentWidgetData) {
|
|
23
|
+
this.#headerText = data.headerText;
|
|
24
|
+
this.#render();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
connectedCallback(): void {
|
|
28
|
+
this.#render();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#toggleCollapse(): void {
|
|
32
|
+
this.#isCollapsed = !this.#isCollapsed;
|
|
33
|
+
this.#render();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#render(): void {
|
|
37
|
+
// clang-format off
|
|
38
|
+
const output = html`
|
|
39
|
+
<style>${styles}</style>
|
|
40
|
+
<details ?open=${!this.#isCollapsed}>
|
|
41
|
+
<summary class="header" @click=${(event: Event) => {
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
this.#toggleCollapse();
|
|
44
|
+
}}>
|
|
45
|
+
<devtools-button .data=${{
|
|
46
|
+
variant: Buttons.Button.Variant.ICON,
|
|
47
|
+
iconName: this.#isCollapsed ? 'triangle-right' : 'triangle-down',
|
|
48
|
+
color: 'var(--sys-color-on-surface)',
|
|
49
|
+
width: '14px',
|
|
50
|
+
height: '14px',
|
|
51
|
+
} as Buttons.Button.ButtonData}
|
|
52
|
+
>
|
|
53
|
+
</devtools-button>
|
|
54
|
+
${this.#headerText}
|
|
55
|
+
</summary>
|
|
56
|
+
<div class="content">
|
|
57
|
+
<slot></slot>
|
|
58
|
+
</div>
|
|
59
|
+
</details>
|
|
60
|
+
`;
|
|
61
|
+
render(output, this.#shadow, {host: this});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
customElements.define('devtools-collapsible-assistance-content-widget', CollapsibleAssistanceContentWidget);
|
|
66
|
+
|
|
67
|
+
declare global {
|
|
68
|
+
interface HTMLElementTagNameMap {
|
|
69
|
+
'devtools-collapsible-assistance-content-widget': CollapsibleAssistanceContentWidget;
|
|
70
|
+
}
|
|
71
|
+
}
|